Function at 0x404278
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x130
mov eax, dword [0x40f004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
xor ebx, ebx
push esi
mov dword [ebp - 0x10c], ebx
mov dword [ebp - 0x118], 4
mov dword [ebp - 0x114], ebx
cmp edi, ebx
je 0x404502
cmp dword [edi + 0xc], 0xffffffff
je 0x404502
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x10c]
push eax
push 0x20000005
push dword [edi + 8]
call fcn.00403795
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add esp, 0x10
cmp dword [ebp - 0x10c], ebx
ja 0x4042f2
mov dword [ebp - 0x10c], 0x3200000
jmp 0x4043b2
cmp dword [edi + 0x14], ebx
je 0x4043b2
mov eax, dword [edi + 0x10]
cmp eax, ebx
je 0x4043b2
cmp dword [ebp - 0x10c], eax
jne 0x4043b2
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x108]
push eax
push 0x35
push dword [edi + 8]
mov dword [ebp - 0x110], 0x100
call fcn.00403795
add esp, 0x10
test eax, eax
jne 0x4043b2
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x108]
push eax
push 0xb
push dword [edi + 8]
call fcn.00403795
add esp, 0x10
test eax, eax
je 0x4043a1
lea eax, [ebp - 0x130]
push eax
lea eax, [ebp - 0x108]
push eax
call fcn.0040382b
pop ecx
pop ecx
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x130]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x120]
push eax
lea eax, [edi + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CompareFileTime]
cmp eax, 1
jne 0x4043b2
mov eax, dword [edi + 0x30]
mov dword [eax + 4], ebx
jmp 0x4043b2
push ebx
push ebx
push ebx
push dword [edi + 0xc]
call esi
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [edi + 0x30]
cmp dword [eax], 0xce
jne 0x4043c8
push 2
push ebx
push ebx
push dword [edi + 0xc]
call esi
jmp 0x4043d9
push ebx
push ebx
push ebx
push dword [edi + 0xc]
call esi
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, 0x4000
call fcn.00402d91
mov esi, eax
mov dword [ebp - 0x11c], esi
mov dword [esi + 4], ebx
push dword [edi + 8]
mov dword [ebp - 0x110], ebx
call fcn.004037e1
pop ecx
test eax, eax
je 0x404510
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x404472
push ebx
lea ecx, [ebp - 0x110]
push ecx
push eax
push dword [esi + 8]
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40451f
mov ecx, dword [ebp - 0x114]
add ecx, dword [esi + 4]
mov eax, dword [edi + 0x2c]
mov dword [ebp - 0x114], ecx
cmp dword [eax + 0x28], ebx
je 0x404452
push ecx
push dword [ebp - 0x10c]
push dword [eax]
push dword [eax + 0x20]
call dword [eax + 0x28]
add esp, 0x10
mov eax, dword [edi + 0x2c]
cmp dword [eax + 0x24], ebx
je 0x4043eb
push dword [eax]
push dword [eax + 0x20]
call dword [eax + 0x24]
pop ecx
pop ecx
test eax, eax
je 0x4043eb
mov eax, dword [edi + 0x30]
mov dword [eax + 4], 0x3f3
mov eax, 0x400
call fcn.00402d91
push str._read_response_file__Status_Code:
push 0x21
pop ebx
mov esi, eax
call fcn.00402fdf
mov eax, dword [edi + 0x30]
push dword [eax]
mov ecx, esi
call fcn.004030e2
push str.__content_length:
push 0x12
pop ebx
mov eax, esi
call fcn.00402fdf
push dword [ebp - 0x10c]
mov ecx, esi
call fcn.004030e2
push str.__total_read:
push 0xe
pop ebx
mov eax, esi
call fcn.00402fdf
push dword [ebp - 0x114]
mov ecx, esi
call fcn.004030e2
push str.__error_code:
mov eax, esi
call fcn.00402fdf
mov eax, dword [edi + 0x30]
push dword [eax + 4]
mov ecx, esi
call fcn.004030e2
add esp, 0x20
mov eax, esi
call fcn.00401649
call fcn.00402e7e
mov esi, dword [ebp - 0x11c]
call fcn.00402e7e
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.00402440
leave
ret
mov eax, dword [edi + 0x30]
mov dword [eax + 4], 0x3ef
jmp 0x404472
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
mov eax, dword [edi + 0x30]
jne 0x404539
mov dword [eax + 4], 0x3f1
jmp 0x404472
mov dword [eax + 4], 0x3f0
jmp 0x404472