6. Dynamic Code Analysis
6. Dynamic Code Analysis
Stack Window:
The stack view displays the data contents of the
process's runtime stack
Dump Window:
This displays the standard hex dump of the
system memory.
References Window:
displays the references to the API calls.
To populate this window, right-click anywhere in
the disassembly (CPU) window, then select
Search for | Current Module | Intermodular
calls
Handles Window:
to display handles, right-click inside the handles
window and select Refresh (or F5).
Sample Program
Build in MS Visual Studio
using Debug Configuration
0041 2A10
3rd step: file offset
0041 1000
from segment
0000 1A10
beginning
Call stack
displays the call stack of the current thread
Address: base address of the stack frame where
return address (To address) is stored
To: address of next inst. after function call in the
caller
From: address in the function that is going to
return.
Size: arguments size+ return address size + local
variables size.
Comment: a brief description of the call stack
frame.
Party: function belongs to user or OS
Malware Analysis, PIEAS
Debugging using X64dbg
Function tracing
All functions called after main() function
1. Find the address of the main() and put
breakpoint there
Function tracing
2. Find Return Address: Once breakpoint is
placed at the 1st instruction of main() restart
dubugee using Debug | restart. Run until debugee
stops at main’s 1st instruction. Check call stack.
main will return at To address once finished
execution.
Function tracing
Only log function calls
Memory breakpoint
First find address of memory
Then locate that address in memory dump
In the memory dump right click to address where
you want to put memory breakpoint and choose
breakpoint
Limitation: Xdbg62 currently
(version Nov 05 2020) only supports
memory breakpoint at page level so
use hardware breakpoint instead