Function at 0x12fb9b70
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x3e8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
xor edi, edi
mov dword [0x131c8f38], edi
call esi
mov dword [0x131c8f40], eax
mov eax, dword [esp + 0x3f8]
cmp eax, edi
jne 0x12fb9bbe
mov dword [0x131c8f38], 1
mov dword [0x131c8f3c], 0x2867
call esi
mov dword [0x131c8f40], eax
pop edi
xor eax, eax
pop esi
add esp, 0x3e8
ret
cmp dword [0x131c8f44], edi
jne 0x12fb9bec
mov dword [0x131c8f38], 2
mov dword [0x131c8f3c], 0x286d
call esi
mov dword [0x131c8f40], eax
pop edi
xor eax, eax
pop esi
add esp, 0x3e8
ret
mov esi, dword [esp + 0x3f4]
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x10]
push 1
push eax
push edi
push esi
mov dword [esp + 0x20], edi
call ebp
push edi
push edi
push edi
push esi
mov ebx, eax
call ebp
mov ecx, 0xf7
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
cmp esi, 0xffffffff
stosb byte es:[edi], al
je 0x12fb9c96
lea ecx, [esp + 0x18]
test ecx, ecx
je 0x12fb9c96
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x12fb9cb5
mov ecx, 0xf8
xor eax, eax
lea edi, [esp + 0x18]
lea edx, [esp + 0x14]
rep stosd dword es:[edi], eax
xor edi, edi
lea eax, [esp + 0x18]
push edi
push edx
push 0x3e0
push eax
push esi
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x12fb9c8f
mov dword [0x131c8f38], 0xd
mov dword [0x131c8f3c], 0x29f7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x131c8f40], eax
jmp 0x12fb9cb7
mov edi, 1
jmp 0x12fb9cb7
mov dword [0x131c8f38], 1
mov dword [0x131c8f3c], 0x29ea
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x131c8f40], eax
xor edi, edi
lea ecx, [esp + 0x10]
push 0
push ecx
push ebx
push esi
call ebp
pop ebp
pop ebx
test edi, edi
jne 0x12fb9cf2
mov dword [0x131c8f38], 0xf
mov dword [0x131c8f3c], 0x2881
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x131c8f40], eax
pop edi
xor eax, eax
pop esi
add esp, 0x3e8
ret
mov esi, dword [esp + 0x3f8]
lea edx, [esp + 0x10]
push esi
push edx
call fcn.12fb9df0
add esp, 8
test eax, eax
jne 0x12fb9d14
pop edi
pop esi
add esp, 0x3e8
ret
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x131c8f38], 0
call edi
mov dword [0x131c8f40], eax
mov eax, dword [0x131c8f44]
test eax, eax
jne 0x12fb9d53
mov dword [0x131c8f38], 2
mov dword [0x131c8f3c], 0x374b
call edi
mov dword [0x131c8f40], eax
xor esi, esi
jmp 0x12fb9dc5
mov eax, dword [0x131c94f4]
test eax, eax
je 0x12fb9d6c
mov esi, 1
pop edi
mov eax, esi
pop esi
add esp, 0x3e8
ret
mov eax, dword [esi + 0x1ec]
mov ecx, dword [esi + 0x1f4]
mov edx, dword [0x131c8f54]
cmp eax, 0x2710
ja 0x12fb9d9c
cmp edx, 0x2710
ja 0x12fb9d95
cmp edx, eax
je 0x12fb9d95
test eax, eax
jne 0x12fb9db5
mov eax, 1
jmp 0x12fb9dbf
cmp eax, edx
jne 0x12fb9db5
mov edx, dword [0x131c8f5c]
test edx, edx
ja 0x12fb9dae
test ecx, ecx
jne 0x12fb9db5
mov eax, 1
jmp 0x12fb9dbf
push ecx
push eax
call fcn.12fc04c0
add esp, 8
test eax, eax
mov esi, eax
jne 0x12fb9de0
mov dword [0x131c8f38], 0x1f
mov dword [0x131c8f3c], 0x288f
call edi
mov dword [0x131c8f40], eax
mov eax, esi
pop edi
pop esi
add esp, 0x3e8
ret