No recoil Bf3.code

Posts 1–14 of 14 · Page 1 of 1
No recoil Bf3.code
So here is an easy way to do no recoil and no spread with absolutely no reversing of classes.

Make your type definition:

PHP Code:
typedef const void * ( __fastcall* tGetRecoil )( void *thisptr, void *unknown, void *a2, char a3 );

const void* __fastcall hkGetRecoil( void *thisptr, void *unknown, void *a2, char a3 );
tGetRecoil oGetRecoil = NULL;
Do hook
.................................................. .................................................. .................................................. ...
PHP Code:
//I'm lazy, so this is an easy way to backup the function
oGetRecoil = (tGetRecoil)DetourFunction( (BYTE*)0x0077B350, (BYTE*)&hkGetRecoil );
//Retour so you won't get kicked (just copies over 6 bytes)
memcpy_safe_retour( (BYTE *)0x0077B350, (BYTE *)"\x55\x8B\xEC\x83\xE4\xF0" );
//Hook here (copies 4 bytes -> address off hkGetRecoil)
memcpy_safe_dword( (BYTE *)0x2096D54, (BYTE *)hkGetRecoil );
To explain the above code, DetourFunction will back up all the bytes for you, so you can call the original function.
However, detours will overwrite the first 6 bytes and PB will kick you for corrupted memory.
To avoid that, we retour, (put in the original 6 bytes)
Then we can hook in another spot, where PB doesn't scan.
.................................................. .................................................. ........................
PHP Code:
const void* __fastcall hkGetRecoil( void *thisptr, void *unknown, void *a2, char a3 )
{
__asm pushad;

//just an example, the class is exactly the same as in the PDB no reversing equired
//thisptr = fb::GunSway
//if you have class from my other post you can type cast it
//fb::GunSway* gunSway = (fb::GunSway *)thisptr;


DWORD fb__gunSway = (DWORD )thisptr;

*( float *)( fb__gunSway + 0xAC ) = 0.0f; //m_DeviationPitch
*( float *)( fb__gunSway + 0xB0 ) = 0.0f; //m_DeviationYaw
*( float *)( fb__gunSway + 0xB4 ) = 0.0f; //m_DeviationRoll
*( float *)( fb__gunSway + 0xB8 ) = 0.0f; //m_DeviationTransY

*( float *)( fb__gunSway + 0x120 ) = 0.0f; //m_dispersionAngle
*( float *)( fb__gunSway + 0x124 ) = 0.0f; //m_DeviationPitch

*( float *)( fb__gunSway + 0x13C ) = 0.00001f; //m_currentGameplayDeviationScaleFactor
*( float *)( fb__gunSway + 0x140 ) = 0.00001f; //m_currentVisualDeviationScaleFactor

*( float *)( fb__gunSway + 0x15C ) = 0.00001f; //m_randomAngle
*( float *)( fb__gunSway + 0x160 ) = 0.00001f; //m_randomRadius

__asm popad;

return oGetRecoil( thisptr, unknown, a2, a3 );
}



Set a virtual hook on WeaponSway::Update for the win.

cpp:

void __fastcall Hooked_Update( PVOID ThisPtr, int EDX, float deltaTime, fb::WeaponSway::SoldierAttributesCallback* soldierAttributesCallback )
{
gAccuracy.ClearDeviation( ThisPtr );
}



Do not ask how to use it, its usefull only for coders (credit´s to Shrooms Hook) i forgot it... but i made some changes... hope you like it )
Quote Originally Posted by Enzo28 View Post
Do not ask how to use it, its usefull only for coders
All other posts will be deleted.
Dude , you should give credit to the original auther (Shrooms)
Quote Originally Posted by TamTam View Post
Dude , you should give credit to the original auther (Shrooms)
He edited it.
Am I understood this right? PHP code?
Quote Originally Posted by Speedypancake View Post
Am I understood this right? PHP code?
Um no... PHP is for web coding...
Quote Originally Posted by flappyjacky1 View Post
Um no... PHP is for web coding...
I know, but there words about "PHP Code", thats why I am asking.
sweet thanks for this
Way to steal my code.

1st of all, the first part and the second part are from two different sources.
Also I don't call it from WeaponSway update
I call it from getRecoil( )

EDIT: Also offsets are old
Quote Originally Posted by shrm View Post
Way to steal my code.

1st of all, the first part and the second part are from two different sources.
Also I don't call it from WeaponSway update
I call it from getRecoil( )

EDIT: Also offsets are old
why would you ban the creator of this? and not ban the lecher?
even more so when the creator is letting every one know that the offsets are old and that what was posted are from 2 different sources?

the author of the code(shrm) had asked for this code not to be posted on different sites so "Enzo28" stole his code and should be the one who is banned.
Can u make more hacks, bc this one powns!
First off theres no rules to leeching.
Quote Originally Posted by Snowbrdd View Post
First off theres no rules to leeching.
and with member that STEAL from other members is why there are no Pub hacks.....I understand people want to help out and do there part but when an author ask NOT TO POST IS WORK on different sites then his wishes should be RESPECTED.
AS we all know hacks are not easy to make and takes a lot of work to make and keep them working and hid from PB, as not to get people banned from the game


This is my only point. He had asked NOT to LEACH his work and it took a different member to point out it was not his work for him(Enzo28) to give proper credit, and right from the forum rules "- No directly posting pirated/infringing material." and as Shrooms had asked not to have his work posted on different sites this coding was pirated!!

In no way am i tring to "flame" Enzo28 but this whole post should have been deleted the day it was posted and i had pointed it out but the mod deleted my post (like im sure they will this one)
Quote Originally Posted by baccs View Post
why would you ban the creator of this? and not ban the lecher?
even more so when the creator is letting every one know that the offsets are old and that what was posted are from 2 different sources?

the author of the code(shrm) had asked for this code not to be posted on different sites so "Enzo28" stole his code and should be the one who is banned.
Quote Originally Posted by baccs View Post
and with member that STEAL from other members is why there are no Pub hacks.....I understand people want to help out and do there part but when an author ask NOT TO POST IS WORK on different sites then his wishes should be RESPECTED.
AS we all know hacks are not easy to make and takes a lot of work to make and keep them working and hid from PB, as not to get people banned from the game


This is my only point. He had asked NOT to LEACH his work and it took a different member to point out it was not his work for him(Enzo28) to give proper credit, and right from the forum rules "- No directly posting pirated/infringing material." and as Shrooms had asked not to have his work posted on different sites this coding was pirated!!

In no way am i tring to "flame" Enzo28 but this whole post should have been deleted the day it was posted and i had pointed it out but the mod deleted my post (like im sure they will this one)
I don't know why he's banned and it's not for that post.

Show me where he copyrighted his content and he can send MPGH a cease and desist letter.

The thread stays.

Any more posts on this will be deleted, if you have anything further PM me.
With that said, stay on topic.
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us