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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x40
mov dword [esp + 8], edx
mov edi, ecx
mov ebp, dword [esp + 0x58]
cmp dword [ebp + 4], 0x1a
setae byte [esp + 7]
mov eax, dword [ecx]
mov ebx, dword [ecx + 4]
sub ebx, eax
mov esi, ebx
sar esi, 3
mov edx, dword [ecx + 8]
mov ecx, dword [ecx + 0xc]
mov dword [esp + 0x18], edx
sub ecx, edx
mov edx, dword [ebp + 0x1c]
mov dword [esp], edx
mov edx, dword [edi + 0x18]
mov dword [esp + 0x20], edx
mov edx, dword [edi + 0x10]
mov dword [esp + 0x1c], edx
mov edx, dword [edi + 0x14]
mov dword [esp + 0x14], ebx
test ebx, ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], edx
je 0x581059
mov eax, ecx
xor edx, edx
div esi
xor edx, edx
cmp eax, 0x14
setae dl
jmp 0x58105e
mov edx, 1
mov eax, dword [esp + 0x68]
add eax, 0xd4
mov dword [esp + 0x10], eax
mov ebp, dword [ebp + 0x40]
mov eax, 0
cmp ebp, 1
je 0x58109c
cmp ebp, 2
jne 0x581084
mov eax, 1
jmp 0x58109c
mov eax, 0
cmp dword [esp], 1
jne 0x58109c
xor eax, eax
mov ebp, dword [esp + 0x58]
cmp dword [ebp + 0x18], 0
setne al
mov dword [esp + 0xc], esi
mov ebx, dword [esp + 0x64]
push edx
push dword [esp + 0x70]
push 0x2204
push dword [esp + 0x1c]
push ecx
push dword [esp + 0x2c]
mov esi, dword [esp + 0x78]
push esi
mov ecx, dword [esp + 0x78]
push ecx
push eax
push dword [esp + 0x24]
push dword [esp + 0x7c]
push dword [esp + 0x34]
call fcn.00561c30
add esp, 0x30
cmp eax, 0xffffff89
mov ecx, 0
cmovb ecx, eax
mov edx, dword [esp + 0x58]
jae 0x581293
mov ebx, dword [esp + 0x5c]
lea ebp, [ebx + esi]
add ecx, ebx
mov eax, ebp
sub eax, ecx
cmp eax, 4
jge 0x581110
xor eax, eax
cmp dword [esp + 0x64], esi
mov ecx, 0xffffffba
cmovbe ecx, eax
jmp 0x5812cf
mov esi, dword [esp + 0x14]
cmp esi, 0x3ff
mov dword [esp + 0x18], ebp
ja 0x58112b
mov eax, dword [esp + 0xc]
mov byte [ecx], al
add ecx, 1
jmp 0x58115b
cmp esi, 0x3f7ff
ja 0x581148
mov ebp, ecx
mov ecx, dword [esp + 0xc]
mov al, ch
xor al, 0x80
mov byte [ebp], al
mov byte [ebp + 1], cl
add ebp, 2
jmp 0x58115d
mov byte [ecx], 0xff
mov eax, dword [esp + 0xc]
add eax, 0xffff8100
mov word [ecx + 1], ax
add ecx, 3
mov ebp, ecx
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 8]
add eax, 0x408
test esi, esi
je 0x58125c
mov dword [esp + 0x14], ebp
add ebp, 1
add ecx, 0x408
mov esi, ecx
lea ecx, [esp + 0x2c]
mov edx, edi
push 0x2204
push dword [esp + 0x14]
push dword [esp + 0x70]
push dword [esp + 0xc]
mov ebx, dword [esp + 0x28]
push ebx
mov dword [esp + 0x14], ebp
push ebp
mov dword [esp + 0x20], eax
push eax
push esi
mov esi, dword [esp + 0x2c]
push esi
call fcn.0057e880
add esp, 0x24
mov eax, dword [esp + 0x38]
cmp eax, 0xffffff89
jae 0x581287
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x30]
shl ecx, 6
shl edx, 4
add edx, ecx
mov ecx, dword [esp + 0x34]
lea ecx, [edx + ecx*4]
mov edx, dword [esp + 0x14]
mov byte [edx], cl
xor edx, edx
mov cl, byte [esp + 7]
mov dl, cl
mov edi, dword [esp + 0x54]
lea ecx, [edi + 0xcb8]
mov dword [esp + 0x10], ecx
add edi, 0x70c
mov ebp, dword [esp]
add ebp, eax
mov ecx, esi
mov esi, dword [esp + 0x60]
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
sub ebx, ebp
sub esp, 4
push edx
push ecx
push dword [esp + 0x34]
push dword [esp + 0x2c]
push dword [esp + 0x24]
push dword [esp + 0x38]
push dword [esp + 0x24]
push dword [esp + 0x44]
push edi
push ebx
push ebp
call fcn.00563e80
add esp, 0x30
cmp eax, 0xffffff88
mov ebx, dword [esp + 0x64]
mov edx, dword [esp + 0x58]
ja 0x581293
mov esi, dword [esp]
test esi, esi
je 0x581254
add esi, eax
xor ecx, ecx
cmp esi, 4
jb 0x5812cf
add ebp, eax
mov ebx, dword [esp + 0x5c]
jmp 0x581275
add ecx, 0x408
push 0xde0
push ecx
push eax
mov esi, edx
call sub.msvcrt.dll_memcpy
mov edx, esi
add esp, 0xc
sub ebp, ebx
mov eax, ebp
mov esi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
jne 0x581293
xor ecx, ecx
jmp 0x5812cf
mov esi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
mov edx, dword [esp + 0x58]
cmp ebx, esi
ja 0x58129e
xor ecx, ecx
cmp eax, 0xffffffba
je 0x5812cf
cmp eax, 0xffffff88
ja 0x5812cd
mov ecx, dword [edx + 0x1c]
mov edx, ecx
add dl, 0xff
cmp ecx, 8
movzx edx, dl
mov ecx, 6
cmovae ecx, edx
mov edx, ebx
shr edx, cl
neg edx
add edx, ebx
add edx, 0xfffffffe
xor ecx, ecx
cmp eax, edx
cmovb ecx, eax
jmp 0x5812cf
mov ecx, eax
mov eax, ecx
add esp, 0x40
pop esi
pop edi
pop ebx
pop ebp
ret