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

Disassembly:
sub esp, 0x2e4
mov eax, dword [0x1008a2c0]
xor eax, esp
mov dword [esp + 0x2e0], eax
mov eax, dword [esp + 0x2e8]
mov ecx, dword [esp + 0x2f0]
push ebx
mov ebx, dword [esp + 0x2fc]
add ebx, ebx
push ebp
lea ebp, [esp + 0xa8]
mov dword [esp + 0x10], eax
mov dword [esp + 8], ecx
mov dword [esp + 0xc], ebp
mov dword [esp + 0x20], ebx
cmp ebx, 0x200
jle 0x1005f179
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 + 0xc], eax
test eax, eax
jne 0x1005f177
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x2e0]
xor ecx, esp
call fcn.1007d356
add esp, 0x2e4
ret
mov ebp, eax
mov eax, dword [esp + 0x310]
mov ecx, dword [eax + 4]
mov edx, dword [eax]
movzx eax, byte [ecx]
movzx ecx, byte [ecx + 1]
push esi
push edi
movzx edi, byte [edx]
movzx edx, byte [edx + 1]
shl eax, 8
or eax, edi
shl ecx, 8
or ecx, edx
mov edx, eax
shl edx, 0x10
or eax, edx
mov edx, ecx
shl edx, 0x10
or ecx, edx
mov edx, ecx
xor edx, eax
and edx, 0xffff
xor edx, ecx
mov dword [esp + 0x50], edx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], edx
mov dword [esp + 0x60], edx
mov dword [esp + 0x7c], edx
mov dword [esp + 0x68], edx
mov dword [esp + 0x9c], edx
mov edx, ecx
xor edx, eax
and edx, 0xffff
xor edx, eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x94], eax
mov eax, dword [esp + 0x30c]
lea esi, [ebx + ebp]
mov dword [esp + 0x2c], esi
mov dword [esp + 0x70], edx
mov dword [esp + 0x44], edx
mov dword [esp + 0x78], edx
mov dword [esp + 0x64], edx
mov dword [esp + 0x80], edx
mov dword [esp + 0x84], edx
mov dword [esp + 0x88], edx
mov dword [esp + 0xa4], edx
mov dword [esp + 0x90], ecx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x98], ecx
mov dword [esp + 0x6c], ecx
mov dword [esp + 0xa0], ecx
mov dword [esp + 0x8c], ecx
mov dword [esp + 0xa8], ecx
mov dword [esp + 0xac], ecx
test eax, eax
jle 0x1005f3b3
mov dword [esp + 0x24], eax
jmp 0x1005f294
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x18]
mov ebp, eax
mov dword [esp + 0x1c], eax
test al, 7
je 0x1005f2ae
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x1c], ebp
mov eax, dword [esp + 0x314]
test eax, eax
je 0x1005f2c9
push 0
push eax
push ebx
push esi
push edi
call fcn.1005bf60
add esp, 0x14
mov edi, esi
lea eax, [ebx - 0x10]
xor edx, edx
mov esi, ebp
test eax, eax
js 0x1005f315
lea edx, [eax + 0x10]
shr edx, 4
mov dword [esp + 0x20], edx
shl edx, 4
movzx eax, byte [edi]
mov ecx, eax
sar ecx, 4
mov ebp, dword [esp + ecx*8 + 0x30]
mov ecx, dword [esp + ecx*8 + 0x34]
mov dword [esi + 4], ecx
and eax, 0xf
mov ecx, dword [esp + eax*8 + 0x30]
mov eax, dword [esp + eax*8 + 0x34]
mov dword [esi], ebp
mov dword [esi + 8], ecx
mov dword [esi + 0xc], eax
inc edi
add esi, 0x10
dec dword [esp + 0x20]
jne 0x1005f2e1
mov ebp, dword [esp + 0x1c]
cmp edx, ebx
jge 0x1005f37c
movzx eax, byte [edi]
mov ecx, eax
sar ecx, 4
mov edi, dword [esp + ecx*8 + 0x30]
mov ebp, dword [esp + ecx*8 + 0x34]
lea ecx, [ebx - 8]
cmp edx, ecx
jge 0x1005f346
mov dword [esi], edi
mov dword [esi + 4], ebp
add esi, 8
add edx, 8
and eax, 0xf
mov edi, dword [esp + eax*8 + 0x30]
mov ebp, dword [esp + eax*8 + 0x34]
sub edx, ebx
lea ecx, [edx*8 + 0x40]
or eax, 0xffffffff
or edx, 0xffffffff
call fcn.1007d480
mov ecx, eax
mov ebx, edx
not ecx
and ecx, dword [esi]
not ebx
and ebx, dword [esi + 4]
and eax, edi
and edx, ebp
mov ebp, dword [esp + 0x1c]
or ecx, eax
or ebx, edx
mov dword [esi + 4], ebx
mov ebx, dword [esp + 0x28]
mov dword [esi], ecx
mov eax, dword [esp + 0x10]
cmp ebp, eax
je 0x1005f38f
push ebx
push eax
push ebp
call fcn.100740b0
add esp, 0xc
mov edx, dword [esp + 0x2fc]
mov eax, dword [esp + 0x304]
add dword [esp + 0x18], edx
add dword [esp + 0x10], eax
dec dword [esp + 0x24]
jne 0x1005f290
mov ebp, dword [esp + 0x14]
lea ecx, [esp + 0xb0]
pop edi
pop esi
cmp ebp, ecx
je 0x1005f3c9
push ebp
call sub.MSVCR100.dll_free
add esp, 4
mov ecx, dword [esp + 0x2e8]
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.1007d356
add esp, 0x2e4
ret