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

Disassembly:
sub esp, 0x16c
push ebx
mov ebx, ecx
mov eax, dword [ebx + 0x10]
mov dword [ebx + 0x30], 0
mov ecx, dword [0x809e74]
push eax
push ecx
lea ecx, [esp + 0x10]
call fcn.005e3ce0
mov ecx, dword [esp + 8]
push 0
mov edx, dword [ecx]
call dword [edx + 0x14]
test al, al
je 0x582370
mov ecx, dword [esp + 8]
push 1
mov eax, dword [ecx]
call dword [eax + 0x1c]
mov ecx, dword [esp + 8]
mov edx, dword [ecx]
call dword [edx + 0x3c]
mov ecx, dword [esp + 8]
mov dword [ebx + 0x30], eax
lea edx, [esp + 0x18]
push 4
mov eax, dword [ecx]
push edx
call dword [eax + 0x24]
mov eax, dword [str.THU4]
mov ecx, dword [esp + 0x18]
cmp cl, byte [eax]
jne 0x582367
cmp ch, byte [eax + 1]
jne 0x582367
mov cl, byte [esp + 0x1a]
mov dl, byte [eax + 2]
cmp cl, dl
jne 0x582367
mov dl, byte [esp + 0x1b]
mov cl, byte [eax + 3]
cmp dl, cl
jne 0x582367
mov ecx, dword [esp + 8]
lea edx, [esp + 0x1c]
push 4
push edx
mov eax, dword [ecx]
call dword [eax + 0x24]
mov ecx, dword [esp + 8]
lea edx, [esp + 0x4c]
push 4
push edx
mov eax, dword [ecx]
call dword [eax + 0x24]
mov ecx, dword [esp + 8]
lea edx, [esp + 0x24]
push 4
push edx
mov eax, dword [ecx]
call dword [eax + 0x24]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x582367
mov eax, dword [esp + 0x24]
push eax
call fcn.00672b70
mov dword [ebx + 0x28], eax
mov eax, dword [esp + 0x20]
add esp, 4
mov dword [esp + 0x30], 0
test eax, eax
jle 0x582355
push ebp
push esi
push edi
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x2c]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x78]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x68]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x50]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x44]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x74]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x6c]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x70]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x40]
push 4
push eax
mov edx, dword [ecx]
call dword [edx + 0x24]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x14]
push eax
lea eax, [esp + 0x80]
mov edx, dword [ecx]
push eax
call dword [edx + 0x24]
mov ecx, dword [esp + 0x40]
mov al, byte [ebx + 0xd]
test al, al
mov byte [esp + ecx + 0x7c], 0
mov byte [esp + 0x13], 1
je 0x5821cb
mov eax, dword [0x809e74]
lea edx, [esp + 0x7c]
push edx
push eax
lea ecx, [esp + 0x3c]
call fcn.005e3ce0
mov ecx, dword [esp + 0x34]
push 0
mov edx, dword [ecx]
call dword [edx + 0x14]
test al, al
je 0x5821b1
mov ecx, dword [esp + 0x34]
push 1
mov eax, dword [ecx]
call dword [eax + 0x1c]
mov ecx, dword [esp + 0x34]
mov edx, dword [ecx]
call dword [edx + 0x3c]
cmp eax, dword [esp + 0x2c]
je 0x5821a6
mov byte [esp + 0x13], 0
mov ecx, dword [esp + 0x34]
mov eax, dword [ecx]
call dword [eax + 0x38]
jmp 0x5821b6
mov byte [esp + 0x13], 0
lea ecx, [esp + 0x34]
call fcn.005e3d30
mov al, byte [esp + 0x13]
test al, al
je 0x58233d
push 0x2c
call fcn.00672b70
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x58233d
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x70]
mov edi, dword [esp + 0x58]
mov esi, dword [esp + 0x78]
mov dword [esp + 0x64], ecx
mov ecx, dword [esp + 0x74]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x50]
mov dword [esp + 0x4c], ecx
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x60], eax
mov eax, dword [ebx + 0x28]
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 0x44]
mov dword [esp + 0x1c], ecx
sub eax, edi
mov dword [esp + 0x48], edx
mov edx, dword [0x809d38]
lea ecx, [esp + 0x7c]
add eax, esi
mov dword [ebp], edx
test ecx, ecx
mov dword [esp + 0x20], eax
je 0x58229d
lea edi, [esp + 0x7c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
jle 0x582257
inc ecx
push eax
push ecx
mov ecx, ebp
call fcn.005dcfa0
lea edi, [esp + 0x7c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
mov ecx, ebp
lea edi, [esi + 1]
push edi
call fcn.005dd330
mov eax, dword [ebp]
mov ecx, dword [0x809d38]
cmp eax, ecx
je 0x582282
mov dword [eax - 4], esi
mov ecx, edi
mov edi, dword [ebp]
mov edx, ecx
lea esi, [esp + 0x7c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x20]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x48]
mov dword [ebp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [ebp + 8], eax
mov eax, dword [esp + 0x4c]
mov dword [ebp + 0xc], ecx
mov ecx, dword [esp + 0x54]
mov dword [ebp + 0x10], edx
mov edx, dword [esp + 0x5c]
mov dword [ebp + 0x14], eax
mov eax, dword [esp + 0x64]
mov dword [ebp + 0x18], ecx
mov dword [ebp + 0x1c], edx
mov dword [ebp + 0x20], eax
mov byte [ebp + 0x24], 0
mov dword [ebp + 0x28], ebx
mov byte [ebx + 0x2c], 1
mov ecx, dword [0x809d38]
push 1
mov dword [esp + 0x20], ecx
push 0
lea ecx, [esp + 0x24]
mov dword [esp + 0x28], ebp
call fcn.005dcfa0
mov edx, dword [esp + 0x1c]
mov al, byte [0x83ec0c]
mov byte [edx], al
mov ecx, dword [esp + 0x20]
push ecx
lea ecx, [esp + 0x20]
call fcn.0041f5a0
lea ecx, [esp + 0x1c]
call fcn.004027b0
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x1c]
mov byte [eax + edx - 4], 0
lea eax, [esp + 0x20]
push eax
push ecx
lea ecx, [ebx + 0x18]
call fcn.00583870
lea ecx, [esp + 0x1c]
call fcn.005dd410
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x28]
inc eax
cmp eax, ecx
mov dword [esp + 0x3c], eax
jl 0x5820a9
pop edi
pop esi
pop ebp
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 8]
push eax
mov eax, dword [ebx + 0x28]
mov edx, dword [ecx]
push eax
call dword [edx + 0x24]
mov ecx, dword [esp + 8]
mov edx, dword [ecx]
call dword [edx + 0x38]
lea ecx, [esp + 8]
mov byte [ebx + 0x2c], 0
call fcn.005e3d30
pop ebx
add esp, 0x16c
ret