Malware Samples - PMA Chapter 5

21 Dec 2025

Chapter 4 was A Crash Course in x86 Disassembly and had no labs. One thing that CS 6747 covered heavily was x86 Assembly, so I was very comfortable with this topic. Still, I like to read different perspectives on something I'm interested in learning because it reinforces anything that may have been missed and may introduce some new information, which was the case here. In this chapter, I learned about instructions I had not heard of like ROR/ROL, REP, and IN. It also dove into details about MUL and DIV I was not aware of. Chapter 4 would be an excellent introduction to Assembly for anyone new to the subject, except that I still like to think of the stack as growing downward (it's just easier to visualize how everything fits together that way).

Chapter 5 is just an introduction to IDA Pro and all of the questions are based on one DLL. Even though I'm already familiar with this type of static analysis, all of my experience so far has been with Ghidra and this will help to make me a more well-rounded malware analyst. Unfortunately Hex-Rays does not have an archive of previous IDA Pro versions and the newest version was not compatible with Windows XP. This forced me to install a Windows 10 VM, which is some added work for the labs in this book, but will be useful for any malware analysis I want to do in the future.

Questions:

  1. What is the address of DllMain?
  2. Use the Imports window to browse to gethostbyname. Where is the import located?
  3. How many functions call gethostbyname?
  4. Focusing on the call to gethostbyname located at 0x10001757, can you figure out which DNS request will be made?
  5. How many local variables has IDA Pro recognized for the subroutine at 0x10001656?
  6. How many parameters has IDA Pro recognized for the subroutine at 0x10001656?
  7. Use the Strings window to locate the string \cmd.exe /c in the disassembly. Where is it located?
  8. What is happening in the area of code that references \cmd.exe /c?
  9. In the same area, at 0x100101C8, it looks like dword_1008E5C4 is a global variable that helps decide which path to take. How does the malware set dword_1008E5C4?
  10. A few hundred lines into the subroutine at 0x1000FF58, a series of comparisons use memcmp to compare strings. What happens if the string comparison to robotwork is successful?
  11. What does the export PSLIST do?
  12. Use the graph mode to graph to cross-references from sub_10004E79. Which API functions could be called by entering this function? Based on the API functions alone, what could you rename this function?
  13. How many Windows API functions does DllMain call directly? How many at a depth of 2?
  14. At 0x10001358, there is a call to Sleep. Looking backward through the code, how long will the program sleep if this code executes?
  15. At 0x10001701 is a call to socket. What are the three parameters?
  16. Using the MSDN page for socket and the named symbolic constants functionality in IDA Pro, can you make the parameters more meaningful? What are the parameters after you apply changes?
  17. Search for usage of the in instruction (opcode 0xED). This instruction is used with a magic string VMXh to perform VMware detection. Is that in use in this malware? Using the cross-references to the function that executes the in instruction, is there further evidence of VMware detection?
  18. Jump your cursor to 0x1001D988. What do you find?
  19. If you have the IDA Python plug-in installed, run Lab05-01.py, an IDA Pro Python script provided with the malware for this book. What happens after you run the script? (Make sure the cursor is at 0x1001D988)
  20. With the cursor in the same location, how do you turn this data into a single ASCII string?
  21. Open the script with a text editor. How does it work?



Conclusion

This was a great refresher of static analysis using a disassembler. Many of IDA's features are easier to use than Ghidra, but there are some areas where it struggles. I was disappointed that Python is no longer supported in the free versions and I look forward to the day that I am doing this type of work full time and have the opportunity to use the paid version!


Feedback is welcome and encouraged! Please leave a comment below: