CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Battlefield
Battlefield 3
No Recoil - No Sway Offset
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NordCFW" data-source="post: 53285" data-attributes="member: 101324"><p>[CODE]#include <Windows.h></p><p> </p><p> void* g_pOriginalGetRecoil=NULL;</p><p> void* g_pOriginalGetDeviation=NULL;</p><p> void** g_pGetRecoilVTableAddress=(void**)0x020FA644;</p><p> void** g_pGetDeviationVTableAddress=(void**)0x020FA640;</p><p> </p><p> </p><p> void __declspec(naked) hkGetRecoil(void)</p><p> {</p><p> __asm</p><p> {</p><p> xor eax, eax</p><p> mov [ecx+0x164], eax</p><p> mov [ecx+0x16C], eax</p><p> jmp dword ptr[g_pOriginalGetRecoil]</p><p> }</p><p> }</p><p> </p><p> </p><p> void __declspec(naked) hkGetDeviation(void)</p><p> {</p><p> __asm</p><p> {</p><p> xor eax, eax</p><p> mov [ecx+0x140], eax</p><p> mov [ecx+0x13C], eax</p><p> jmp dword ptr[g_pOriginalGetDeviation]</p><p> }</p><p> }</p><p> </p><p> unsigned long __stdcall HookThread(void* param)</p><p> {</p><p> unsigned long flOldProtection;</p><p> if((int)param==1) //Enable Hook</p><p> {</p><p> if(!g_pOriginalGetDeviation)</p><p> g_pOriginalGetDeviation=*g_pGetDeviationVTableAddress; //Backing up Original Functions</p><p> if(!g_pOriginalGetRecoil)</p><p> g_pOriginalGetRecoil=*g_pGetRecoilVTableAddress;</p><p> </p><p> if(VirtualProtect(g_pGetDeviationVTableAddress,8,PAGE_READWRITE,&flOldProtection)) //Removing memory protection</p><p> {</p><p> *g_pGetDeviationVTableAddress=hkGetDeviation; //Swapping VTable Pointers</p><p> *g_pGetRecoilVTableAddress=hkGetRecoil;</p><p> return VirtualProtect(g_pGetDeviationVTableAddress,8,flOldProtection,&flOldProtection); //Readding normal memory protection</p><p> }</p><p> else</p><p> {</p><p> return 0;</p><p> }</p><p> }</p><p> else //Disable Hook</p><p> {</p><p> if(VirtualProtect(g_pGetDeviationVTableAddress,8,PAGE_READWRITE,&flOldProtection)) //Removing memory protection</p><p> {</p><p> *g_pGetDeviationVTableAddress=g_pOriginalGetDeviation; //Setting VTable pointers back to original ones</p><p> *g_pGetRecoilVTableAddress=g_pOriginalGetRecoil;</p><p> return VirtualProtect(g_pGetDeviationVTableAddress,8,flOldProtection,&flOldProtection); //Readding normal memory protection</p><p> }</p><p> else</p><p> {</p><p> return 0;</p><p> }</p><p> }</p><p> return 1;</p><p> }</p><p> </p><p> </p><p> unsigned long __stdcall DllMain(HMODULE hModule, unsigned long ulReason, void* param)</p><p> {</p><p> if(ulReason==DLL_PROCESS_ATTACH)</p><p> {</p><p> CloseHandle(CreateThread(NULL,0,&HookThread,(void*)1,0,NULL)); //Enable hook</p><p> }</p><p> else if(ulReason==DLL_PROCESS_DETACH)</p><p> {</p><p> CloseHandle(CreateThread(NULL,0,&HookThread,NULL,0,NULL)); //Disable hook</p><p> }</p><p> return 1;</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="NordCFW, post: 53285, member: 101324"] [CODE]#include <Windows.h> void* g_pOriginalGetRecoil=NULL; void* g_pOriginalGetDeviation=NULL; void** g_pGetRecoilVTableAddress=(void**)0x020FA644; void** g_pGetDeviationVTableAddress=(void**)0x020FA640; void __declspec(naked) hkGetRecoil(void) { __asm { xor eax, eax mov [ecx+0x164], eax mov [ecx+0x16C], eax jmp dword ptr[g_pOriginalGetRecoil] } } void __declspec(naked) hkGetDeviation(void) { __asm { xor eax, eax mov [ecx+0x140], eax mov [ecx+0x13C], eax jmp dword ptr[g_pOriginalGetDeviation] } } unsigned long __stdcall HookThread(void* param) { unsigned long flOldProtection; if((int)param==1) //Enable Hook { if(!g_pOriginalGetDeviation) g_pOriginalGetDeviation=*g_pGetDeviationVTableAddress; //Backing up Original Functions if(!g_pOriginalGetRecoil) g_pOriginalGetRecoil=*g_pGetRecoilVTableAddress; if(VirtualProtect(g_pGetDeviationVTableAddress,8,PAGE_READWRITE,&flOldProtection)) //Removing memory protection { *g_pGetDeviationVTableAddress=hkGetDeviation; //Swapping VTable Pointers *g_pGetRecoilVTableAddress=hkGetRecoil; return VirtualProtect(g_pGetDeviationVTableAddress,8,flOldProtection,&flOldProtection); //Readding normal memory protection } else { return 0; } } else //Disable Hook { if(VirtualProtect(g_pGetDeviationVTableAddress,8,PAGE_READWRITE,&flOldProtection)) //Removing memory protection { *g_pGetDeviationVTableAddress=g_pOriginalGetDeviation; //Setting VTable pointers back to original ones *g_pGetRecoilVTableAddress=g_pOriginalGetRecoil; return VirtualProtect(g_pGetDeviationVTableAddress,8,flOldProtection,&flOldProtection); //Readding normal memory protection } else { return 0; } } return 1; } unsigned long __stdcall DllMain(HMODULE hModule, unsigned long ulReason, void* param) { if(ulReason==DLL_PROCESS_ATTACH) { CloseHandle(CreateThread(NULL,0,&HookThread,(void*)1,0,NULL)); //Enable hook } else if(ulReason==DLL_PROCESS_DETACH) { CloseHandle(CreateThread(NULL,0,&HookThread,NULL,0,NULL)); //Disable hook } return 1; }[/CODE] [/QUOTE]
Verification
Post reply
Forums
Gaming
Battlefield
Battlefield 3
No Recoil - No Sway Offset
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top