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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x581993
sub esp, 0x5c
mov eax, dword [esp + 0x64]
cmp eax, 2
jl 0x58190f
nop
mov ecx, dword [esp + 0x60]
movzx edx, byte [ecx + 1]
movzx ebx, byte [ecx]
shl ebx, 8
or edx, ebx
cmp dx, 1
je 0x5817fe
cmp dx, 2
je 0x58178e
cmp dx, 3
jne 0x581722
mov dword [esp], ecx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 8], eax
call fcn.00581c00
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x28], eax
movzx ecx, word [esp + 0xc]
movzx edx, word [esp + 0xe]
movzx ebx, word [esp + 0x10]
mov ebp, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x20]
mov dword [esp + 0x30], edi
mov eax, dword [esp + 0x24]
mov dword [esp + 0x40], eax
mov word [esp + 0x4c], cx
mov word [esp + 0x4e], dx
mov word [esp + 0x50], bx
mov dword [esp + 0x54], ebp
mov dword [esp + 0x58], esi
lea ecx, [0x6ca880]
mov dword [esp], ecx
lea ecx, [esp + 0x4c]
mov dword [esp + 4], ecx
call fcn.004095e0
mov eax, dword [esp + 8]
mov edi, dword [esp + 0x30]
lea ecx, [0x785aac]
mov edx, eax
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x40]
jmp 0x58186c
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov word [esp], dx
call fcn.004096b0
mov eax, dword [esp + 4]
lea ecx, [0x69bdc0]
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], eax
lea eax, [0x6fcd2f]
mov dword [esp], eax
mov dword [esp + 4], 0x20
lea eax, [esp + 0x44]
mov dword [esp + 8], eax
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], 1
call fcn.004cde70
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
xor ecx, ecx
xor edx, edx
xor ebx, ebx
jmp 0x58186c
mov dword [esp], ecx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 8], eax
call fcn.00581ad0
mov eax, dword [esp + 0x10]
mov dword [esp + 0x28], eax
movzx ecx, word [esp + 0xc]
movzx edx, word [esp + 0xe]
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x30], ebx
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x40], ebp
mov word [esp + 0x38], cx
mov word [esp + 0x3a], dx
lea ecx, [0x6c1060]
mov dword [esp], ecx
lea ecx, [esp + 0x38]
mov dword [esp + 4], ecx
call fcn.00409640
mov eax, dword [esp + 8]
mov edi, dword [esp + 0x30]
lea ecx, [0x785a98]
mov edx, eax
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x40]
jmp 0x58186c
mov dword [esp], ecx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 8], eax
call fcn.005819a0
mov eax, dword [esp + 0x10]
mov dword [esp + 0x28], eax
movzx ecx, word [esp + 0xc]
movzx edx, word [esp + 0xe]
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x30], ebx
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x40], ebp
mov word [esp + 0x34], cx
mov word [esp + 0x36], dx
lea ecx, [0x6c0fe0]
mov dword [esp], ecx
lea ecx, [esp + 0x34]
mov dword [esp + 4], ecx
call fcn.00409640
mov eax, dword [esp + 8]
mov edi, dword [esp + 0x30]
lea ecx, [0x785a84]
mov edx, eax
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x40]
test edi, edi
je 0x5818ef
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
je 0x58188d
mov edi, dword [edi + 4]
mov dword [esp + 0x44], edi
mov dword [esp + 0x48], eax
lea eax, [0x6f777d]
mov dword [esp], eax
mov dword [esp + 4], 0x16
lea eax, [esp + 0x44]
mov dword [esp + 8], eax
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], 1
call fcn.004cde70
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x6c], edx
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x70], edx
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add esp, 0x5c
ret
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x70], edx
mov dword [esp + 0x74], ebx
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
add esp, 0x5c
ret
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp], eax
call fcn.00409720
mov eax, dword [esp + 4]
lea ecx, [0x69b600]
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], eax
lea eax, [0x702c45]
mov dword [esp], eax
mov dword [esp + 4], 0x33
lea eax, [esp + 0x44]
mov dword [esp + 8], eax
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], 1
call fcn.004cde70
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
add esp, 0x5c
ret
call fcn.004649b0
jmp fcn.00581640