1

I recently found the program: ltrace. And was wondering if it's possible to achieve the same using one of the gui debuggers for windows: ida, immunity, etc. The only thing I've found is a port of the cmdline util. Which is perfectly fine, but it would be convenient if I could do the same using, say ida.

Tldr; Trace library calls using a windows debugger/disassembler.

Thanks for the quick response and the examples. Got everything I needed.

1
  • Not a debugger (just like ltrace isn't a debugger either), but does a lot of what you might want: Api Monitor Apr 6, 2015 at 12:05

1 Answer 1

2

ollydbg -> search for all intermodular calls -> in the new window -> set log break point radio button pause to never , log function argument to always ok

you should see all the lib functions breakpointed in pink

f9 to run the application

on exit look at log window for all the calls that were made to other modules from executab;e

Log data
Message
Program entry point
CALL to GetSystemTimeAsFileTime
  pFileTime = 0013FFB4
CALL to GetCurrentProcessId
CALL to GetCurrentThreadId
CALL to GetTickCount
CALL to QueryPerformanceCounter
  pPerformanceCount = 0013FFAC
CALL to HeapCreate
  Flags = 0
  InitialSize = 1000 (4096.)
  MaximumSize = 0
CALL to GetModuleHandleW
  pModule = "KERNEL32.DLL"
CALL to GetProcAddress
  hModule = 7C800000 (kernel32)
  ProcNameOrOrdinal = "FlsAlloc"
CALL to GetProcAddress
  hModule = 7C800000 (kernel32)
  ProcNameOrOrdinal = "FlsGetValue"
CALL to GetProcAddress
  hModule = 7C800000 (kernel32)
  ProcNameOrOrdinal = "FlsSetValue"
CALL to GetProcAddress
  hModule = 7C800000 (kernel32)
  ProcNameOrOrdinal = "FlsFree"
CALL to TlsAlloc
CALL to TlsSetValue
  TlsIndex = 1
  pValue = kernel32.TlsGetValue
CALL to TlsAlloc
CALL to HeapAlloc
  hHeap = 00350000
  Flags = HEAP_ZERO_MEMORY

windbg

cdb -c "!logexts.loge;!logm i *;!loge;!logo e d;g;q" msgboxw.exe > trace.txt & grep MessageBoxW trace.txt

Thrd 3c4 00401017 MessageBoxW( NULL "cannot find "hello"" "test"MB_OK) -> IDOK
Thrd 3c4 0040102B MessageBoxW( NULL "cannot find "iello"" "test"MB_OK) -> IDOK
Thrd 3c4 0040103F MessageBoxW( NULL "cannot find "jello"" "test"MB_OK) -> IDOK
Thrd 3c4 00401053 MessageBoxW( NULL "cannot find "fello"" "test"MB_OK) -> IDOK
Thrd 3c4 00401067 MessageBoxW( NULL "cannot find "kello"" "test"MB_OK) -> IDOK
Thrd 3c4 0040107B MessageBoxW( NULL "saying "hello" baby" "test"MB_OK) -> IDOK

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.