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

Disassembly:
sub esp, 0x20
mov eax, dword [esp + 0x64]
mov dword [esp + 0x14], 0
test eax, eax
jl 0x512d93
mov edx, dword [esp + 0x28]
push ebx
mov ebx, dword [esp + 0x3c]
push ebp
push esi
push edi
mov eax, dword [esp + 0x34]
mov edi, dword [esp + 0x24]
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x4c]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 0x20], ebp
cmp edi, eax
mov dword [esp + 0x18], ecx
jne 0x5129cb
mov eax, dword [esp + 0x70]
test eax, eax
je 0x5129cb
mov dword [esp + 0x10], ebp
mov edi, esi
jmp 0x5129d7
mov eax, dword [esp + 0x40]
mov edi, dword [esp + 0x50]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x68]
test eax, eax
je 0x512aea
xor edx, edx
mov dword [esp + 0x28], 1
mov dl, byte [esi]
shl edx, 1
mov eax, edx
xor edx, edx
mov dl, byte [esi + 1]
sub eax, edx
xor edx, edx
mov dl, byte [ebx]
shl eax, 1
sub eax, edx
xor edx, edx
mov dl, byte [edi]
sub eax, edx
test ecx, ecx
mov dword [esp + 0x1c], eax
je 0x512a2b
cmp eax, 0xff
jle 0x512a1c
mov byte [ecx], 0xff
jmp 0x512a26
test eax, eax
setl dl
dec edx
and edx, eax
mov byte [ecx], dl
inc ecx
mov dword [esp + 0x18], ecx
mov eax, dword [esp + 0x64]
xor edx, edx
xor ebx, ebx
lea ecx, [eax + eax]
mov bx, word [ebp]
xor eax, eax
mov dx, word [ecx + ebp]
mov al, byte [esi + 1]
imul edx, eax
xor eax, eax
xor ebp, ebp
mov al, byte [esi]
imul eax, ebx
mov ebx, dword [esp + 0x48]
shl eax, 2
sub eax, edx
xor edx, edx
mov dl, byte [ebx]
mov ebx, edx
mov edx, dword [esp + 0x38]
mov bp, word [edx]
add edx, ecx
imul ebx, ebp
mov ebp, dword [esp + 0x10]
sub eax, ebx
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x48], edx
xor edx, edx
inc ebx
mov dx, word [ebp]
mov ebp, edx
xor edx, edx
mov dl, byte [edi]
imul ebp, edx
sub eax, ebp
mov ebp, dword [esp + 0x10]
add ebp, ecx
inc edi
mov dword [esp + 0x10], ebp
mov ebp, dword [esp + 0x1c]
test ebp, ebp
mov dword [esp + 0x38], edi
jle 0x512acc
cdq
idiv ebp
mov ebp, eax
cmp ebp, 0xffff
jle 0x512ab9
mov eax, dword [esp + 0x34]
mov word [eax], 0xffff
jmp 0x512ad5
mov eax, dword [esp + 0x34]
xor edx, edx
test ebp, ebp
setl dl
dec edx
and edx, ebp
mov word [eax], dx
jmp 0x512ad5
mov edx, dword [esp + 0x34]
mov word [edx], 0
mov eax, dword [esp + 0x34]
mov ebp, dword [esp + 0x20]
lea edx, [ecx + eax]
mov eax, dword [esp + 0x28]
mov dword [esp + 0x14], edx
jmp 0x512b08
mov ecx, dword [esp + 0x64]
xor eax, eax
add ecx, ecx
inc ebx
add edx, ecx
inc edi
mov dword [esp + 0x48], edx
mov edx, dword [esp + 0x10]
add edx, ecx
mov dword [esp + 0x38], edi
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x78]
cmp eax, edx
jge 0x512c59
sub edx, eax
mov dword [esp + 0x28], edx
xor eax, eax
mov al, byte [esi + 2]
mov edx, eax
xor eax, eax
mov al, byte [esi + 1]
lea eax, [eax + eax*4]
sub eax, edx
xor edx, edx
mov dl, byte [edi]
sub eax, edx
xor edx, edx
mov dl, byte [esi]
sub eax, edx
xor edx, edx
mov dl, byte [ebx]
sub eax, edx
mov edx, dword [esp + 0x44]
test edx, edx
mov dword [esp + 0x1c], eax
je 0x512b6b
cmp eax, 0xff
jle 0x512b59
mov eax, dword [esp + 0x18]
mov byte [eax], 0xff
jmp 0x512b67
test eax, eax
setl dl
dec edx
and edx, eax
mov eax, dword [esp + 0x18]
mov byte [eax], dl
inc dword [esp + 0x18]
xor eax, eax
xor edx, edx
mov ax, word [ebp]
mov dl, byte [esi]
imul eax, edx
add ebp, ecx
xor edx, edx
neg eax
mov dx, word [ecx + ebp]
inc esi
mov dword [esp + 0x2c], edx
xor edx, edx
mov dl, byte [esi + 1]
mov dword [esp + 0x20], ebp
mov edi, edx
mov edx, dword [esp + 0x2c]
imul edx, edi
mov dword [esp + 0x2c], edx
xor edi, edi
mov di, word [ebp]
xor edx, edx
mov dl, byte [esi]
mov ebp, dword [esp + 0x48]
imul edi, edx
lea edx, [edi + edi*4]
mov edi, dword [esp + 0x2c]
sub edx, edi
xor edi, edi
mov di, word [ebp]
mov dword [esp + 0x2c], edx
xor edx, edx
mov dl, byte [ebx]
imul edi, edx
mov edx, dword [esp + 0x2c]
sub edx, edi
mov edi, ebp
add edi, ecx
add eax, edx
mov dword [esp + 0x48], edi
mov edi, dword [esp + 0x10]
xor edx, edx
inc ebx
mov dx, word [edi]
mov edi, dword [esp + 0x38]
mov ebp, edx
xor edx, edx
mov dl, byte [edi]
imul ebp, edx
sub eax, ebp
mov ebp, dword [esp + 0x10]
add ebp, ecx
inc edi
mov dword [esp + 0x10], ebp
mov ebp, dword [esp + 0x1c]
test ebp, ebp
mov dword [esp + 0x38], edi
jle 0x512c33
cdq
idiv ebp
mov ebp, eax
cmp ebp, 0xffff
jle 0x512c20
mov eax, dword [esp + 0x14]
mov word [eax], 0xffff
jmp 0x512c3c
mov eax, dword [esp + 0x14]
xor edx, edx
test ebp, ebp
setl dl
dec edx
and edx, ebp
mov word [eax], dx
jmp 0x512c3c
mov edx, dword [esp + 0x14]
mov word [edx], 0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x28]
mov ebp, dword [esp + 0x20]
add edx, ecx
dec eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x28], eax
jne 0x512b1a
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x512d28
xor eax, eax
xor edx, edx
mov al, byte [esi + 1]
mov dl, byte [edi]
shl eax, 2
sub eax, edx
xor edx, edx
mov dl, byte [esi]
sub eax, edx
xor edx, edx
mov dl, byte [ebx]
sub eax, edx
mov edx, dword [esp + 0x44]
test edx, edx
mov dword [esp + 0x1c], eax
je 0x512cad
cmp eax, 0xff
jle 0x512c9b
mov edx, dword [esp + 0x18]
mov byte [edx], 0xff
jmp 0x512cad
test eax, eax
setl dl
dec edx
and edx, eax
mov eax, dword [esp + 0x18]
mov byte [eax], dl
mov eax, dword [esp + 0x1c]
test eax, eax
jle 0x512d1f
xor eax, eax
xor edx, edx
mov ax, word [ecx + ebp]
mov dx, word [ebp]
xor ecx, ecx
mov cl, byte [esi + 1]
imul eax, ecx
xor ecx, ecx
mov cl, byte [esi]
imul edx, ecx
mov ecx, dword [esp + 0x48]
shl eax, 2
sub eax, edx
xor edx, edx
mov dx, word [ecx]
xor ecx, ecx
mov cl, byte [ebx]
imul edx, ecx
mov ecx, dword [esp + 0x10]
sub eax, edx
xor edx, edx
mov dx, word [ecx]
xor ecx, ecx
mov cl, byte [edi]
imul edx, ecx
sub eax, edx
cdq
idiv dword [esp + 0x1c]
cmp eax, 0xffff
jle 0x512d0c
mov edx, dword [esp + 0x14]
mov word [edx], 0xffff
jmp 0x512d28
mov edx, dword [esp + 0x14]
xor ecx, ecx
test eax, eax
setl cl
dec ecx
and ecx, eax
mov word [edx], cx
jmp 0x512d28
mov eax, dword [esp + 0x14]
mov word [eax], 0
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x3c], eax
lea eax, [eax + ecx*2]
mov ecx, dword [esp + 0x58]
mov ebx, dword [esp + 0x4c]
mov ebp, dword [esp + 0x5c]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x34]
mov edi, dword [esp + 0x44]
mov dword [esp + 0x38], edx
lea ecx, [eax + ecx*2]
mov eax, dword [esp + 0x50]
mov dword [esp + 0x4c], eax
add eax, ebp
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x60]
add edi, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x74]
inc eax
mov dword [esp + 0x48], ebx
cmp eax, ecx
mov dword [esp + 0x44], edi
mov dword [esp + 0x24], eax
jle 0x512993
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret