Function at 0x51ca90
Capabilities:
Parse pe header
Resolve function by parsing pe exports

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x190
mov dword [ebp - 0x20], 0
cmp dword [ebx + 8], 0
jne 0x51cac0
xor eax, eax
jmp 0x51ce58
mov eax, dword [ebx + 8]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x38]
movzx edx, word [ecx]
cmp edx, 0x5a4d
je 0x51cadb
xor eax, eax
jmp 0x51ce58
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebx + 8]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 0x24]
cmp dword [edx], 0x4550
je 0x51caf9
xor eax, eax
jmp 0x51ce58
mov eax, dword [ebp - 0x24]
movzx ecx, word [eax + 0x18]
cmp ecx, 0x20b
jne 0x51cb37
mov edx, 8
imul eax, edx, 0
mov ecx, dword [ebp - 0x24]
mov edx, dword [ecx + eax + 0x88]
add edx, dword [ebx + 8]
mov dword [ebp - 8], edx
mov eax, 8
imul ecx, eax, 0
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + ecx + 0x8c]
mov dword [ebp - 0x44], eax
jmp 0x51cb5e
mov ecx, 8
imul edx, ecx, 0
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + edx + 0x78]
add ecx, dword [ebx + 8]
mov dword [ebp - 8], ecx
mov edx, 8
imul eax, edx, 0
mov ecx, dword [ebp - 0x24]
mov edx, dword [ecx + eax + 0x7c]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 8]
mov ecx, dword [ebx + 8]
add ecx, dword [eax + 0x24]
mov dword [ebp - 0x4c], ecx
mov edx, dword [ebp - 8]
mov eax, dword [ebx + 8]
add eax, dword [edx + 0x20]
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebx + 8]
add edx, dword [ecx + 0x1c]
mov dword [ebp - 0x54], edx
mov dword [ebp - 0x18], 0
jmp 0x51cb94
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x18]
cmp edx, dword [ecx + 0x14]
jae 0x51ce55
mov eax, 0xffff
mov word [ebp - 4], ax
mov dword [ebp - 0x3c], 0
cmp dword [ebx + 0xc], 0xffff
ja 0x51cbc6
mov cx, word [ebp - 0x18]
mov word [ebp - 4], cx
jmp 0x51cc00
cmp dword [ebx + 0xc], 0xffff
jbe 0x51cbf9
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
cmp eax, dword [edx + 0x18]
jae 0x51cbf9
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x48]
mov eax, dword [ebx + 8]
add eax, dword [edx + ecx*4]
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x4c]
mov ax, word [edx + ecx*2]
mov word [ebp - 4], ax
jmp 0x51cc00
xor eax, eax
jmp 0x51ce58
cmp dword [ebx + 0xc], 0xffff
ja 0x51cc1b
movzx ecx, word [ebx + 0xc]
movzx edx, word [ebp - 4]
mov eax, dword [ebp - 8]
add edx, dword [eax + 0x10]
cmp ecx, edx
je 0x51cc89
cmp dword [ebx + 0xc], 0xffff
jbe 0x51ce50
mov ecx, dword [ebx + 0xc]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x3c]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x2c]
mov cl, byte [eax]
mov byte [ebp - 9], cl
mov edx, dword [ebp - 0x30]
cmp cl, byte [edx]
jne 0x51cc71
cmp byte [ebp - 9], 0
je 0x51cc68
mov eax, dword [ebp - 0x2c]
mov cl, byte [eax + 1]
mov byte [ebp - 0xa], cl
mov edx, dword [ebp - 0x30]
cmp cl, byte [edx + 1]
jne 0x51cc71
add dword [ebp - 0x2c], 2
add dword [ebp - 0x30], 2
cmp byte [ebp - 0xa], 0
jne 0x51cc34
mov dword [ebp - 0x40], 0
jmp 0x51cc79
sbb eax, eax
or eax, 1
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x50], ecx
cmp dword [ebp - 0x50], 0
jne 0x51ce50
movzx edx, word [ebp - 4]
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebx + 8]
add ecx, dword [eax + edx*4]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
cmp edx, dword [ebp - 8]
jb 0x51ce4e
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x44]
cmp dword [ebp - 0x20], eax
ja 0x51ce4e
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x1c], 0
push 0x100
push 0
lea ecx, [ebp - 0x190]
push ecx
call fcn.00541ec0
add esp, 0xc
mov dword [ebp - 0x34], 0
mov edx, dword [ebp - 0x20]
push edx
call fcn.00554ec1
add esp, 4
mov dword [ebp - 0x28], eax
xor eax, eax
mov byte [ebp - 0xb], al
xor ecx, ecx
mov byte [ebp - 0xc], cl
xor edx, edx
mov byte [ebp - 0xd], dl
movzx eax, byte [ebp - 0xb]
push eax
movzx ecx, byte [ebp - 0xc]
push ecx
movzx edx, byte [ebp - 0xd]
push edx
lea eax, [ebp - 0x70]
push eax
call fcn.0051ce60
add esp, 0x10
mov ecx, eax
call fcn.0051d460
mov dword [ebp - 0x58], eax
mov ecx, dword [ebp - 0x58]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call fcn.005419f0
add esp, 8
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov byte [eax], 0
mov ecx, dword [ebp - 0x1c]
add ecx, 1
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x28]
push edx
lea eax, [ebp - 0x190]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
xor ecx, ecx
mov byte [ebp - 0xe], cl
xor edx, edx
mov byte [ebp - 0xf], dl
xor eax, eax
mov byte [ebp - 0x10], al
movzx ecx, byte [ebp - 0xe]
push ecx
movzx edx, byte [ebp - 0xf]
push edx
movzx eax, byte [ebp - 0x10]
push eax
lea ecx, [ebp - 0x80]
push ecx
call fcn.0051ce70
add esp, 0x10
mov ecx, eax
call fcn.0051d460
push eax
lea edx, [ebp - 0x190]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x190]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x51cdbd
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.0054f16e
add esp, 4
xor eax, eax
jmp 0x51ce58
xor edx, edx
mov byte [ebp - 0x11], dl
xor eax, eax
mov byte [ebp - 0x12], al
xor ecx, ecx
mov byte [ebp - 0x13], cl
movzx edx, byte [ebp - 0x11]
push edx
movzx eax, byte [ebp - 0x12]
push eax
movzx ecx, byte [ebp - 0x13]
push ecx
lea edx, [ebp - 0x90]
push edx
call fcn.0051ce80
add esp, 0x10
mov ecx, eax
call fcn.0051d460
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x5c]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call fcn.005419f0
add esp, 8
test eax, eax
jne 0x51ce1d
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x34]
push eax
call fcn.0051ca90
add esp, 8
mov dword [ebp - 0x20], eax
jmp 0x51ce42
mov ecx, dword [ebp - 0x1c]
add ecx, 1
push ecx
call fcn.00555b31
add esp, 4
mov dword [ebp - 0x60], eax
mov edx, dword [ebp - 0x60]
push edx
mov eax, dword [ebp - 0x34]
push eax
call fcn.0051ca90
add esp, 8
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.0054f16e
add esp, 4
jmp 0x51ce55
jmp 0x51cb8b
mov eax, dword [ebp - 0x20]
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret