Function at 0x406670
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x170
mov eax, dword [0x45e508]
xor eax, esp
mov dword [esp + 0x16c], eax
mov edx, dword [ebx + 0x23c]
xor eax, eax
cmp edx, 0x40
push esi
mov dword [esp + 0x105], eax
mov word [esp + 0x109], ax
mov byte [esp + 0x10b], al
mov dword [esp + 0x10c], eax
mov dword [esp + 0x110], eax
mov dword [esp + 0x114], eax
mov dword [esp + 0x118], eax
mov dword [esp + 0x11c], eax
mov dword [esp + 0x120], eax
mov dword [esp + 0x124], eax
mov dword [esp + 0x128], eax
mov eax, dword [ebx + 0x238]
push edi
jae 0x40670a
mov dword [ebx + 4], 7
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.0042f760
mov esp, ebp
pop ebp
ret
ja 0x406729
mov dword [ebx + 4], 3
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.0042f760
mov esp, ebp
pop ebp
ret
mov ecx, 0x10
mov esi, eax
lea edi, [esp + 0x130]
rep movsd dword es:[edi], dword [esi]
cmp word [esp + 0x130], 0x5a4d
je 0x406762
mov dword [ebx + 4], 6
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.0042f760
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x16c]
cmp edx, ecx
mov dword [ebx + 0x240], ecx
jb 0x4066ed
add eax, ecx
add ecx, 4
cmp ecx, edx
ja 0x40670c
mov esi, dword [eax]
add eax, 4
cmp esi, 0x4550
je 0x4067aa
mov dword [ebx + 4], 6
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.0042f760
mov esp, ebp
pop ebp
ret
add ecx, 0x14
cmp edx, ecx
jb 0x40670c
mov edi, dword [eax + 4]
mov esi, dword [eax]
mov dword [esp + 0x18], edi
mov edi, dword [eax + 8]
mov dword [esp + 0x1c], edi
mov edi, dword [eax + 0xc]
mov dword [esp + 0x20], edi
mov edi, dword [eax + 0x10]
shr esi, 0x10
add ecx, 0xe0
mov dword [esp + 0x24], edi
shr edi, 0x10
add eax, 0x14
cmp edx, ecx
mov dword [esp + 8], esi
mov word [ebx + 0x244], si
mov word [ebx + 0x258], di
mov dword [esp + 0x10], ecx
jb 0x40670c
mov ecx, 0x38
mov esi, eax
lea edi, [esp + 0x28]
rep movsd dword es:[edi], dword [esi]
movzx ecx, word [esp + 0x24]
cmp edx, ecx
jb 0x40670c
mov edx, dword [esp + 0x64]
add eax, ecx
cmp word [esp + 8], 0
mov ecx, dword [esp + 0x38]
mov dword [ebx + 0x25c], ecx
mov ecx, dword [esp + 0x98]
mov dword [ebx + 0x270], edx
mov edx, dword [esp + 0x3c]
mov dword [ebx + 0x280], ecx
mov dword [ebx + 0x298], edx
mov dword [esp + 0xc], 0
jbe 0x4068b5
jmp 0x406864
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x10]
add ecx, 0x28
cmp dword [ebx + 0x23c], ecx
mov dword [esp + 0x10], ecx
jb 0x40670c
mov esi, eax
mov ecx, 0xa
lea edi, [esp + 0x108]
rep movsd dword es:[edi], dword [esi]
add eax, 0x28
push ebx
lea edi, [esp + 0x10c]
mov dword [esp + 0xc], eax
call fcn.00406970
mov eax, dword [esp + 0xc]
movzx ecx, word [ebx + 0x244]
add eax, 1
cmp eax, ecx
mov dword [esp + 0xc], eax
jl 0x406860
mov eax, dword [ebx + 0x23c]
mov ecx, dword [ebx + 0x27c]
cmp eax, ecx
jae 0x4068ec
mov dword [ebx + 4], 3
mov dword [ebx + 0x284], 0
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.0042f760
mov esp, ebp
pop ebp
ret
mov edx, dword [ebx + 0x238]
add edx, ecx
cmp eax, dword [ebx + 0x260]
mov dword [ebx + 0x284], edx
jae 0x406918
cmp eax, dword [ebx + 0x25c]
jb 0x4066ed
mov dword [ebx + 0x260], 0xffffffff
cmp eax, dword [ebx + 0x268]
jae 0x406927
mov dword [ebx + 4], 3
cmp dword [ebx + 0x26c], 0
mov edx, dword [esp + 0x118]
mov ecx, dword [esp + 0x11c]
lea esi, [edx + ecx]
mov dword [ebx + 0x268], esi
jge 0x40694e
mov dword [ebx + 4], 5
sub eax, edx
sub eax, ecx
mov ecx, dword [esp + 0x174]
pop edi
pop esi
mov dword [ebx + 0x26c], eax
xor ecx, esp
mov al, 1
call fcn.0042f760
mov esp, ebp
pop ebp
ret