Code:
alloc(newmem,2048) //2kb should be enough label(returnhere) label(originalcode) label(exit) 0047D7B2: jmp newmem nop nop nop returnhere: newmem: //this is allocated memory, you have read,write,execute access //place your code here originalcode: nop mov [edi],000000c8 exit: jmp returnhere