A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/unipacker/unipacker/wiki below:

Home · unipacker/unipacker Wiki · GitHub

When Un{i}packer starts, the user is prompted with a file selection dialogue. Here, the 10 last loaded samples are listed, including the packer name we identified the last time the file was opened. When selecting to open a new file, please be aware that at the moment, Un{i}packer only supports Windows PE32 executables and will reject ELF files.

After loading the binary, you will be presented with a shell, where further commands can be entered. The prompt of the shell always shows the current address the instruction pointer points to at the moment. Now we will guide you through all of the shell’s commands. The order will correspond to the typical workflow we followed, when analyzing a new kind of packer.

At this point, Un{i}packer will have identified the packer that was used to obfuscate this binary, if it is one of the supported ones (UPX, ASPack, PEtite and FSG). The aaa command will show you general information over four categories:

After looking at those general infos about the current sample, we can go to the next step. By the way, there is an alternative command, aaaa, which displays all of the infos mentioned above but also starts emulation automatically.

Before we start emulation, we should set the logging level by using the log command. Otherwise, no further information would be displayed during emulation, until it finishes. This improves emulation speed but for deeper analysis of the sample, we will tune this to our liking, using any combination of the following options:

Our recommendation for the first run of a binary is to only enable API call logging.

You may want to set breakpoints to pause emulation at specific times. The b command has several options for this:

Deleting breakpoints uses the same options as setting them, the only difference is that you need to use the del command. Any number of the above mentioned options can be combined in a single b or del command

Set unpacking detection method

The detect command allows toggling different unpacking detection mechanisms:

Now we can start the emulation by invoking the r command. This emulates the sample’s instruction until either a breakpoint is hit, an error occurs (e.g. reading/writing to unmapped memory areas or CPU exception) or the end of the unpacking process is being detected.

Stepping and resuming after a breakpoint

If you would like to single-step through the program’s instructions, use the s command. If you would like to resume normal emulation (e.g. after some single steps or after hitting a breakpoint), simply use the c command. If for some reason you fail to choose c but instead press r, the Un{i}packer shell will notify you that the program is already running. It then interprets your command as a c command.

Inspecting memory and register values

When debugging, you will certainly come across the wish to view register values, display memory contents at a specific address or even modify some of the values. Here are your options:

After the emulation has finished or maybe also after hitting a specific breakpoint, you will most likely want to find out whether the unpacking was successful. For this you can first look at some statistics with the stats command. It will show you details about which sections have been executed, read from and written to. When analyzing a new packer for example, this can give you information on whether the packer uses a separate section to write the unpacked binary to or if it is self-modifying.

The dump command will dump all of the loaded sample memory (image base address to base address + declared virtual memory size) to a file. By default this is called unpacked.dump, but you can specify a different path.

Lastly, if you already know which binary has been unpacked (e.g. you are more interested in debugging support for a new packer), the yara command lets you run YARA rules against the dump. This is helpful if you want to check that some known malware has been unpacked, as you can run yara before and after emulation and only after successful unpacking it should recognize the sample.

The dumped memory image also contains the original PE headers. If you would like to modify the entry point declaration in those headers, e.g. for quicker statical analysis, use the fix command providing a new entrypoint address. Note that this is automatically being done if section hopping control is active: When section hopping is detected, the image is dumped with the jump’s target address set as the new entrypoint.

After you are done with the current sample, you can quit Un{i}packer by pressing Ctrl+D or with the exit command. If you would like to go back to the initial file-selection prompt to start again, use rst.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4