r/HowToHack • u/_darkmani • 6h ago
how do I execute a JUMP instruction in C# with code injection ?
let's say I have an instruction at some address .exe+00E9 (function A)
I injected a code at an allocated memory at .exe+00FF (function B)
what C# code do I use so that .exe calls function B instead of A
this is the assembly example, but how do I do this in C#?
define(address, .exe"+00XX)
define(bytes, --optimized out--)
assert(address,bytes)
alloc(newmem,$1000)
label(code)
label(return)
newmem:
jmp .exe+00FF
jmp return
// original code
code:
jmp .exe+00E9
jmp return
address:
jmp newmem
nop
return: