Function at 0x51f194
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 9
push 0
push 0
dec ecx
jne 0x51f19d
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
test dl, dl
je 0x51f1b6
add esp, 0xfffffff0
call fcn.00404e9c
mov dword [ebp - 0xc], ecx
mov byte [ebp - 5], dl
mov ebx, eax
mov esi, dword [ebp + 0x14]
xor eax, eax
push ebp
push 0x51f440
push dword fs:[eax]
mov dword fs:[eax], esp
mov ecx, dword [ebp - 0xc]
xor edx, edx
mov eax, ebx
call fcn.0051bb98
mov eax, dword [ebx + 0x40]
call fcn.00406448
mov dword [ebx + 0x44], eax
xor eax, eax
mov dword [ebx + 0x18], eax
xor eax, eax
mov dword [ebx + 0x50], eax
mov dl, 1
mov eax, dword [0x50e51c]
call fcn.00404b08
mov dword [ebx + 0x54], eax
mov eax, esi
call fcn.0053d63c
push eax
push 0
mov ecx, ebx
mov dl, 1
mov eax, dword [0x50e4b4]
call fcn.0050fe30
mov edi, eax
lea eax, [edi + 0xc]
mov edx, dword [esi + 0x1c]
call fcn.00405aec
cmp dword [ebp + 0x10], 0
je 0x51f28f
mov eax, dword [ebp + 0x10]
mov eax, dword [eax + 4]
test eax, eax
je 0x51f239
sub eax, 4
mov eax, dword [eax]
test eax, eax
jle 0x51f28f
mov eax, edi
call fcn.005101d4
mov edx, dword [edi + 0x20]
mov eax, esi
call fcn.0053e2a8
mov eax, dword [edi + 0x20]
mov edx, dword [eax + 4]
mov eax, edi
call fcn.0051020c
mov eax, dword [edi + 0x3c]
mov edx, dword [ebp + 0x10]
call fcn.005352ac
mov eax, dword [ebx + 8]
mov eax, dword [eax + 0x168]
mov edx, edi
call fcn.0041ea44
mov eax, dword [ebp - 0xc]
cmp byte [eax + 0x1a9], 0
jne 0x51f28f
mov eax, dword [ebp + 0x10]
mov edx, dword [eax + 0x10]
mov eax, edi
call fcn.0051004c
mov eax, dword [ebx + 0x54]
mov edx, edi
call fcn.0041ea44
mov eax, dword [edi + 0x1c]
call fcn.00433704
cdq
xor eax, edx
sub eax, edx
mov edx, eax
mov eax, esi
call fcn.0053ab98
mov dword [ebx + 0x6c], eax
cmp byte [ebp + 8], 0
je 0x51f2e2
lea edx, [ebp - 0x12]
mov eax, esi
call fcn.0053ac58
mov edi, eax
mov dword [ebx + 0x84], edi
cmp byte [ebp - 0x12], 0
je 0x51f2e2
mov eax, edi
mov edx, 0x5a
call fcn.005340bc
mov dword [ebx + 0x88], eax
mov dl, 1
mov eax, dword [0x50e6d8]
call fcn.00404b08
mov dword [ebx + 0x58], eax
mov dl, 1
mov eax, dword [0x50bbe4]
call fcn.00404b08
mov dword [ebx + 0x5c], eax
cmp dword [ebp + 0x18], 0
je 0x51f382
lea ecx, [ebp - 0x10]
mov dl, 0x7e
mov eax, dword [ebp + 0x18]
call fcn.00534ff4
test al, al
je 0x51f353
lea edx, [ebp - 4]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
call fcn.0040abe4
mov eax, dword [ebp - 4]
mov edx, 0x51f474
call fcn.00405ec0
jne 0x51f33a
mov byte [ebx + 0x69], 1
jmp 0x51f353
mov eax, dword [ebp - 4]
mov edx, 0x51f484
call fcn.00405ec0
jne 0x51f34f
mov byte [ebx + 0x69], 2
jmp 0x51f353
mov byte [ebx + 0x69], 3
lea edx, [ebp - 0x18]
mov eax, dword [ebp + 0x18]
call fcn.00535110
cmp dword [ebp - 0x18], 0
je 0x51f382
lea edx, [ebp - 0x1c]
mov eax, dword [ebp + 0x18]
call fcn.00535110
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebx + 8]
mov eax, dword [eax + 0x188]
mov ecx, ebx
mov edi, dword [eax]
call dword [edi + 0x3c]
lea edx, [ebp - 0x11]
mov eax, esi
call fcn.0053a778
test al, al
je 0x51f397
movzx eax, byte [ebp - 0x11]
mov byte [ebx + 0x69], al
mov dl, 1
mov eax, dword [0x5333dc]
call fcn.00404b08
mov dword [ebx + 0x64], eax
lea eax, [ebp - 0x2c]
mov edx, 0x51f484
call fcn.004189fc
lea edx, [ebp - 0x2c]
lea eax, [esi + 0x78]
call fcn.0041a174
jne 0x51f3c6
mov byte [ebx + 0x68], 3
jmp 0x51f40a
lea eax, [ebp - 0x3c]
mov edx, 0x51f494
call fcn.004189fc
lea edx, [ebp - 0x3c]
lea eax, [esi + 0x78]
call fcn.0041a174
jne 0x51f3e6
mov byte [ebx + 0x68], 2
jmp 0x51f40a
lea eax, [ebp - 0x4c]
mov edx, 0x51f4a4
call fcn.004189fc
lea edx, [ebp - 0x4c]
lea eax, [esi + 0x78]
call fcn.0041a174
jne 0x51f406
mov byte [ebx + 0x68], 4
jmp 0x51f40a
mov byte [ebx + 0x68], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51f447
lea eax, [ebp - 0x4c]
mov edx, dword [0x401128]
mov ecx, 3
call fcn.004068b0
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.00405abc
lea eax, [ebp - 4]
call fcn.00405a98
ret