Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // hook Armor Attachment
- {
- struct InstallArmorAddon_Code : Xbyak::CodeGenerator {
- InstallArmorAddon_Code(void * buf, UInt64 funcAddr) : Xbyak::CodeGenerator(4096, buf)
- {
- Xbyak::Label funcLabel;
- Xbyak::Label retnLabel;
- mov(r9, r12);
- call(ptr [rip + funcLabel]);
- jmp(ptr [rip + retnLabel]);
- L(funcLabel);
- dq(funcAddr);
- L(retnLabel);
- dq(InstallArmorAddon_Start.GetUIntPtr() + 5);
- }
- };
- void * codeBuf = g_localTrampoline.StartAlloc();
- InstallArmorAddon_Code code(codeBuf, (UInt64)InstallArmorAddon_Hook);
- g_localTrampoline.EndAlloc(code.getCurr());
- g_branchTrampoline.Write5Branch(InstallArmorAddon_Start.GetUIntPtr(), uintptr_t(code.getCode()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement