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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x653020
push eax
mov dword fs:[0], esp
sub esp, 0x68
push ebp
push esi
push edi
mov edi, dword [esp + 0x88]
xor esi, esi
cmp edi, esi
je 0x512774
cmp dword [edi + 4], esi
je 0x512774
mov ecx, edi
call fcn.0064406e
mov ebp, dword [esp + 0x8c]
cmp ebp, esi
jne 0x5127b1
push esi
push esi
push esi
push esi
call dword [fcn.0065e104]
push eax
mov ecx, edi
call fcn.006440f8
mov eax, dword [esp + 0x84]
pop edi
mov dword [eax], esi
mov dword [eax + 4], esi
pop esi
pop ebp
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
add esp, 0x74
ret 0x10
push ebx
push esi
lea ecx, [esp + 0x50]
call fcn.00644170
lea ecx, [esp + 0x3c]
mov dword [esp + 0x80], esi
call fcn.0064414c
mov edi, dword [esp + 0x50]
lea eax, [esp + 0x4c]
neg eax
sbb eax, eax
mov byte [esp + 0x80], 1
and eax, edi
push eax
call dword [fcn.0065e0d0]
push eax
lea ecx, [esp + 0x40]
call fcn.00644146
mov dword [esp + 0x30], esi
mov dword [esp + 0x2c], 0x661a18
mov eax, dword [esp + 0x50]
push 1
push 1
push eax
mov byte [esp + 0x8c], 2
call dword [fcn.0065e0c8]
push eax
lea ecx, [esp + 0x30]
call fcn.006440f8
mov ebx, dword [esp + 0x30]
mov ecx, dword [esp + 0x40]
lea eax, [esp + 0x2c]
neg eax
sbb eax, eax
and eax, ebx
push eax
push ecx
call fcn.00644140
mov edx, dword [esp + 0x94]
lea ecx, [esp + 0x3c]
push edx
push 1
push 1
push esi
push esi
call fcn.0064413a
mov ecx, dword [ebp + 4]
lea eax, [esp + 0x60]
push eax
push 0x18
push ecx
call dword [fcn.0065e08c]
mov ebx, dword [esp + 0x72]
mov edx, dword [esp + 0x64]
mov eax, dword [esp + 0x68]
and ebx, 0xffff
shr ebx, 3
push ebx
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x2c], ebx
call fcn.00643b70
mov ecx, dword [esp + 0x34]
add esp, 4
mov edi, eax
push edi
push ebx
push ecx
mov dword [esp + 0x1c], edi
call dword [0x65e0f4]
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x24], eax
imul eax, dword [esp + 0x68]
mov esi, eax
push esi
call fcn.00643b70
add esp, 4
mov dword [esp + 0x20], eax
xor edx, edx
cmp word [esp + 0x72], 0x20
push eax
mov eax, dword [ebp + 4]
sete dl
push esi
push eax
mov dword [esp + 0x9c], edx
call dword [0x65e0f4]
mov ecx, dword [esp + 0x68]
imul ecx, dword [esp + 0x64]
add ecx, 2
shl ecx, 4
push ecx
call fcn.00643b70
mov ebp, eax
xor ecx, ecx
add esp, 4
mov dword [esp + 0x94], ecx
mov dword [ebp], 0x20
mov dword [ebp + 4], 1
mov dword [ebp + 0x10], ecx
mov dword [ebp + 0x14], ecx
mov edx, dword [esp + 0x64]
lea eax, [ebp + 0x20]
mov dword [ebp + 0x18], edx
mov edx, dword [esp + 0x68]
mov dword [ebp + 0x1c], edx
mov dword [ebp + 0xc], ecx
mov dword [ebp + 8], ecx
mov edx, dword [esp + 0x68]
cmp edx, ecx
jle 0x512a85
mov edx, dword [esp + 0x90]
mov ecx, ebx
sub ecx, edx
mov dword [esp + 0x14], ecx
jmp 0x51294b
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0x94]
mov esi, dword [esp + 0x20]
imul edx, dword [esp + 0x24]
add esi, edx
xor edx, edx
mov dword [esp + 0x1c], esi
repe cmpsb byte [esi], byte es:[edi]
je 0x51296c
sbb edx, edx
sbb edx, 0xffffffff
xor ecx, ecx
test edx, edx
setne cl
mov edi, ecx
mov ecx, dword [esp + 0x64]
mov edx, 1
mov dword [esp + 0x18], edi
cmp ecx, edx
mov dword [esp + 0x90], edx
jle 0x512a2a
mov ecx, dword [esp + 0x1c]
lea esi, [ecx + ebx]
mov dword [esp + 0x1c], esi
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
mov edi, dword [esp + 0x18]
setne bl
cmp edi, ebx
jne 0x5129bc
inc dword [esp + 0x90]
jmp 0x512a0f
cmp edi, 1
jne 0x5129f2
mov esi, dword [esp + 0x90]
mov ecx, edx
sub ecx, esi
mov dword [eax + 8], edx
mov dword [eax], ecx
mov ecx, dword [esp + 0x94]
mov dword [eax + 4], ecx
inc ecx
mov dword [eax + 0xc], ecx
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
add eax, 0x10
inc esi
add ecx, 0x10
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], ecx
inc edi
and edi, 0x80000001
jns 0x512a00
dec edi
or edi, 0xfffffffe
inc edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x90], 1
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x28]
mov ecx, dword [esp + 0x64]
inc edx
add esi, ebx
cmp edx, ecx
mov dword [esp + 0x1c], esi
jl 0x51299c
cmp edi, 1
jne 0x512a64
mov esi, dword [esp + 0x90]
mov ecx, edx
sub ecx, esi
mov dword [eax + 8], edx
mov dword [eax], ecx
mov ecx, dword [esp + 0x94]
mov dword [eax + 4], ecx
add eax, 0x10
lea edx, [ecx + 1]
mov dword [eax - 4], edx
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
inc esi
add edx, 0x10
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], edx
jmp 0x512a6b
mov ecx, dword [esp + 0x94]
mov edx, dword [esp + 0x68]
inc ecx
cmp ecx, edx
mov dword [esp + 0x94], ecx
jl 0x512943
mov edi, dword [esp + 0x10]
xor ecx, ecx
mov eax, dword [ebp + 0xc]
push ebp
add eax, 0x20
push eax
push ecx
call dword [0x65e0e8]
mov ecx, dword [esp + 0x8c]
push eax
call fcn.006440f8
push ebp
call fcn.00643cfc
mov eax, dword [esp + 0x24]
push eax
call fcn.00643cfc
push edi
call fcn.00643cfc
add esp, 0xc
lea ecx, [esp + 0x2c]
call fcn.0064406e
lea ecx, [esp + 0x3c]
call fcn.00644134
mov esi, dword [esp + 0x88]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [esp + 0x2c], 0x661578
mov dword [esi], ecx
mov dword [esi + 4], edx
lea ecx, [esp + 0x2c]
mov byte [esp + 0x80], 3
call fcn.0064406e
lea ecx, [esp + 0x3c]
mov dword [esp + 0x2c], 0x6602dc
mov byte [esp + 0x80], 0
call fcn.0064411c
lea ecx, [esp + 0x4c]
mov dword [esp + 0x80], 0xffffffff
call fcn.0064416a
mov ecx, dword [esp + 0x78]
pop ebx
mov eax, esi
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x74
ret 0x10