Function at 0x6312c0
Capabilities:
Enumerate pe sections
Parse pe header
Resolve function by parsing pe exports

Disassembly:
push esi
mov esi, ecx
cmp dword [esi + 0xc], 0x40
jae 0x6312d3
mov dword [esi], str.Too_small
xor al, al
pop esi
ret
mov eax, dword [esi + 4]
cmp byte [eax], 0x4d
jne 0x631537
cmp byte [eax + 1], 0x5a
jne 0x631537
mov ecx, dword [eax + 0x3c]
push edi
lea edi, [eax + ecx]
cmp edi, eax
jbe 0x63152c
mov edx, dword [esi + 8]
lea eax, [edx - 0x18]
cmp edi, eax
jae 0x63152c
test cl, 7
je 0x631316
pop edi
mov dword [esi], str.Misaligned_PE_header
xor al, al
pop esi
ret
cmp byte [edi], 0x50
jne 0x631521
cmp byte [edi + 1], 0x45
jne 0x631521
cmp byte [edi + 2], 0
jne 0x631521
cmp byte [edi + 3], 0
jne 0x631521
movzx eax, word [edi + 4]
mov word [esi + 0x20], ax
movzx eax, word [edi + 6]
mov word [esi + 0x22], ax
movzx eax, word [edi + 0x14]
add edi, 0x18
movzx ecx, ax
mov word [esi + 0x1c], ax
mov dword [esi + 0x18], edi
lea eax, [edi + ecx]
cmp eax, edx
jb 0x631370
pop edi
mov dword [esi], str.optional_header_past_end_of_file
xor al, al
pop esi
ret
cmp ecx, 2
jae 0x631380
pop edi
mov dword [esi], str.optional_header_no_magic
xor al, al
pop esi
ret
movzx eax, word [edi]
mov edx, 0x10b
cmp ax, dx
jne 0x631398
mov byte [esi + 0x10], 0
mov eax, 0x60
jmp 0x6313af
mov edx, 0x20b
cmp ax, dx
jne 0x631516
mov byte [esi + 0x10], 1
mov eax, 0x70
mov word [esi + 0x1e], ax
cmp cx, ax
jae 0x6313c3
pop edi
mov dword [esi], str.optional_header_too_short
xor al, al
pop esi
ret
mov eax, dword [edi + 4]
mov cl, byte [esi + 0x10]
mov dword [esi + 0x2c], eax
mov eax, dword [edi + 8]
mov dword [esi + 0x30], eax
mov eax, dword [edi + 0xc]
mov dword [esi + 0x34], eax
mov eax, dword [edi + 0x14]
mov dword [esi + 0x38], eax
test cl, cl
je 0x6313f7
mov dword [esi + 0x3c], 0
mov eax, dword [edi + 0x18]
mov dword [esi + 0x40], eax
mov eax, dword [edi + 0x1c]
mov dword [esi + 0x44], eax
jmp 0x63140a
mov eax, dword [edi + 0x18]
mov dword [esi + 0x3c], eax
mov eax, dword [edi + 0x1c]
mov dword [esi + 0x40], eax
mov dword [esi + 0x44], 0
mov eax, dword [edi + 0x38]
test cl, cl
mov dword [esi + 0x48], eax
mov edx, 0x6c
mov eax, 0x5c
mov ecx, esi
cmovne eax, edx
push ebx
mov eax, dword [eax + edi]
mov dword [esi + 0x4c], eax
lea eax, [esi + 0x50]
push eax
push 0
call fcn.006317e0
lea ecx, [esi + 0x58]
mov bl, al
push ecx
push 1
mov ecx, esi
and bl, 1
call fcn.006317e0
lea ecx, [esi + 0x60]
and bl, al
push ecx
push 2
mov ecx, esi
call fcn.006317e0
and bl, al
mov ecx, esi
lea eax, [esi + 0x68]
push eax
push 3
call fcn.006317e0
and bl, al
mov ecx, esi
lea eax, [esi + 0x70]
push eax
push 5
call fcn.006317e0
and bl, al
mov ecx, esi
lea eax, [esi + 0x78]
push eax
push 0xb
call fcn.006317e0
and bl, al
mov ecx, esi
lea eax, [esi + 0x80]
push eax
push 0xc
call fcn.006317e0
and bl, al
mov ecx, esi
lea eax, [esi + 0x88]
push eax
push 0xd
call fcn.006317e0
and bl, al
mov ecx, esi
lea eax, [esi + 0x90]
push eax
push 0xe
call fcn.006317e0
test bl, al
pop ebx
jne 0x6314c7
pop edi
mov dword [esi], str.malformed_data_directory
xor al, al
pop esi
ret
movzx ecx, word [esi + 0x1c]
movzx edx, word [esi + 0x22]
add ecx, edi
mov dword [esi + 0x24], ecx
mov dword [esi + 0x14], 0
test edx, edx
je 0x63150b
xor edi, edi
cmp dword [ecx], 0x7865742e
jne 0x6314f4
cmp word [ecx + 4], 0x74
jne 0x6314f4
mov byte [esi + 0x28], 1
mov eax, dword [ecx + 0x14]
add eax, dword [ecx + 0x10]
cmp eax, edi
jbe 0x631503
mov edi, eax
mov dword [esi + 0x14], eax
add ecx, 0x28
sub edx, 1
jne 0x6314e1
pop edi
mov dword [esi], 0
mov al, 1
pop esi
ret
pop edi
mov dword [esi], str.unrecognized_magic
xor al, al
pop esi
ret
pop edi
mov dword [esi], str.no_PE_signature
xor al, al
pop esi
ret
pop edi
mov dword [esi], str.Bad_offset_to_PE_header
xor al, al
pop esi
ret
mov dword [esi], str.Not_MZ
xor al, al
pop esi
ret