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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x471000
mov eax, dword fs:[0]
push eax
sub esp, 0x98
mov eax, dword [0x49f074]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x84], ecx
cmp dword [ebp + 8], 0
je 0x41587d
cmp dword [ebp + 0xc], 0xffffffff
jne 0x415884
xor al, al
jmp 0x415c8b
push 0x2000
push 0
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x84]
call fcn.004160f0
mov dword [ebp - 0x8c], eax
cmp dword [ebp - 0x8c], 0x2000
jae 0x4158b3
xor al, al
jmp 0x415c8b
mov dword [ebp - 0x2c], 0
xor ecx, ecx
mov dword [ebp - 0x28], ecx
lea edx, [ebp - 0x2c]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSizeEx]
test eax, eax
jne 0x4158d8
xor al, al
jmp 0x415c8b
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x14], 0
push 0
mov ecx, dword [ebp - 0x8c]
push ecx
lea ecx, [ebp - 0x60]
call fcn.00416310
push 0
push 0x1000000
lea ecx, [ebp - 0x78]
call fcn.00416310
mov dword [ebp - 0x1c], 0
xor edx, edx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x24], 0
xor eax, eax
mov dword [ebp - 0x20], eax
xorps xmm0, xmm0
movlpd qword [ebp - 0x94], xmm0
jmp 0x41594c
mov ecx, dword [ebp - 0x94]
add ecx, 0x1000000
mov edx, dword [ebp - 0x90]
adc edx, 0
mov dword [ebp - 0x94], ecx
mov dword [ebp - 0x90], edx
mov eax, dword [ebp - 0x90]
cmp eax, dword [ebp - 0x28]
jg 0x415b19
jl 0x41596c
mov ecx, dword [ebp - 0x94]
cmp ecx, dword [ebp - 0x2c]
jae 0x415b19
xorps xmm0, xmm0
movlpd qword [ebp - 0x1c], xmm0
push 1
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x4159ac
mov byte [ebp - 0x79], 0
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x79]
jmp 0x415c8b
push 0
lea eax, [ebp - 0x30]
push eax
push 0x1000000
push 0
lea ecx, [ebp - 0x78]
call fcn.004134c0
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
jne 0x4159ec
mov byte [ebp - 0x7a], 0
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x7a]
jmp 0x415c8b
push 0
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x415a24
mov byte [ebp - 0x7b], 0
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x7b]
jmp 0x415c8b
mov dword [ebp - 0x88], 0
jmp 0x415a41
mov eax, dword [ebp - 0x88]
add eax, 0x2000
mov dword [ebp - 0x88], eax
mov ecx, dword [ebp - 0x88]
cmp ecx, dword [ebp - 0x30]
jae 0x415b0c
lfence
push 0x2000
lea ecx, [ebp - 0x78]
call fcn.00407e90
add eax, dword [ebp - 0x88]
push eax
push 0
lea ecx, [ebp - 0x60]
call fcn.004134c0
push eax
call fcn.00450cf0
add esp, 0xc
mov edx, dword [ebp - 0x8c]
push edx
push 0x2000
lea eax, [ebp - 0x60]
push eax
call fcn.00401650
add esp, 4
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
mov ecx, dword [ebp - 0x84]
call fcn.004161a0
movzx edx, al
test edx, edx
jne 0x415ac7
mov byte [ebp - 0x7c], 0
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x7c]
jmp 0x415c8b
push 0
lea eax, [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x8c]
push ecx
lea ecx, [ebp - 0x60]
call fcn.00407e90
push eax
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
jne 0x415b07
mov byte [ebp - 0x7d], 0
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x7d]
jmp 0x415c8b
jmp 0x415a30
cmp dword [ebp + 0x10], 1
jne 0x415b14
jmp 0x415b19
jmp 0x41592b
mov dword [ebp - 0x9c], 0
xor eax, eax
mov dword [ebp - 0x98], eax
mov ecx, dword [ebp - 0x9c]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x98]
mov dword [ebp - 0x18], edx
mov dword [ebp - 0xa4], 0
xor eax, eax
mov dword [ebp - 0xa0], eax
mov ecx, dword [ebp - 0xa4]
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 0xa0]
mov dword [ebp - 0x20], edx
push 2
lea eax, [ebp - 0x24]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
je 0x415c74
push 0
lea ecx, [ebp - 0x14]
push ecx
mov ecx, dword [ebp - 0x84]
add ecx, 0x14
call fcn.00407a20
push eax
mov ecx, dword [ebp - 0x84]
add ecx, 0x14
call fcn.00407e90
push eax
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x415c74
mov ecx, dword [ebp - 0x84]
add ecx, 0x14
call fcn.00407a20
cmp dword [ebp - 0x14], eax
jne 0x415c74
xorps xmm0, xmm0
movlpd qword [ebp - 0x48], xmm0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x44], ecx
mov ecx, 0x4a3ac0
call fcn.00412280
mov ecx, eax
call fcn.00407a20
mov dword [ebp - 0x40], eax
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 0x84]
call fcn.00416150
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x84]
add ecx, 0x14
call fcn.00407a20
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x34], eax
push 0
lea ecx, [ebp - 0x14]
push ecx
push 0x18
lea edx, [ebp - 0x48]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x415c74
cmp dword [ebp - 0x14], 0x18
jne 0x415c74
mov byte [ebp - 0x7e], 1
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x7e]
jmp 0x415c8b
mov byte [ebp - 0x7f], 0
lea ecx, [ebp - 0x78]
call fcn.00407f50
lea ecx, [ebp - 0x60]
call fcn.00407f50
mov al, byte [ebp - 0x7f]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00439a35
mov esp, ebp
pop ebp
ret 0xc