News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Formatting plugin for DumpPE output.

Started by hutch--, September 12, 2010, 05:22:15 AM

Previous topic - Next topic

hutch--

I have had one of these for a while, Clive's DumpPE has been an excellent tool for a long time as it handles late mnemonics and easily outputs plain text assembler dumps. This tool is a QE plugin thatconverts a selected area of the asm dump to closer to human readable/usable assembler code. Its main gain is its a lot faster and solved a couple of problems from the earlier version.

You set it up by putting the zipped DLL into a known location, either the BIN or MASM32 directory then set it up as an option on one of the menus with a caption like "Format DumpPE Output", set the path to the DLL and it will work directly from the QE menu. If you select the DLL without selecting a block of assembler dump it will display a message box that tells you the basics of how to use the DLL.

It converts this,


00403010                    fn_00403010:                ; Xref 004060D4 00406210
00403010 8B4C2404               mov     ecx,[esp+4]
00403014 8B542408               mov     edx,[esp+8]
00403018 83E901                 sub     ecx,1
0040301B                    loc_0040301B:               ; Xref 0040302F
0040301B 83C101                 add     ecx,1
0040301E 0FB601                 movzx   eax,byte ptr [ecx]
00403021 85C0                   test    eax,eax
00403023 742A                   jz      loc_0040304F
00403025 83F82C                 cmp     eax,2Ch
00403028 7407                   jz      loc_00403031
0040302A 8802                   mov     [edx],al
0040302C 83C201                 add     edx,1
0040302F EBEA                   jmp     loc_0040301B
00403031                    loc_00403031:               ; Xref 00403028
00403031 C60200                 mov     byte ptr [edx],0
00403034 8B54240C               mov     edx,[esp+0Ch]
00403038                    loc_00403038:               ; Xref 00403045
00403038 83C101                 add     ecx,1
0040303B 0FB601                 movzx   eax,byte ptr [ecx]
0040303E 8802                   mov     [edx],al
00403040 83C201                 add     edx,1
00403043 85C0                   test    eax,eax
00403045 75F1                   jnz     loc_00403038
00403047 B801000000             mov     eax,1
0040304C C20C00                 ret     0Ch
0040304F                    loc_0040304F:               ; Xref 00403023
0040304F C60200                 mov     byte ptr [edx],0
00403052 33C0                   xor     eax,eax
00403054 C20C00                 ret     0Ch


Becomes,


; ----------------------------
fn_00403010:

    mov ecx, [esp+4]
    mov edx, [esp+8]
    sub ecx, 1

  lbl0:
    add ecx, 1
    movzx eax, BYTE PTR [ecx]
    test eax, eax
    jz lbl3
    cmp eax, 2Ch
    jz lbl1
    mov [edx], al
    add edx, 1
    jmp lbl0

  lbl1:
    mov BYTE PTR [edx], 0
    mov edx, [esp+0Ch]

  lbl2:
    add ecx, 1
    movzx eax, BYTE PTR [ecx]
    mov [edx], al
    add edx, 1
    test eax, eax
    jnz lbl2
    mov eax, 1
    ret 0Ch

  lbl3:
    mov BYTE PTR [edx], 0
    xor eax, eax
    ret 0Ch
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php