Function at 0x402d80
Capabilities:
Get file size
Write file on windows

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, dword [esp + 0x30]
push esi
mov esi, dword [esp + 0x38]
push edi
push esi
push ebp
call fcn.00402b80
push 0x14
lea eax, [esp + 0x28]
push esi
push eax
call fcn.00403710
mov eax, dword [ebp + 0x20c]
add esp, 0x14
test eax, eax
je 0x402e13
mov ebx, dword [esp + 0x44]
push 4
push 0x1000
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, dword [esp + 0x40]
mov edi, eax
cmp ebx, 4
mov dword [esp + 0x38], edi
jb 0x402e06
cmp byte [esi], 4
jne 0x402e06
cmp byte [esi + 1], 3
jne 0x402e06
cmp byte [esi + 2], 2
jne 0x402e06
cmp byte [esi + 3], 1
jne 0x402e06
sub ebx, 4
add esi, 4
mov ecx, ebx
mov dword [esp + 0x44], ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x402e17
push ebx
push esi
push edi
call fcn.004030a0
add esp, 0xc
jmp 0x402e1f
mov ebx, dword [esp + 0x44]
mov edi, dword [esp + 0x38]
mov esi, dword [esp + 0x40]
mov eax, dword [ebp + 0x208]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebp + 0x208]
push 2
push 0
push 0
push ecx
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x20c]
test eax, eax
je 0x402e51
mov esi, edi
mov eax, dword [ebp + 0x208]
lea edx, [esp + 0x14]
push 0
push edx
push ebx
push esi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp + 0x20c]
test eax, eax
je 0x402e7f
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp + 0x214]
push 4
inc eax
push 0x1000
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 2
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov eax, dword [ebp + 0x214]
test eax, eax
mov dword [esp + 0x40], 0
jbe 0x402f0f
xor edi, edi
mov dword [esp + 0x38], edi
jmp 0x402ec2
mov edi, dword [esp + 0x38]
mov eax, dword [ebp + 0x218]
mov edx, dword [esp + 0x3c]
push 0x14
push edx
lea ecx, [eax + edi + 4]
push ecx
call fcn.00403810
add esp, 0xc
test eax, eax
jge 0x402f0f
mov esi, dword [ebp + 0x218]
mov eax, dword [esp + 0x40]
mov edx, dword [esp + 0x38]
add esi, edi
add edi, ebx
mov ecx, 7
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 0x214]
inc eax
add edx, 0x1c
cmp eax, ecx
mov dword [esp + 0x40], eax
mov dword [esp + 0x38], edx
jb 0x402ebe
mov esi, dword [esp + 0x40]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
lea edi, [esi*8]
push 0x14
sub edi, esi
push ecx
shl edi, 2
mov dword [edi + ebx], edx
lea edx, [edi + ebx + 4]
push edx
mov dword [edi + ebx + 0x18], eax
call fcn.00403710
mov eax, dword [ebp + 0x214]
add esp, 0xc
sub eax, esi
mov esi, dword [ebp + 0x218]
add esi, edi
push 0x8000
lea ecx, [eax*8]
push 0
sub ecx, eax
mov eax, dword [esp + 0x48]
shl ecx, 2
inc eax
lea edx, [eax*8]
sub edx, eax
mov eax, ecx
shr ecx, 2
lea edi, [ebx + edx*4]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x218]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp + 0x214]
pop edi
inc eax
mov dword [ebp + 0x218], ebx
mov dword [ebp + 0x214], eax
mov dword [ebp + 0x210], 1
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret