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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff94
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov byte [ebp - 5], cl
mov esi, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00404a10
xor eax, eax
push ebp
push 0x4207da
push dword fs:[eax]
mov dword fs:[eax], esp
xor ebx, ebx
lea eax, [ebp - 0x10]
call fcn.0041fc2c
mov eax, dword [ebp - 0x10]
call fcn.00404820
cmp eax, 2
jle 0x420569
mov eax, dword [ebp - 0x10]
cmp byte [eax], 0x5c
je 0x42064d
mov eax, dword [ebp - 0x10]
cmp byte [eax + 1], 0x3a
je 0x42064d
lea edx, [ebp - 0x6c]
xor eax, eax
call fcn.0041d7f0
mov eax, dword [ebp - 0x6c]
lea edx, [ebp - 0x14]
call fcn.0041d90c
cmp byte [ebp - 5], 0
jne 0x42063f
call fcn.0041e594
test al, al
je 0x42059d
push 0
call sub.user32.dll_MessageBeep
jmp 0x4207af
lea eax, [ebp - 0x10]
mov edx, 0x4207f4
call fcn.00404828
lea eax, [ebp - 0x10]
mov edx, 0x105
call fcn.00404bac
lea eax, [ebp - 0x68]
mov edx, 0x4c
call fcn.00407394
mov dword [ebp - 0x68], 0x4c
mov dword [ebp - 0x64], esi
mov eax, dword [ebp - 0x14]
call fcn.00404a20
mov dword [ebp - 0x3c], eax
mov eax, 0x4207f8
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x50], 1
mov eax, dword [ebp - 0x10]
call fcn.00404a20
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], 0x104
lea eax, [ebp - 0x18]
mov edx, 0x486894
call fcn.004047c4
mov eax, dword [ebp - 0x18]
call fcn.00404a20
mov dword [ebp - 0x38], eax
mov eax, 0x420808
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x34], 0x8004
lea eax, [ebp - 0x68]
push eax
call sub.comdlg32.dll_GetSaveFileNameA
test eax, eax
je 0x4207af
lea eax, [ebp - 0x10]
mov edx, dword [ebp - 0x4c]
call fcn.00404758
jmp 0x42064d
lea eax, [ebp - 0x10]
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
call fcn.0040486c
push ebp
mov eax, dword [ebp - 0x10]
call fcn.0042042c
pop ecx
push 0
push 0
push 4
push 0
push 0
push 0xc0000000
mov eax, dword [ebp - 0x10]
call fcn.00404a20
push eax
call sub.kernel32.dll_CreateFileA_1
mov esi, eax
cmp esi, 0xffffffff
je 0x4207af
cmp dword [0x486608], 0
jne 0x42068e
push esi
call sub.kernel32.dll_SetEndOfFile_1
push 2
push 0
push 0
push esi
call sub.kernel32.dll_SetFilePointer_1
push dword [ebp - 4]
push 0x420818
push 0x420818
lea eax, [ebp - 4]
mov edx, 3
call fcn.004048e0
push 0
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 4]
call fcn.00404820
push eax
mov eax, dword [ebp - 4]
push eax
push esi
call sub.kernel32.dll_WriteFile_1
cmp dword [0x486608], 0
jbe 0x4207a7
push 0
push esi
call sub.kernel32.dll_GetFileSize_1
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
cmp eax, dword [0x486608]
jbe 0x4207a7
or ebx, 0xffffffff
push 0
push 0
push 0
push 4
push 0
push esi
call sub.kernel32.dll_CreateFileMappingA
mov edi, eax
test edi, edi
je 0x42078c
push 0
push 0
push 0
push 0xf001f
push edi
call sub.kernel32.dll_MapViewOfFile
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x420786
mov eax, dword [ebp - 0xc]
push eax
push 0
inc ebx
push ebx
push 0x7fffffff
mov eax, 0x42081c
mov ecx, 9
mov edx, dword [ebp - 0x1c]
call fcn.00407ee4
mov ebx, eax
cmp ebx, 0xffffffff
je 0x420766
mov eax, dword [0x486608]
shr eax, 2
mov edx, dword [0x486608]
sub edx, eax
mov eax, dword [ebp - 0xc]
sub eax, ebx
cmp edx, eax
jbe 0x420727
cmp ebx, 0xffffffff
je 0x42077d
mov ecx, dword [ebp - 0xc]
sub ecx, ebx
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x1c]
add eax, ebx
call fcn.0040290c
mov eax, dword [ebp - 0x1c]
push eax
call sub.kernel32.dll_UnmapViewOfFile
push edi
call sub.kernel32.dll_CloseHandle_1
cmp ebx, 0xffffffff
jle 0x4207a7
push 0
push 0
mov eax, dword [ebp - 0xc]
sub eax, ebx
push eax
push esi
call sub.kernel32.dll_SetFilePointer_1
push esi
call sub.kernel32.dll_SetEndOfFile_1
push esi
call sub.kernel32.dll_CloseHandle_1
mov bl, 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4207e1
lea eax, [ebp - 0x6c]
call fcn.00404560
lea eax, [ebp - 0x18]
mov edx, 3
call fcn.00404584
lea eax, [ebp - 4]
call fcn.00404560
ret