Function at 0x40f040
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42ceb8
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push ebx
push esi
push edi
mov eax, dword [0x438928]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x28], edx
xor esi, esi
push esi
push esi
push 3
push esi
push 1
push 0x80000000
push ecx
xor ebx, ebx
mov dword [ebp - 0x24], esi
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
je 0x40f2d0
cmp edi, 0xffffffff
je 0x40f2d0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x40f2d0
cmp eax, 0xffffffff
je 0x40f2d0
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x30], esi
lea ecx, [ebp - 0x11]
push ecx
push eax
push esi
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 1
push eax
lea ecx, [ebp - 0x38]
mov byte [ebp - 0x11], 0
mov dword [ebp - 0x34], esi
call fcn.004079a0
mov ebx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x34]
cmp ebx, eax
je 0x40f376
sub eax, ebx
mov dword [ebp - 0x2c], eax
cmp eax, dword [ebp - 0x1c]
jne 0x40f376
test ebx, ebx
je 0x40f2ce
push esi
lea ecx, [ebp - 0x18]
push ecx
push eax
push ebx
push edi
mov dword [ebp - 0x18], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40f37e
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x18], eax
jne 0x40f37e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
push 0x10
mov edx, 0x43a120
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x20], edi
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x19f7b
mov edx, 0x454748
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x1a1cb
mov edx, 0x43a578
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x45
mov edx, 0x43a420
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x21
mov edx, 0x43a3fc
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x35
mov edx, 0x43a3c4
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x31
mov edx, 0x43a390
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x21
mov edx, 0x43a36c
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x41
mov edx, 0x43a328
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x93
mov edx, 0x43a290
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x49
mov edx, 0x43a240
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x1d
mov edx, 0x43a21c
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x4b
mov edx, 0x43a1d0
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x17
mov edx, 0x43a1b4
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x59
mov edx, 0x43a158
call fcn.0040ef60
add esp, 4
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40f2c9
push 0x23
mov edx, 0x43a130
call fcn.0040ef60
add esp, 4
test eax, eax
jne 0x40f30b
lea ecx, [ebp - 0x38]
call fcn.004078a0
xor ebx, ebx
mov dword [ebp - 4], 0xffffffff
test edi, edi
je 0x40f2e7
cmp edi, 0xffffffff
je 0x40f2e7
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x40f2f7
cmp esi, 0xffffffff
je 0x40f2f7
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x24], eax
test esi, esi
je 0x40f37e
cmp esi, 0xffffffff
je 0x40f37e
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x2c]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40f357
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x18]
jne 0x40f357
mov dword [ebp - 0x1c], 1
jmp 0x40f35c
xor eax, eax
mov dword [ebp - 0x1c], eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
xor esi, esi
call fcn.00413c44
mov ebx, dword [ebp - 0x1c]
add esp, 4
jmp 0x40f2d0
test ebx, ebx
je 0x40f2ce
push ebx
call fcn.00413c44
add esp, 4
jmp 0x40f2ce