Assembly Language for Beginners

(Jeff_L) #1

7.2. LIVE ANALYSIS


7.2.3 System calls tracing


strace / dtruss


It shows which system calls (syscalls(6.3 on page 747)) are called by a process right now.


For example:


strace df -h


access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\232\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1770984, ...}) = 0
mmap2(NULL, 1780508, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75b3000


Mac OS X has dtruss for doing the same.


Cygwin also has strace, but as far as it’s known, it works only for .exe-files compiled for the cygwin
environment itself.


7.2.4 Network sniffing


Sniffingis intercepting some information you may be interested in.


(Free, open-source)Wireshark^20 for network sniffing. It has also capability for USB sniffing^21.


Wireshark has a younger (or older) brothertcpdump^22 , simpler command-line tool.


7.2.5 Sysinternals.


(Free) Sysinternals (developed by Mark Russinovich)^23. At least these tools are important and worth
studying: Process Explorer, Handle, VMMap, TCPView, Process Monitor.


7.2.6 Valgrind


(Free, open-source) a powerful tool for detecting memory leaks:http://valgrind.org/. Due to its pow-
erfulJITmechanism, Valgrind is used as a framework for other tools.


7.2.7 Emulators



  • (Free, open-source)QEMU^24 : emulator for various CPUs and architectures.

  • (Free, open-source)DosBox^25 : MS-DOS emulator, mostly used for retrogaming.

  • (Free, open-source)SimH^26 : emulator of ancient computers, mainframes, etc.


(^20) https://www.wireshark.org/
(^21) https://wiki.wireshark.org/CaptureSetup/USB
(^22) http://www.tcpdump.org/
(^23) https://technet.microsoft.com/en-us/sysinternals/bb842062
(^24) http://qemu.org
(^25) https://www.dosbox.com/
(^26) http://simh.trailing-edge.com/

Free download pdf