ReverseSec

Effortless Themida Unpacking Using a Single Breakpoint without PE Execution.

idkhidden [2024-11-15]

Introduction

While reverse engineering Themida, I discovered a method to unpack a Themida-protected binary and restore its Import Address Table (IAT) without executing the PE code, using a single hardware breakpoint. This approach was tested on Themida version 3.0.4.0 and is expected to work on newer versions as well.

Unpacking

To begin, the first task is to disable the anti-debugging protections. This can be achieved by enabling ScyllaHide, which bypasses Themida’s basic anti-debugging mechanisms, allowing you to proceed with the unpacking process without interference.

ScyllaHide

Next, set an executive singleshoot hardware breakpoint on the .text section, typically the first section header in the PE. Once the breakpoint is in place, run the executable. It will begin executing but will break immediately upon hitting the hardware breakpoint in the .text section.

Hardware Breakpoint

Breakpoint Hit

At this point, the binary will be in an unpacked state, with the IAT restored all without actually executing the binary code. You will now have full access to the unpacked contents of the PE, enabling further analysis or modification as needed.

Unpacked

Packed

Packed Binary

Unpacked

Unpacked Binary

Conclusion

I hope this technique proves useful for those of you exploring reverse engineering or working with malware. Happy reversing!

Acknowledgments

x64dbg

ScyllaHide

Note

This write-up was assisted by LLM for clarity and efficiency. All technical content is based on personal research.