Function at 0x12fb46b0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x76c
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
xor ebx, ebx
push edi
mov dword [0x131c8f38], ebx
call ebp
mov dword [0x131c8f40], eax
mov eax, dword [esp + 0x784]
cmp eax, ebx
jne 0x12fb4702
mov dword [0x131c8f38], 1
mov dword [0x131c8f3c], 0x1d1e
call ebp
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
cmp dword [0x131c8f44], ebx
jne 0x12fb4732
mov dword [0x131c8f38], 2
mov dword [0x131c8f3c], 0x1d24
call ebp
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov esi, dword [esp + 0x780]
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, 0xf7
xor eax, eax
lea edi, [esp + 0x15]
mov byte [esp + 0x14], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
cmp esi, 0xffffffff
stosb byte es:[edi], al
je 0x12fb47b2
lea eax, [esp + 0x14]
test eax, eax
je 0x12fb47b2
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x12fb47cd
mov ecx, 0xf8
xor eax, eax
lea edi, [esp + 0x14]
push ebx
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x14]
lea edx, [esp + 0x18]
push ecx
push 0x3e0
push edx
push esi
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x12fb47f5
mov dword [0x131c8f38], 0xd
mov dword [0x131c8f3c], 0x29f7
jmp 0x12fb47c6
mov dword [0x131c8f38], 1
mov dword [0x131c8f3c], 0x29ea
call ebp
mov dword [0x131c8f40], eax
mov dword [0x131c8f38], 0xf
mov dword [0x131c8f3c], 0x1d2f
call ebp
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x784]
not esi
shr esi, 5
push eax
and esi, 1
call fcn.12fc2120
add esp, 4
cmp esi, ebx
mov ebp, eax
je 0x12fb481f
cmp ebp, ebx
jne 0x12fb4c04
mov ecx, 0xe1
xor eax, eax
lea edi, [esp + 0x3f5]
mov byte [esp + 0x3f4], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x3f4]
lea edx, [esp + 0x14]
push ecx
push edx
stosb byte es:[edi], al
call fcn.12fb9df0
add esp, 8
test eax, eax
jne 0x12fb487e
mov dword [0x131c8f38], 0x14
mov dword [0x131c8f3c], 0x1d3f
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x131c8f38], ebx
call edi
mov dword [0x131c8f40], eax
lea eax, [esp + 0x3f4]
test eax, eax
jne 0x12fb48bc
mov dword [0x131c8f38], 1
mov dword [0x131c8f3c], 0x3745
call edi
mov dword [0x131c8f40], eax
jmp 0x12fb4a02
cmp dword [0x131c8f44], ebx
jne 0x12fb48e4
mov dword [0x131c8f38], 2
mov dword [0x131c8f3c], 0x374b
call edi
mov dword [0x131c8f40], eax
jmp 0x12fb4a02
cmp dword [0x131c94f4], ebx
jne 0x12fb491f
mov eax, dword [esp + 0x5e0]
mov edx, dword [esp + 0x5e8]
mov ecx, dword [0x131c8f54]
cmp eax, 0x2710
ja 0x12fb49d8
cmp ecx, 0x2710
ja 0x12fb491f
cmp ecx, eax
je 0x12fb491f
cmp eax, ebx
jne 0x12fb49f0
cmp esi, ebx
jne 0x12fb4a3c
cmp ebp, ebx
jne 0x12fb4a3c
mov ecx, dword [esp + 0x774]
push ecx
call fcn.12f5bf8b
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x12fb4a3c
mov eax, dword [esp + 0x774]
mov edi, dword [esp + 0x780]
lea edx, [esp + 0x10]
lea ecx, [esp + 0x14]
push edx
push eax
push esi
lea edx, [esp + 0x400]
push ecx
push edx
push edi
mov dword [esp + 0x28], ebx
call fcn.12fb4260
add esp, 0x18
test eax, eax
je 0x12fb4a2a
mov ecx, dword [esp + 0x10]
cmp ecx, 0x78
jb 0x12fb4a2a
mov eax, dword [esi + 0x70]
mov edx, dword [esi + 0x6c]
add eax, edx
mov edx, dword [esi + 0x74]
lea eax, [eax + eax*4]
lea eax, [edx + eax*2]
lea edx, [eax + eax + 0x7a]
cmp edx, ecx
jne 0x12fb4a2a
mov ebp, dword [esp + 0x784]
push esi
push ebp
call fcn.12fc21a0
add esp, 8
test eax, eax
je 0x12fb4a31
push esi
call fcn.12f5bf80
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x76c
ret
cmp eax, ecx
jne 0x12fb49f0
cmp dword [0x131c8f5c], ebx
ja 0x12fb491f
cmp edx, ebx
je 0x12fb491f
push edx
push eax
call fcn.12fc04c0
add esp, 8
cmp eax, ebx
jne 0x12fb491f
mov dword [0x131c8f38], 0x1f
mov dword [0x131c8f3c], 0x1d46
call edi
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov ebp, dword [esp + 0x784]
push esi
call fcn.12f5bf80
add esp, 4
jmp 0x12fb4a4a
mov ebp, dword [esp + 0x784]
mov edi, dword [esp + 0x780]
mov eax, dword [esp + 0x430]
cmp eax, ebx
jne 0x12fb4a69
mov dword [esp + 0x76c], 0x3e0
mov dword [esp + 0x770], ebx
jmp 0x12fb4a9c
mov ecx, dword [esp + 0x434]
push ebx
dec eax
push ecx
push ebx
push eax
call fcn.12f618d0
mov ecx, dword [esp + 0x438]
xor esi, esi
add eax, ecx
adc edx, esi
add eax, 0x3e0
adc edx, ebx
mov dword [esp + 0x76c], eax
mov dword [esp + 0x770], edx
mov eax, dword [esp + 0x34]
lea edx, [esp + 0x3f4]
push ebp
push edx
push eax
push edi
call fcn.12fb4c20
add esp, 0x10
test eax, eax
jne 0x12fb4ae3
mov dword [0x131c8f38], 0x10
mov dword [0x131c8f3c], 0x1d74
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
push ebp
call fcn.12fc2120
add esp, 4
test eax, eax
mov eax, dword [esp + 0x38]
je 0x12fb4af8
and al, 0xdf
jmp 0x12fb4afa
or al, 0x20
mov dword [esp + 0x38], eax
or al, 4
push ebp
mov dword [esp + 0x3c], eax
call fcn.12fedc70
add esp, 4
test eax, eax
mov eax, dword [esp + 0x38]
jne 0x12fb4b19
or al, 1
jmp 0x12fb4b1b
and al, 0xfe
add ebp, 0x10
mov dword [esp + 0x38], eax
push ebp
call fcn.12fedc70
add esp, 4
test eax, eax
mov eax, dword [esp + 0x38]
jne 0x12fb4b37
or al, 2
jmp 0x12fb4b39
and al, 0xfd
lea ecx, [esp + 0x3f4]
lea edx, [esp + 0x14]
push ecx
push edx
mov dword [esp + 0x40], eax
call fcn.12fba060
add esp, 8
test eax, eax
jne 0x12fb4b82
mov dword [0x131c8f38], 0x13
mov dword [0x131c8f3c], 0x1d8c
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x10]
push ebx
push eax
lea ecx, [esp + 0x1c]
push 0x3e0
push ecx
push edi
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x12fb4bf4
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x131c8f38], 0xe
mov dword [0x131c8f3c], 0x2a09
call esi
mov dword [0x131c8f40], eax
mov dword [0x131c8f38], 0x10
mov dword [0x131c8f3c], 0x1d94
call esi
pop edi
pop esi
mov dword [0x131c8f40], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
cmp dword [esp + 0x788], ebx
je 0x12fb4c04
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x76c
ret