Zombi3 Expert Cheater
Reputation: 0
Joined: 02 Aug 2007 Posts: 144
|
Posted: Fri Oct 05, 2007 10:02 am Post subject: Need help with inline assembly in C++ |
|
|
Well i can't really find any inline assembly tutorials for C++ when it come to building trainers and what not.I usually put my opcodes in an array. Example...
| Code: | byte jmp[] ={0xE9,0xE4,0x79,0x01,0x00,0x90};
byte code[]={0xFE,0x05,0x80,0x5E,0x44,0x00,0x80,
0x3D,0x80,0x5E,0x44,0x00,0x02,0x0F,
0x85,0x45,0x86,0xFE,0xFF,0x8D,0x4C,
0x24,0x4C,0xE9,0x01,0x86,0xFE,0xFF |
and thats just for doing this.
| Quote: | JE 437d62
nop
inc byte ptr[445e80]
cmp byte ptr[445e80],2
jnz 4203ba
lea ecx,dword ptr ss:[esp+4c]
jmp 42037f |
I have tried multiple times to getting _asm to work in C++ but for some reason writeprocessmemory writes the wrong opcodes like for example.
| Code: | void _declspec(naked) Script()
{
__asm
{
nop
nop
};
} |
with WriteProcessMemory(pi.hProcess,(LPVOID)address2,&Script,2,0)
gives me 0xE9 and 0x19.
_________________
|
|
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri Oct 05, 2007 3:16 pm Post subject: |
|
|
&Script isn't pointing to the address of "void _declspec(naked) Script()". Do some debugging and you'll notice. It's pointing to the very beginning of your .exe. I'm a bit lost with terminology, so I can't say what's that table. Anyway, it has jumps to all the functions you're using. It can be found at 401005h.
0xE9 is a far jmp, isn't it :)
|
|