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

Disassembly:
sub esp, 0x368
mov eax, dword [0x1008a2c0]
xor eax, esp
mov dword [esp + 0x364], eax
mov eax, dword [esp + 0x36c]
mov ecx, dword [esp + 0x374]
push ebx
mov ebx, dword [esp + 0x380]
add ebx, ebx
add ebx, ebx
lea edx, [esp + 0x128]
mov dword [esp + 0xc], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
mov dword [esp + 0x14], ebx
cmp ebx, 0x200
jle 0x1005f927
lea eax, [ebx + 7]
cdq
and edx, 7
add eax, edx
sar eax, 3
add eax, ebx
push eax
call sub.MSVCR100.dll_malloc
add esp, 4
mov dword [esp + 8], eax
test eax, eax
jne 0x1005f927
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x364]
xor ecx, esp
call fcn.1007d356
add esp, 0x368
ret
mov eax, dword [esp + 8]
lea ecx, [ebx + eax]
mov eax, dword [esp + 0x390]
mov edx, dword [eax + 8]
push ebp
movzx ebp, byte [edx]
movzx edx, byte [edx + 1]
mov dword [esp + 0x1c], ecx
mov ecx, dword [eax + 0xc]
push esi
mov esi, dword [eax + 4]
push edi
mov edi, dword [eax]
movzx eax, byte [ecx]
movzx ecx, byte [ecx + 1]
shl eax, 8
or eax, ebp
movzx ebp, byte [esi]
shl ecx, 8
or ecx, edx
movzx edx, byte [esi + 1]
shl eax, 8
or eax, ebp
movzx ebp, byte [edi]
shl ecx, 8
or ecx, edx
movzx edx, byte [edi + 1]
shl eax, 8
or eax, ebp
shl ecx, 8
or ecx, edx
mov dword [esp + 0xb4], eax
mov dword [esp + 0xb8], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0xbc], eax
mov dword [esp + 0xc0], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0xc4], eax
mov dword [esp + 0xc8], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0xcc], eax
mov dword [esp + 0xd0], eax
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x50], ecx
mov dword [esp + 0xd4], eax
mov dword [esp + 0xd8], ecx
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0xdc], eax
mov dword [esp + 0xe0], ecx
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], ecx
mov dword [esp + 0xe4], eax
mov dword [esp + 0xe8], ecx
mov dword [esp + 0x64], ecx
mov dword [esp + 0x68], eax
mov dword [esp + 0xec], eax
mov dword [esp + 0xf0], ecx
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x70], ecx
mov dword [esp + 0xf4], ecx
mov dword [esp + 0xf8], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0xfc], ecx
mov dword [esp + 0x100], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], ecx
mov dword [esp + 0x104], ecx
mov dword [esp + 0x108], eax
mov dword [esp + 0x84], ecx
mov dword [esp + 0x88], eax
mov dword [esp + 0x10c], ecx
mov dword [esp + 0x110], eax
mov dword [esp + 0x8c], ecx
mov dword [esp + 0x90], ecx
mov dword [esp + 0x114], ecx
mov dword [esp + 0x118], ecx
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], eax
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa8], eax
mov eax, dword [esp + 0x390]
mov dword [esp + 0x11c], ecx
mov dword [esp + 0x120], ecx
mov dword [esp + 0xa0], ecx
mov dword [esp + 0x124], ecx
mov dword [esp + 0x128], ecx
mov dword [esp + 0xa4], ecx
mov dword [esp + 0x12c], ecx
mov dword [esp + 0x130], ecx
mov dword [esp + 0xac], ecx
mov dword [esp + 0xb0], ecx
test eax, eax
jle 0x1005fc94
mov dword [esp + 0x28], eax
jmp 0x1005fb20
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x24]
mov dword [esp + 0x1c], eax
test al, 7
je 0x1005fb3c
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x398]
test eax, eax
je 0x1005fb57
push 0
push eax
push ebx
push edi
push esi
call fcn.1005bf60
add esp, 0x14
mov esi, edi
mov eax, dword [esp + 0x1c]
lea ebp, [ebx - 0x20]
xor edi, edi
test ebp, ebp
js 0x1005fbd5
add ebp, 0x20
shr ebp, 5
mov edi, ebp
shl edi, 5
nop
movzx edx, byte [esi]
mov ecx, edx
sar ecx, 4
add ecx, ecx
add ecx, ecx
add ecx, ecx
mov ebx, dword [esp + ecx + 0xb4]
mov dword [eax], ebx
mov ebx, dword [esp + ecx + 0xb8]
mov dword [eax + 4], ebx
mov ebx, dword [esp + ecx + 0x34]
mov ecx, dword [esp + ecx + 0x38]
and edx, 0xf
add edx, edx
mov dword [eax + 0xc], ecx
add edx, edx
add edx, edx
mov ecx, dword [esp + edx + 0xb4]
mov dword [eax + 8], ebx
mov dword [eax + 0x10], ecx
mov ecx, dword [esp + edx + 0xb8]
mov dword [eax + 0x14], ecx
mov ecx, dword [esp + edx + 0x34]
mov edx, dword [esp + edx + 0x38]
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], edx
inc esi
add eax, 0x20
dec ebp
jne 0x1005fb70
mov ebx, dword [esp + 0x20]
cmp edi, ebx
jge 0x1005fc5d
movzx esi, byte [esi]
mov ecx, esi
sar ecx, 4
add ecx, ecx
add ecx, ecx
add ecx, ecx
mov edx, dword [esp + ecx + 0xb4]
mov ebp, dword [esp + ecx + 0xb8]
add ebx, 0xfffffff8
cmp edi, ebx
jg 0x1005fc53
mov dword [eax], edx
mov edx, dword [esp + ecx + 0x34]
mov dword [eax + 4], ebp
mov ebp, dword [esp + ecx + 0x38]
add edi, 8
add eax, 8
cmp edi, ebx
jg 0x1005fc53
mov dword [eax], edx
mov dword [eax + 4], ebp
mov ecx, esi
and ecx, 0xf
mov edx, dword [esp + ecx*8 + 0xb4]
mov ebp, dword [esp + ecx*8 + 0xb8]
add edi, 8
add eax, 8
cmp edi, ebx
jg 0x1005fc53
mov dword [eax], edx
mov dword [eax + 4], ebp
add eax, 8
add edi, 8
and esi, 0xf
mov ecx, dword [esp + esi*8 + 0x38]
mov edx, dword [esp + esi*8 + 0x34]
mov dword [esp + 0x30], ecx
mov ebx, dword [esp + 0x20]
cmp edi, ebx
jge 0x1005fc5d
mov dword [eax], edx
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x10]
cmp eax, ecx
je 0x1005fc74
push ebx
push ecx
push eax
call fcn.100740b0
add esp, 0xc
mov edx, dword [esp + 0x380]
mov eax, dword [esp + 0x388]
add dword [esp + 0x18], edx
add dword [esp + 0x10], eax
dec dword [esp + 0x28]
jne 0x1005fb20
mov eax, dword [esp + 0x14]
pop edi
lea ecx, [esp + 0x130]
pop esi
pop ebp
cmp eax, ecx
je 0x1005fcaf
push eax
call sub.MSVCR100.dll_free
add esp, 4
mov ecx, dword [esp + 0x368]
pop ebx
xor ecx, esp
xor eax, eax
call fcn.1007d356
add esp, 0x368
ret