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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x51e283
sub esp, 0x50
mov eax, dword [esp + 0x60]
test eax, eax
jne 0x51e163
xor eax, eax
mov ecx, dword [esp + 0x68]
xor edx, edx
xor ebx, ebx
xor ebp, ebp
test edx, edx
jne 0x51e13c
mov dword [esp + 0x38], ebx
mov edx, dword [esp + 0x5c]
mov ebp, dword [edx]
lea esi, [ecx + eax]
mov edi, dword [ebp + 8]
mov ebp, dword [ebp + 4]
lea edx, [edi - 1]
test edx, edx
jl 0x51e135
mov ebp, dword [ebp + edi*4 - 4]
nop
cmp ebp, 0x10000
jb 0x51e12e
shr ebp, 0x10
mov edi, 0x10
cmp ebp, 0x100
jb 0x51deae
shr ebp, 8
add edi, 8
cmp ebp, 0x100
jae 0x51e259
shl edx, 5
lea ebx, [0x5eca20]
movzx ebx, byte [ebp + ebx]
add ebx, edi
add edx, ebx
lea ebx, [ecx + eax + 0xb]
lea ebp, [edx + 7]
sar ebp, 0x1f
shr ebp, 0x1d
lea edx, [ebp + edx + 7]
sar edx, 3
cmp edx, ebx
jl 0x51e0fb
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x24], esi
mov dword [esp + 0x30], edx
mov dword [esp + 0x28], eax
lea eax, [0x643900]
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], edx
call fcn.00444130
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x30]
cmp ecx, 1
jbe 0x51e24f
mov byte [eax + 1], 1
mov ebx, dword [esp + 0x24]
mov edx, 2
jmp 0x51df35
mov byte [eax + edx], 0xff
inc edx
mov ecx, ebp
mov ebp, ecx
sub ecx, ebx
lea esi, [ecx - 1]
cmp edx, esi
jge 0x51df49
cmp ebp, edx
ja 0x51df2e
jmp 0x51e246
mov ebx, dword [esp + 0x2c]
mov edx, ebp
sub ebp, ebx
cmp edx, ebp
jb 0x51e23f
cmp ecx, ebp
ja 0x51e236
mov ebx, ebp
sub ebp, ecx
mov esi, edx
sub edx, ecx
neg edx
sar edx, 0x1f
and ecx, edx
add ecx, eax
mov edx, dword [esp + 0x28]
cmp ebp, edx
jle 0x51e0f4
mov dword [esp + 0x3c], eax
mov dword [esp + 0x34], ebx
mov ebp, dword [esp + 0x38]
cmp ecx, ebp
je 0x51df9e
mov dword [esp], ecx
mov dword [esp + 4], ebp
mov dword [esp + 8], edx
call fcn.0045d2c0
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edx, eax
sub eax, ecx
mov ebx, eax
neg eax
sar eax, 0x1f
and ecx, eax
mov eax, dword [esp + 0x3c]
add ecx, eax
mov ebp, dword [esp + 0x68]
cmp ebx, ebp
jle 0x51e0ed
mov ebx, dword [esp + 0x64]
cmp ecx, ebx
je 0x51dfdd
mov dword [esp], ecx
mov dword [esp + 4], ebx
mov dword [esp + 8], ebp
call fcn.0045d2c0
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 + 0x3c]
mov dword [esp + 0xc], eax
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], ecx
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.005208f0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
test eax, eax
je 0x51e0a2
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], edx
add esp, 0x50
ret
mov dword [esp], ecx
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 8], eax
mov dword [esp + 0xc], eax
call fcn.004de730
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
mov dword [esp + 0x78], edx
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 0
add esp, 0x50
ret
mov ebp, ebx
jmp 0x51dfc5
mov edx, ebp
jmp 0x51df7e
mov eax, dword [0x7ccc50]
mov ecx, dword [0x7ccc54]
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], ecx
add esp, 0x50
ret
xor edi, edi
jmp 0x51dea0
xor edx, edx
jmp 0x51decc
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], edx
mov dword [esp + 0x80], ebp
add esp, 0x50
ret
nop
cmp eax, 0x14
jae 0x51e26a
mov ecx, dword [0x61c454]
mov edx, dword [0x61c450]
cmp eax, ecx
jae 0x51e265
movzx ecx, byte [edx + eax]
mov edx, dword [esp + 0x68]
cmp ecx, edx
je 0x51e1c1
nop
lea eax, [0x64d2c0]
mov dword [esp], eax
call fcn.0040c800
mov ebp, dword [esp + 4]
mov dword [ebp + 4], 0x28
lea eax, [0x6870aa]
mov dword [ebp], eax
xor eax, eax
xor ecx, ecx
lea edx, [0x6cadb0]
xor ebx, ebx
jmp 0x51de61
mov dword [esp + 0x34], ecx
lea ecx, [0x644ca0]
mov dword [esp], ecx
mov ecx, dword [0x7cc0a0]
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
call fcn.0040f570
mov eax, dword [esp + 0xc]
movzx ecx, byte [esp + 0x10]
mov edx, dword [eax]
mov eax, dword [eax + 4]
test cl, cl
je 0x51e202
mov ecx, dword [esp + 0x34]
mov ebx, edx
xor ebp, ebp
xor edx, edx
jmp 0x51de61
nop
lea eax, [0x64d2c0]
mov dword [esp], eax
call fcn.0040c800
mov ebp, dword [esp + 4]
mov dword [ebp + 4], 0x25
lea eax, [0x6861d7]
mov dword [ebp], eax
xor eax, eax
xor ecx, ecx
lea edx, [0x6cadb0]
xor ebx, ebx
jmp 0x51de61
mov eax, ecx
mov ecx, ebp
call fcn.0045ca00
mov ecx, ebp
call fcn.0045c9e0
mov eax, edx
mov ecx, ebp
call fcn.0045c9a0
mov eax, 1
call fcn.0045c9a0
mov eax, ebp
mov ecx, 0x100
call fcn.0045c9b0
call fcn.0045c9b0
lea eax, [0x643700]
mov dword [esp], eax
lea eax, [0x6c77d8]
mov dword [esp + 4], eax
call fcn.00431bb0
nop
call fcn.0045b380
jmp fcn.0051de30