XXX4Fans
oalabs from patreon
oalabs

patreon


How To Unpack VMProtect Malware - Part 2

Debugging and Dumping

This is part two in our three-part tutorial series on unpacking VMProtect malware. We are attempting to unpack a sample that has been packed with VMprotect where the entry point  has been virtualized but all other functions are not protected.

Unpacking Concept 

The concept behind our approach is to use a sandbox to identify an API that is called by the malware payload (not the VMprotect code). Then use that API call as a "flag" to indicate that the payload is unpacked in our debugger. Once the payload is unpacked we can use a custom dumping tool like VMPDump to dump out the unpacked payload. The custom dumping tool is required because VMProtect uses obfuscation to protect API calls in the payload.

If the sample is an MSVC binary the entry point will contain boilerplate code that is common to all MSVC binaries. Because this code is common we can search in memory for the Security Cookie Constant and identify the entry point. This allows us to set a breakpoint on the entry point and obtain a cleaner dump of the sample. If this is not an MSVC binary we cannot use this trick. 

Tools

Unpacking Steps

Anti-Debug and Anti-VM Protections

If the anti-debug and anti-vm protections are enabled in VMProtect you will need to take additional steps to hide your VM and your debugger from the sample. These steps are outside the scope of this tutorial but but simple anti-anti-debug features we recommend installing ScyllaHide.

Other Versions of VMProtect

Our tutorial is focused on VMProtect 3 with 64-bit samples but there are many older versions of VMProtect in use by malware developers as well as many 32-bit payloads. The following dumping tools may of useful depending on the version you encounter.


How To Unpack VMProtect Malware - Part 2

Related Creators