Function at 0x40b1d0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x84
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 8]
test eax, eax
je 0x40b1e8
call fcn.0040b090
mov edi, dword [esp + 0x9c]
or ecx, 0xffffffff
xor eax, eax
lea ebx, [ebp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + ebp + 0x13], 0x5c
je 0x40b252
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, 0x5980b0
lea edx, [ecx + ebp + 0x14]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0xa0]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0x118]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + ebp + 0x117], 0x5c
je 0x40b2c5
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, 0x5980b0
lea edx, [ecx + ebp + 0x118]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0xa4]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0x21c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + ebp + 0x21b], 0x5c
je 0x40b33e
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, 0x5980b0
lea esi, [ecx + ebp + 0x21c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x10], esi
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x10]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
push str.XpkFileTable.bin
repne scasb al, byte es:[edi]
not ecx
lea esi, [ebp + 0x351]
push edx
dec ecx
push str._s_s
push esi
mov dword [ebp + 0x320], ecx
call fcn.005753d0
add esp, 0x10
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40b3a6
push esi
push 9
mov ecx, 0x5aac10
call fcn.00404440
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x84
ret 0x10
lea eax, [ebp + 0x55c]
push 0
lea esi, [ebp + 4]
push eax
push 4
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esi]
shl ecx, 5
push ecx
call fcn.005756f6
mov ecx, dword [esi]
mov edi, eax
shl ecx, 5
mov edx, ecx
xor eax, eax
shr ecx, 2
mov dword [ebp + 8], edi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x9c]
mov dword [ebp + 0x10], eax
shl eax, 5
push eax
call fcn.005756f6
mov ecx, dword [ebp + 0x10]
mov edi, eax
shl ecx, 5
mov edx, ecx
xor eax, eax
shr ecx, 2
mov dword [ebp + 0xc], edi
add esp, 8
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esi]
xor edi, edi
test eax, eax
jbe 0x40b44c
lea eax, [ebp + 0x55c]
push 0
push eax
lea eax, [esp + 0x1c]
push 0x80
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x14]
push ecx
push edi
mov ecx, ebp
call fcn.0040b4b0
test al, al
je 0x40b491
mov eax, dword [esi]
inc edi
cmp edi, eax
jb 0x40b41a
lea esi, [ebp + 0x33c]
mov edi, 2
push 0xa0000
call fcn.005756f6
mov dword [esi + 4], eax
mov dword [esi], 0xa0000
mov byte [esi - 4], 0
add esp, 4
add esi, 0xc
dec edi
jne 0x40b457
test ebx, ebx
je 0x40b482
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x84
ret 0x10
test ebx, ebx
je 0x40b49c
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x84
ret 0x10