205 String References and Basic Patching
205 String References and Basic Patching
Professional
5.5 Conclusion
Tools:
• Olly Debugger v1.10
• HxD Hex Editor
• Windows Calculator
Target:
• RE_Lab_5.zip
Introduction
String References
A Few Words
Before Starting
Let’s Start...
You should now be at the Entry Point (EP). The entry point
of an executable module is the address of the first
instruction to be executed inside the module itself.
In the CPU window, right click, and then → Search for → All
referenced text strings
Let’s break this down into pieces in order to explain what it does,
clearly.
• 0x00402E76 → VA of the first byte (0x75) of the instruction
• 0x75 → opcode (operation code) of the short JNZ jump
instruction.
• 0x1F → number of bytes to ‘skip’ or ‘jump’ by redirecting the EIP.
MAPv1: Section 02, Module 05 - Caendra Inc. © 2020 | p.30
5.4.5 Basic Memory Patching
In a few words, a short jump instruction (JZ, JNZ, JG, JL, etc.)
is a two-byte long instruction comprised of the opcode and
the number of bytes to redirect the EIP forward or backward
(-128 to +127 bytes).
So, we know that our byte is within that range, and it belongs
to the first section.
We can now load our target into the hex editor and press Ctrl+G to
enter the hex value of the offset of the byte we just calculated from
the beginning of the file.
You only need to: modify the 0x1F byte with 0x00, save the new
executable with another name, and evaluate the changes. This is
shown on the next slide.
You should, at this point, try to apply the other two fixes manually
to gain some practice.
MAPv1: Section 02, Module 05 - Caendra Inc. © 2020 | p.55
5.4.8 Manual Byte Patching
Conclusion
Windows Calculator
RE_Lab_5.zip