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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x51dcb8
sub esp, 0x50
mov edx, dword [esp + 0x5c]
mov ebx, dword [edx]
mov ebp, dword [ebx + 8]
mov ebx, dword [ebx + 4]
lea esi, [ebp - 1]
test esi, esi
jl 0x51dc8c
mov ebx, dword [ebx + ebp*4 - 4]
nop
cmp ebx, 0x10000
jb 0x51dc85
shr ebx, 0x10
mov eax, 0x10
cmp ebx, 0x100
jb 0x51dc7e
shr ebx, 8
lea ebp, [eax + 8]
cmp ebx, 0x100
jae 0x51dcab
shl esi, 5
lea eax, [0x5eca20]
movzx eax, byte [eax + ebx]
add eax, ebp
add eax, esi
lea ecx, [eax + 7]
sar ecx, 0x1f
shr ecx, 0x1d
lea eax, [ecx + eax + 7]
sar eax, 3
cmp eax, 0xb
jl 0x51dc38
mov dword [esp + 0x30], eax
mov byte [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
mov dword [esp], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov eax, dword [esp + 0x60]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x14], eax
call fcn.004e92e0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
mov byte [esp + 0x40], 0
mov eax, dword [esp + 0x54]
mov dword [esp], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x5c]
mov dword [esp + 8], eax
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
call fcn.005200c0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
test eax, eax
jne 0x51dbfe
mov dword [esp + 0x3c], ecx
lea eax, [0x643900]
mov dword [esp], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
mov dword [esp + 8], eax
call fcn.00444130
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x3c]
mov dword [esp], ecx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 8], eax
mov dword [esp + 0xc], eax
call fcn.004de730
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
test ecx, ecx
jbe 0x51dca4
movzx ebx, byte [eax]
cmp ecx, 1
jbe 0x51dc9a
mov dword [esp + 0x38], edx
mov dword [esp + 0x34], ebx
movzx ebp, byte [eax + 1]
xchg ebp, eax
mov byte [esp + 0x27], al
xchg ebp, eax
mov esi, 2
xor edi, edi
mov esi, 1
mov dword [esp + 0x28], esi
mov esi, 2
jmp 0x51db91
lea edx, [esi + 1]
movzx ebp, byte [eax + esi]
dec ebp
shr ebp, 0x1f
mov ebx, dword [esp + 0x28]
and ebx, ebp
mov dword [esp + 0x2c], ebx
nop
neg ebx
and ebx, esi
mov esi, dword [esp + 0x2c]
dec esi
and edi, esi
or edi, ebx
lea ebx, [ebp - 1]
mov ebp, dword [esp + 0x28]
and ebp, ebx
mov ebx, dword [esp + 0x34]
mov esi, edx
mov dword [esp + 0x28], ebp
mov edx, dword [esp + 0x38]
movzx ebp, byte [esp + 0x27]
cmp esi, ecx
jge 0x51db9c
jb 0x51db52
jmp 0x51dc93
nop
dec ebx
shr ebx, 0x1f
xor ebp, 2
xchg ebp, eax
movzx eax, al
xchg ebp, eax
dec ebp
shr ebp, 0x1f
and ebx, ebp
mov ebp, dword [esp + 0x28]
xchg ebp, ebx
not ebx
xchg ebp, ebx
and ebp, ebx
lea ebx, [edi - 0xa]
neg ebx
dec ebx
sar ebx, 0x1f
and ebx, ebp
and ebx, 1
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
mov dword [esp + 0x78], edx
lea eax, [edi + 1]
neg ebx
and ebx, eax
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x80], 0
mov dword [esp + 0x84], 0
add esp, 0x50
ret
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], edx
add esp, 0x50
ret
mov eax, dword [0x7ccc48]
mov ecx, dword [0x7ccc4c]
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], ecx
add esp, 0x50
ret
mov ebp, eax
jmp 0x51d9eb
xor eax, eax
jmp 0x51d9d9
xor eax, eax
jmp 0x51da08
mov eax, esi
call fcn.0045c9a0
mov eax, 1
call fcn.0045c9a0
xor eax, eax
call fcn.0045c9a0
mov eax, ebx
mov ecx, 0x100
call fcn.0045c9b0
nop
call fcn.0045b380
jmp fcn.0051d990