1

I learn how to pack then unpack scripts with UPX and C language. Here is my script which I packs: enter image description here

it is quite simple, just types string "hello world" on a screen. Well, I pack it using next commands:

gcc -m32 main.c -o main
upx main.exe -o main-upx.exe

And it all works fine for me, here is the output of DIE

enter image description here

As you can see, here I get that PE is packed with UPX (best option, but it does not matter). The next thing which I do is opening the packed file with x64dbg (x32 mode). There I find popad rule, and after some commands I reach actual unpacked entry point of the application. Here it is: enter image description here

I am sure that this is actual entry point, because when I execute all code which is bellow until it works fine, here is the result of execution:

enter image description here

Well, after it, when I found the actual point, from where the program runs, I try to create a dump of memmory with built-in application Scylla:

enter image description here

Steps which i do:

  1. Insert in OEP my new entry point, for me it is 005E14C0
  2. Secondly, I click button IAT Autosearch
  3. Then I click Get imports
  4. Next step is dumping the memmory with selected settings, I click dump and save the file as main-upx_dump.exe
  5. After that all, I just click the last button which is Fix Dump to fix imports table and also save the file.

The next step which I do, is running the .exe, and when I starts it in cmd, the output which i receive is nothing, just an empty string, here it is:

enter image description here

I just cannot get what am i doing wrong, if you know what could go wrong, please, write an answer, thanks a lot!

Mark Minerov
  • 309
  • 1
  • 8
  • There can be many reasons. Your test application is small, disassemble it to figure out what code it contains. When the code is correct (contains printf "hello world"), run it in a debugger to see what it does. – nevilad Aug 25 '21 at 09:15
  • I did it today well there is something really wrong with SCY file which i receive after fixes of imports table. dump file contains exactly what i need, but SCY does not – Mark Minerov Aug 25 '21 at 18:32

0 Answers0