RevEng DRM OS-Security
RevEng DRM OS-Security
q It works!
q Can Trudy do “better”?
SRE Example
• Again, IDA Pro disassembly
Assembly Hex
test eax,eax 85 C0 …
xor eax,eax 33 C0 …
SRE Example
• Edit serial.exe with hex editor
serial.exe
serialPatch.exe
q Save as serialPatch.exe
SRE Example
serial.exe
serialPatch.exe
SRE Attack Mitigation
• Impossible to prevent SRE on open system
• But can make such attacks more difficult
• Anti-disassembly techniques
– To confuse static view of code
• Anti-debugging techniques
– To confuse dynamic view of code
• Tamper-resistance
– Code checks itself to detect tampering
• Code obfuscation
– Make code more difficult to understand
Anti-disassembly
• Anti-disassembly methods include
– Encrypted or “packed” object code
– False disassembly
– Self-modifying code
– Many other techniques
• Encryption prevents disassembly
– But still need plaintext code to decrypt code!
– Same problem as with polymorphic viruses
Anti-disassembly Example
• Suppose actual code instructions are
inst 1
jmp
junk
inst 3
inst 4
…
inst 1
inst 2
inst 3
inst 4
inst 5
inst 6
…