Function at 0x406589
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
mov eax, dword [0x4960a8]
xor eax, ebp
mov dword [ebp - 8], eax
cmp byte [esi + 4], 0
push ebx
push edi
mov edi, ecx
mov dword [ebp - 0x118], edi
je 0x4065b3
mov al, 1
jmp 0x40679c
lea eax, [ebp - 0x114]
xor ebx, ebx
push eax
mov dword [ebp - 0x114], ebx
mov dword [ebp - 0x110], ebx
call fcn.0042cf36
test eax, eax
jne 0x4065e1
push str.DING::CPEFileHelper::ReadHeaders_70__:_CSignedPEFile::ReadHeaders___:_GetLength____FALSE_n
call fcn.00416f04
pop ecx
jmp 0x406799
push 0x40
lea eax, [ebp - 0x74]
push eax
push ebx
push ebx
mov ecx, edi
call fcn.0042d18e
test eax, eax
jne 0x4065fb
push str.DING::CPEFileHelper::ReadHeaders_78__:_CSignedPEFile::ReadHeaders___:_Read____FALSE_n
jmp 0x4065d6
mov eax, 0x5a4d
cmp ax, word [ebp - 0x74]
je 0x40660d
push str.DING::CPEFileHelper::ReadHeaders_85__:_CSignedPEFile::ReadHeaders___:_IMAGE_DOS_SIGNATURE___dosHeader.e_magic_n
jmp 0x4065d6
lea ecx, [ebp - 0x10c]
call fcn.0042f538
mov ebx, 0x108
push ebx
lea ecx, [ebp - 0x10c]
call fcn.0042f656
test eax, eax
jne 0x406637
push str.DING::CPEFileHelper::ReadHeaders_94__:_CSignedPEFile::ReadHeaders___:_buffer.Alloc____NULL_n
jmp 0x406788
lea ecx, [ebp - 0x10c]
call fcn.0042d07f
mov ecx, dword [ebp - 0x118]
mov edi, eax
mov eax, dword [ebp - 0x38]
push ebx
cdq
push edi
push edx
push eax
call fcn.0042d18e
test eax, eax
jne 0x406665
push str.DING::CPEFileHelper::ReadHeaders_102__:_CSignedPEFile::ReadHeaders___:_Read____FALSE_n
jmp 0x406788
cmp dword [edi], 0x4550
je 0x406677
push str.DING::CPEFileHelper::ReadHeaders_109__:_CSignedPEFile::ReadHeaders___:_IMAGE_NT_SIGNATURE___pHeaders32__Signature_n
jmp 0x406788
movzx eax, word [edi + 0x18]
mov ecx, 0x10b
cmp cx, ax
jne 0x4066a8
mov edx, dword [ebp - 0x38]
lea eax, [edx + 0x58]
mov dword [esi + 8], eax
lea eax, [edx + 0x98]
mov dword [esi + 0x10], eax
mov eax, dword [edi + 0x98]
mov dword [esi + 0x18], eax
mov eax, dword [edi + 0x9c]
jmp 0x4066e2
mov ecx, 0x20b
cmp cx, ax
jne 0x406783
lea ecx, [ebp - 0x10c]
call fcn.0042d07f
mov edx, dword [ebp - 0x38]
lea ecx, [edx + 0x58]
mov dword [esi + 8], ecx
lea ecx, [edx + 0xa8]
mov dword [esi + 0x10], ecx
mov ecx, dword [eax + 0xa8]
mov dword [esi + 0x18], ecx
mov eax, dword [eax + 0xac]
cmp byte [ebp + 8], 0
mov dword [esi + 0x1c], eax
jne 0x406720
mov eax, dword [esi + 0x18]
xor ecx, ecx
cmp ecx, dword [ebp - 0x110]
ja 0x406719
jb 0x406702
cmp eax, dword [ebp - 0x114]
ja 0x406719
mov eax, dword [esi + 0x1c]
xor ecx, ecx
cmp ecx, dword [ebp - 0x110]
jb 0x406720
ja 0x406719
cmp eax, dword [ebp - 0x114]
jbe 0x406720
push str.DING::CPEFileHelper::ReadHeaders_159__:_CSignedPEFile::ReadHeaders___:_m_dwWinCertificateLength___m_dwMaxCertificateSize_n
jmp 0x406788
push 8
pop ecx
mov dword [esi + 0x14], ecx
mov dword [esi + 0xc], 4
movzx eax, word [edi + 6]
movzx edi, word [edi + 0x14]
dec eax
imul eax, eax, 0x28
add eax, edx
lea edx, [edi + eax + 0x18]
xor eax, eax
mov byte [ebp - 0x30], 0
lea edi, [ebp - 0x2f]
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
lea edi, [ebp - 0x28]
rep stosd dword es:[edi], eax
mov ecx, dword [ebp - 0x118]
push 0x28
lea eax, [ebp - 0x30]
push eax
push 0
push edx
call fcn.0042d18e
test eax, eax
jne 0x406772
push str.DING::CPEFileHelper::ReadHeaders_184__:_CSignedPEFile::ReadHeaders___:_Read____FALSE_n
jmp 0x406788
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
add eax, ecx
mov dword [esi + 0x20], eax
mov byte [esi + 4], 1
jmp 0x40678e
push str.DING::CPEFileHelper::ReadHeaders_150__:_CSignedPEFile::ReadHeaders___:_Unknown_PE_header_format_n
call fcn.00416f04
pop ecx
lea ecx, [ebp - 0x10c]
call fcn.0042f64b
mov al, byte [esi + 4]
mov ecx, dword [ebp - 8]
pop edi
xor ecx, ebp
pop ebx
call fcn.00459871
leave
ret 4