Saturday, 15 September 2012

Debugging Visual C++ DLL Without Calling Application's / Host Exe Source Code -



Debugging Visual C++ DLL Without Calling Application's / Host Exe Source Code -

a client sent crash dump containing hex address of assembly instruction of our dll. how can relate c++ code on visual studio?

our programme packaged in dll loaded host application on remote server. have source code of our dll, not host application. what's best way debug crash caused dll?

crash : #214 0001bd54 eip: 6baa7271 esp: 240df640 6baa7271:000000 [6baa7271] unknown (ourcompany.dll) 6ba9fa31:000000 [6ba9fa31] unknown (ourcompany.dll) 6ba994d9:000000 [6ba994d9] unknown (ourcompany.dll) 6ba9f5f2:000000 [6ba9f5f2] unknown (ourcompany.dll) 6baadb36:000000 [6baadb36] unknown (ourcompany.dll) 6baadbb4:000000 [6baadbb4] unknown (ourcompany.dll) 76ec3378:000012 [76ec338a] acquiresrwlockexclusive (kernel32.dll) 775d9f0f:000063 [775d9f72] rtlinsertelementgenerictableavl (ntdll.dll) 775d9f0f:000036 [775d9f45] rtlinsertelementgenerictableavl (ntdll.dll) crash --> 6baa7271 80780f00 cmp byte [eax+0xf], 0x0 6baa7275 74eb jz 0x6baa7262 6baa7277 8b8310040000 mov eax, [ebx+0x410] 6baa727d 89bd24fdffff mov [ebp+0xfffffd24], edi 6baa7283 3bf8 cmp edi, eax 6baa7285 740e jz 0x6baa7295 6baa7287 663b770c cmp si, [edi+0xc] : #215 000167b0 eip: 752178d7 esp: 37f3fc00 7521787b:00005c [752178d7] dlgdirselectcomboboxexw (user32.dll) 62ad0013:000000 [62ad0013] unknown (***.dll) 76ec3378:000012 [76ec338a] acquiresrwlockexclusive (kernel32.dll) 775d9f0f:000063 [775d9f72] rtlinsertelementgenerictableavl (ntdll.dll) 775d9f0f:000036 [775d9f45] rtlinsertelementgenerictableavl (ntdll.dll)

start debugging exact same binaries client. in modules window check base of operations address of dll, add together offset crash dump. in disassembly window ( debug -> windows -> disassembly) come in in address: editbox calculated crash address in hex format 0xxxxxxxxx. should show source code line interested in.

the problem how calculate crash offset, should have in crash log modules section have dll load address, should suffice calculate crash offset. should 0x6baa7271 - [dll base of operations offset].

i dont work dll-s, should work.

also, easier debug such issues if have tagged in source code command given release of product. checkout branch such tag, , allows generate pdb-s , experiments program.

c++ visual-studio visual-c++

No comments:

Post a Comment