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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp + 8]
push eax
call fcn.00508ce0
add esp, 4
test eax, eax
jne 0x51b548
movzx ecx, byte [0x5e7b44]
test ecx, ecx
jne 0x51b551
mov dword [ebp - 0xc], 0
jmp 0x51b563
mov edx, 4
imul eax, edx, 0xb
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax + 0x78]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 0x30]
movzx edx, word [ecx + 6]
lea eax, [edx*4 + 0x14]
mov dword [ebp - 0x24], eax
imul ecx, dword [ebp - 0xc], 0x48
add ecx, 0x88
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x20]
add eax, dword [ebp - 0x24]
cdq
push edx
push eax
mov edx, dword [ebp + 8]
push edx
call fcn.004e54a0
add esp, 0xc
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 4]
mov dword [eax + 0x2c], ecx
cmp dword [ebp - 4], 0
jne 0x51b5b7
mov dword [ebp - 0x1c], 7
jmp 0x51b830
mov edx, 0x10
imul eax, edx, 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x10]
mov eax, dword [edx + eax + 4]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 4]
add ecx, dword [ebp - 0x20]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov dword [edx + 0x1c], eax
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x30]
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.00576360
add esp, 0xc
mov edx, dword [ebp - 8]
mov dword [edx + 0xc], 0
cmp dword [ebp + 0xc], 0
je 0x51b616
cmp dword [ebp - 0xc], 0
jne 0x51b616
mov eax, dword [ebp - 8]
mov cx, word [ebp + 0xc]
mov word [eax + 6], cx
mov edx, dword [ebp - 0x18]
push edx
call fcn.004de020
add esp, 4
mov eax, dword [ebp - 0x18]
push eax
call fcn.004de250
add esp, 4
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x10]
mov dword [ecx + 0xc], edx
mov eax, dword [ebp - 0x18]
push eax
call fcn.004df430
add esp, 4
mov ecx, dword [ebp - 0xc]
add ecx, 1
mov edx, dword [ebp - 4]
mov byte [edx + 0x3b], cl
mov eax, dword [ebp - 0xc]
sub eax, 1
mov ecx, dword [ebp - 4]
mov byte [ecx + 0x3a], al
mov edx, dword [ebp - 4]
movzx eax, byte [edx + 0x3b]
cmp eax, 1
jle 0x51b673
mov dword [ebp - 0x28], 1
jmp 0x51b67a
mov dword [ebp - 0x28], 0
mov ecx, dword [ebp - 4]
mov dl, byte [ebp - 0x28]
mov byte [ecx + 0x39], dl
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov dword [eax + 0x18], ecx
mov dword [ebp - 0x14], 0
jmp 0x51b69e
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 4]
movzx ecx, byte [eax + 0x3b]
cmp dword [ebp - 0x14], ecx
jge 0x51b6c3
imul edx, dword [ebp - 0x14], 0x48
mov eax, dword [ebp - 4]
lea ecx, [eax + edx + 0x40]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 4]
mov dword [edx + 8], eax
jmp 0x51b695
mov ecx, dword [ebp + 8]
push ecx
call fcn.00508ce0
add esp, 4
test eax, eax
jne 0x51b7dd
mov edx, dword [0x5e7c0c]
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
imul eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
mov dword [ecx], eax
mov edx, 0x10
imul eax, edx, 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x10]
mov eax, dword [edx + eax + 0xc]
mov eax, dword [eax + 0x50]
cdq
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
cmp dword [ebp - 0x38], 0
jg 0x51b732
jl 0x51b716
cmp dword [ebp - 0x3c], 0
jae 0x51b732
push 0xffffffffffffffff
push 0xfffffc00
mov ecx, dword [ebp - 0x38]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00575580
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
jmp 0x51b74b
mov eax, dword [ebp - 0x10]
cdq
push edx
push eax
mov eax, dword [ebp - 0x38]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00575580
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
cmp dword [ebp - 0x38], 0
jg 0x51b76a
jl 0x51b75c
cmp dword [ebp - 0x3c], 0x20000000
jae 0x51b76a
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x40], eax
jmp 0x51b776
xor ecx, ecx
mov dword [ebp - 0x44], 0x20000000
mov dword [ebp - 0x40], ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 4]
cmp dword [edx], ecx
jle 0x51b796
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
mov dword [ebp - 0x2c], ecx
jmp 0x51b79c
mov edx, dword [ebp - 0x3c]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 4], ecx
movzx edx, byte [0x5e7b48]
test edx, edx
jne 0x51b7dd
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x10]
mov dword [eax + 0x34], ecx
mov eax, dword [ebp - 0x10]
cdq
push edx
push eax
call fcn.004f7980
add esp, 8
mov edx, dword [ebp - 4]
mov dword [edx + 0x28], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x28], 0
jne 0x51b7dd
mov dword [ebp - 0x1c], 7
mov ecx, dword [ebp - 8]
movzx edx, word [ecx + 8]
cmp edx, 0xd
jge 0x51b830
mov eax, 4
imul ecx, eax, 0
mov edx, dword [ebp - 8]
cmp dword [edx + ecx + 0x14], 0
je 0x51b812
mov eax, 4
imul ecx, eax, 0
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 8]
mov ecx, dword [edx + ecx + 0x14]
cmp ecx, dword [eax + 8]
jne 0x51b830
mov edx, 1
imul eax, edx, 0
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 0x10]
movzx eax, byte [edx + eax]
and eax, 2
jne 0x51b830
mov ecx, dword [ebp - 4]
mov byte [ecx + 0x3c], 3
mov eax, dword [ebp - 0x1c]
mov esp, ebp
pop ebp
ret