TAILIEUCHUNG - Memory Dump Analysis Anthology- P9

Memory Dump Analysis Anthology- P9: This is a revised, edited, cross-referenced and thematically organized volume of selected blog posts about crash dump analysis and debugging written in 2006 - 2007 for software engineers developing and maintaining products on Windows platforms, technical support and escalation engineers dealing with complex software issues and general Windows users. | Case Study 241 CASE STUDY Consider the following legacy C Win32 code fragment highlighted in WinDbg after opening a crash dump 1 HANDLE hFile CreateFile GENERIC-READ FILE-SHARE-READ NULL OPEN-EXISTING FILE-ATTRIBUTE-NORMAL NULL 2 if hFile INVALID-HANDLE-VALUE 3 4 DWORD dwSize GetFileSize hFile NULL 5 DWORD dwRead 0 6 CHAR bufferA new CHAR dwSize 2 7 memset bufferA 0 dwSize 2 8 if ReadFile hFile bufferA dwSize dwRead NULL 9 10 DWORD i 0 j 0 11 for i dwSize 2-7 i 12 if bufferA i 0xD bufferA i 1 0xA At the first glance the code seems to be right we open a file get its size and allocate a buffer to read. All loop indexes are within array bounds too. Let s look at disassembly and crash point 0 000 uf component CMyDlg OnTimer 004021bc push 0 004021be push esi 004021bf call dword ptr component _imp GetFileSize 0042e26c 004021c5 mov edi eax dwSize 004021c7 lea ebx edi 2 dwSize 2 004021ca push ebx 004021cb mov dword ptr esp 34h 0 004021d3 call component operator new 00408e35 004021d8 push ebx 004021d9 mov ebp eax bufferA 004021db push 0 004021dd push ebp 004021de call component memset 00418500 004021e3 add esp 10h 004021e6 push 0 004021e8 lea edx esp 34h 004021ec push edx 004021ed push edi 004021ee push ebp 004021ef push esi 004021f0 call dword ptr component _imp ReadFile 0042e264 004021f6 test eax eax Please purchase PDF Split-Merge on to remove this watermark 242 PART 2 Professional Crash Dump Analysis 004021f8 jne 00402331 xor 00402333 add 00402336 cmp 00402338 mov 0040233c jbe component CMyDlg OnTimer 0 3b1 00402331 esi esi i edi 0FFFFFFFBh 2-7 edi contains dwSize edi esi loop condition dword ptr esp 24h esi component CMyDlg OnTimer 0 43e 004023be 00402342 mov al byte ptr esi ebp bufferA i 0 000 r eax 00002b00 ebx 00000002 ecx 00431000 edx 00000000 esi 00002b28 edi fffffffb eip 00402342 esp 0012efd4 ebp 0095b4d8 iopl 0 nv up ei pl nz ac pe cy cs 001b ss 0023 ds 0023 es 0023 fs 003b gs 0000 efl 00000217 component CMyDlg GnTimer 0 3c2 .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.