[C++] Write an asm code to a specified address

03/05/2014 18:32 Kyshubi#1
Hi !

I want to create a dll and when I inject it, it change the code at the specified address.
Example:
Code:
Original at 0x12345678:
push 01
Change to:
call 0X87654321
I want to change directly the code at the address

Does _asm{ }; can help me ?
Or how can I do ?

Thanks in advance :)
03/05/2014 19:14 MrSm!th#2
A call instruction is longer than a push, therefore you cannot simply replace it. You have use a code cave for that, i.e. place a jump to another code block where your call and the instructions replaced by the jump are executed. Don't forget to jump back.

You have to place the patched code in binary form (like an array of bytes).
03/05/2014 19:42 Kyshubi#3
Ok thanks for your help, I'll try to do like this