For your second question, I don't know, sorry.
[Edited by Hamadah, 5/9/2010 11:39:16 AM]
I tried searching my hex values i needed to change, I've found them in memory view (although with .exe name not the dll one) and I right clicked that address and added to address list and changed the hex bytes directly.
Is this safe? or the code injection is better? I need to change twelve bytes (3 assembly instructions).
[Edited by AramAz, 5/9/2010 12:02:54 PM]
I see, I closed and opened the game and the addreses were changed...
Thanks for helping me.
Assume I want to change some bytes in the memory i found instructions, but not necessarily into meaningful instructions, but to other bytes. What I mean is even if we store an array of charcters, it will show up as assembly instructions. Can I just go ahead and replace the 12 bytes like this?
alloc(newmem,2048) //2kb should be enough
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
nop // of course i repeat this line 9 more times.
What now? the line add al,2a has memory equiqvalent of 04 2a
and I want to keep the 2a, but change the 04 to 90 (nop) how can i do that?
add al,2a <-- this 04 2a in memory. I want to make it 00 2a
[Edited by AramAz, 5/9/2010 12:14:11 PM]
thanks. I already know assembly.
What I'm trying to understand is that for ex the line: add al,2a which appears to be an immediate value add, is not really anything important in that sense. It could be a part of a .txt which is bundled as a resource in a .dll library which is called by an exe file.
Relating to opcodes, the diassembler in ce or any other diassembler tries to make it look like assembly instructions, for ex an opcode of the instruction 'jmp' will follow a number of bytes which defines the label address. But as I said this is not what I'm trying to change, I'm simply trying to modify a bunch of bytes in memory.
[Edited by AramAz, 5/9/2010 12:58:35 PM]
Not if the base address of the .dll is dynamic. Then Code Shifting applies.
As for the legal point, its not illegal. As you are technically changing memory on the fly so to speak.
Ive seen reviews for this game looks fun and new, but I haven't played it to say what is what with the game. If indeed the routines are stored in dynamically loaded libraries then code shifting will be the answer.
You said you know ASM, but obviously you dont 100%.
You cant change the start of that opcode to a 00 or 90. that would be silly.
04 is the usual hex value for add al, changing it to 90 would knocked the subsequent bytes out of touch. 00 would give you another add instruction but to a different lower register.
[Edited by DABhand, 5/9/2010 2:19:44 PM]
Code-injection is better when the game doesn't code-shift.
[Edited by Hamadah, 5/9/2010 2:48:40 PM]