wulfcare Advanced Cheater Reputation: 0
Joined: 27 Feb 2023 Posts: 59
|
Posted: Mon Mar 27, 2023 1:44 pm Post subject: How to do code injection in C++ |
|
|
Hey guys,
How can I achieve the following code in C++? I believe I need to use VirtualAllocEx and I am aware that I cannot use __asm in 64-bit processes. However, I am looking for general guidance and suggestions for functions that I can use to accomplish this. Although I do not require any code to be written for me, I am wondering if WriteProcessMemory is my only option for this task.
Code: | alloc(newmem,2048,"game.exe"+165D88)
label(returnhere)
label(originalcode)
label(exit)
// Define a variable to store the value
alloc(value, 8)
newmem:
// Save the value from R13+88 into R10
mov r10,[r13+00000088]
// Store the value from R10 into the variable
mov [value], r10
// Jump back to the original code
jmp originalcode
originalcode:
// Continue with the original code
mov r10,[r13+00000088]
exit:
jmp returnhere
"game.exe"+165D88:
jmp newmem
nop 2
returnhere:
|
|
|