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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x290
mov eax, dword [0x439190]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, edx
push edi
mov dword [ebp - 0x284], eax
mov dword [ebp - 0x280], ecx
test esi, esi
je 0x40d849
test eax, eax
je 0x40d849
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x27c], edi
cmp edi, 0xffffffff
je 0x40d849
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40d85c
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004180c9
mov esp, ebp
pop ebp
ret
push 0x260
xor edi, edi
lea edx, [ebp - 0x270]
push edi
push edx
call fcn.00419b60
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x290]
push ecx
push esi
mov dword [ebp - 0x274], ebx
mov dword [ebp - 0x270], ebx
mov dword [ebp - 0x290], edi
mov dword [ebp - 0x28c], edi
call fcn.00416190
mov eax, dword [ebp - 0x280]
add esp, 0x18
cmp eax, edi
jne 0x40d940
push 0x5c
push esi
call fcn.00418ce7
mov edi, eax
add esp, 8
test edi, edi
jne 0x40d8bf
mov edi, esi
jmp 0x40d8c2
add edi, 2
push str.Mixin.SFX
push edi
call fcn.00419796
add esp, 8
test eax, eax
jne 0x40d994
push edi
lea edx, [ebp - 0x26c]
push 0x104
push edx
call fcn.004194bc
mov edx, dword [ebp - 0x284]
add esp, 0xc
push 0
lea eax, [ebp - 0x278]
push eax
push 0x264
lea ecx, [ebp - 0x274]
push ecx
push edx
mov dword [ebp - 0x278], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d849
cmp dword [ebp - 0x278], 0x264
je 0x40d994
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004180c9
mov esp, ebp
pop ebp
ret
push eax
lea eax, [ebp - 0x26c]
push 0x104
push eax
call fcn.004194bc
mov eax, dword [ebp - 0x284]
add esp, 0xc
push edi
lea ecx, [ebp - 0x278]
push ecx
push 0x264
lea edx, [ebp - 0x274]
push edx
push eax
mov dword [ebp - 0x278], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d849
cmp dword [ebp - 0x278], 0x264
jne 0x40d849
mov esi, 0x100000
cmp ebx, esi
jae 0x40d99f
mov esi, ebx
push esi
call fcn.00417cfb
add esp, 4
mov edi, eax
mov dword [ebp - 0x278], 0
test ebx, ebx
je 0x40da44
mov eax, ebx
sub eax, dword [ebp - 0x278]
cmp esi, eax
jbe 0x40d9ca
mov esi, eax
mov edx, dword [ebp - 0x27c]
push 0
lea ecx, [ebp - 0x288]
push ecx
push esi
push edi
push edx
mov dword [ebp - 0x288], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40da85
cmp dword [ebp - 0x288], esi
jne 0x40da85
mov ecx, dword [ebp - 0x284]
push 0
lea eax, [ebp - 0x280]
push eax
push esi
push edi
push ecx
mov dword [ebp - 0x280], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40da70
cmp dword [ebp - 0x280], esi
jne 0x40da70
mov eax, dword [ebp - 0x278]
add eax, esi
mov dword [ebp - 0x278], eax
cmp eax, ebx
jb 0x40d9bc
push edi
call fcn.0041866f
mov ecx, dword [ebp - 0x27c]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.004180c9
mov esp, ebp
pop ebp
ret
push edi
call fcn.0041866f
mov edx, dword [ebp - 0x27c]
add esp, 4
push edx
jmp 0x40d843
push edi
call fcn.0041866f
mov eax, dword [ebp - 0x27c]
add esp, 4
push eax
jmp 0x40d843