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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffb4
push ebx
xor ebx, ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00404a14
xor eax, eax
push ebp
push 0x4086ce
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0x80
push 3
push 0
push 0
push 0x40000000
mov eax, dword [ebp - 4]
call fcn.00404a24
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x4084d5
push 0
push 0x4086e0
push 0x4086ec
push dword [ebp - 4]
push 0x408704
lea edx, [ebp - 0x44]
xor eax, eax
call fcn.00408a9c
push dword [ebp - 0x44]
lea eax, [ebp - 0x40]
mov edx, 4
call fcn.004048e4
mov eax, dword [ebp - 0x40]
call fcn.00404a24
push eax
push 0
call sub.user32.dll_MessageBoxA_1
jmp 0x40869d
mov eax, 0x7ffffffe
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
mov ebx, eax
add ebx, 0x200800
mov eax, 0x38b14001
call fcn.004030ac
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x4c]
call fcn.00402ae8
add ebx, eax
mov dword [ebp - 0x1c], ebx
mov eax, 0x47a7c
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
add eax, 0x1bf53d2
mov dword [ebp - 0x18], eax
mov eax, 0x7ffffffe
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
mov ebx, eax
add ebx, 0x200800
mov eax, 0x38b14001
call fcn.004030ac
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x4c]
call fcn.00402ae8
add ebx, eax
mov dword [ebp - 0x24], ebx
mov eax, 0x47a7c
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
add eax, 0x1bf53d2
mov dword [ebp - 0x20], eax
mov eax, 0x7ffffffe
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
mov ebx, eax
add ebx, 0x200800
mov eax, 0x38b14001
call fcn.004030ac
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x4c]
call fcn.00402ae8
add ebx, eax
mov dword [ebp - 0x2c], ebx
mov eax, 0x47a7c
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
add eax, 0x1bf53d2
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_SetFileTime
mov eax, dword [ebp - 8]
call fcn.004030ac
mov dword [ebp - 0x48], eax
fild dword [ebp - 0x48]
call fcn.00402ae8
mov dword [ebp - 8], eax
lea eax, [ebp - 0x38]
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_GetFileSize_1
cmp dword [ebp - 8], 0
jbe 0x408694
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0xc]
jae 0x408694
mov eax, dword [ebp - 8]
push eax
lea eax, [ebp - 0x30]
mov ecx, 1
mov edx, dword [0x408418]
call fcn.00405564
add esp, 4
mov eax, dword [ebp - 8]
dec eax
test eax, eax
jl 0x408663
inc eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x34], 0
mov eax, pe_nt_image_headers32
call fcn.004030ac
mov edx, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x34]
mov byte [edx + ecx], al
inc dword [ebp - 0x34]
dec dword [ebp - 0x3c]
jne 0x408648
push 2
push 0
push 0
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_SetFilePointer_1
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_WriteFile_1
test eax, eax
jne 0x408694
mov dword [ebp - 0x10], 0xffffffff
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4086d5
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.00404588
lea eax, [ebp - 0x30]
mov edx, dword [0x408418]
call fcn.00405570
lea eax, [ebp - 4]
call fcn.00404564
ret