Function at 0x408112
Capabilities:
Delete file
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4230
call fcn.00419b10
push ebx
push 5
push str.HTTP_
push dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0xc], ebx
call sub.msvcrt.dll_strncmp
add esp, 0xc
test eax, eax
je 0x408142
xor eax, eax
pop ebx
leave
ret 0x10
push esi
push edi
push dword [ebp + 8]
or eax, 0xffffffff
lea edi, [ebp - 0x20]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x10], 0x100
mov dword [ebp - 0x18], ebx
call fcn.0040797c
mov edi, dword [ebp - 0x20]
cmp edi, ebx
jne 0x408171
mov edi, 0x41a57f
push str._r_n_r_n
mov eax, edi
call fcn.0040669d
mov esi, eax
cmp esi, ebx
pop ecx
jge 0x408192
lea esi, [ebp - 0x20]
call fcn.00407957
pop edi
mov eax, ebx
pop esi
jmp 0x40813d
add esi, 4
push str.Content_Encoding:_gzip
mov eax, edi
mov byte [esi + edi], bl
mov dword [ebp - 8], ebx
mov dword [ebp - 4], ebx
call fcn.004066f2
test eax, eax
pop ecx
jle 0x4081b6
mov dword [ebp - 8], 1
push str.Transfer_Encoding:_chunked
mov eax, edi
call fcn.004066f2
test eax, eax
pop ecx
jle 0x4081ce
mov dword [ebp - 4], 1
cmp dword [ebp - 8], ebx
je 0x408363
mov edi, 0x104
push edi
lea eax, [ebp - 0x22f]
push ebx
push eax
mov byte [ebp - 0x230], bl
call sub.msvcrt.dll_memset
push edi
lea eax, [ebp - 0x127]
push ebx
push eax
mov byte [ebp - 0x128], bl
call sub.msvcrt.dll_memset
mov ebx, 0x41ae20
push ebx
lea edi, [ebp - 0x230]
call fcn.004069fc
push ebx
lea edi, [ebp - 0x128]
call fcn.004069fc
add esp, 0x20
mov eax, edi
push eax
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
cmp dword [ebp - 4], 0
je 0x40824d
mov eax, dword [ebp + 0xc]
sub eax, esi
push eax
mov eax, dword [ebp + 8]
lea edi, [esi + eax]
lea eax, [ebp - 0x230]
push eax
call fcn.00407dc6
jmp 0x40827d
lea eax, [ebp - 0x230]
push eax
call fcn.004065e6
mov edi, eax
cmp edi, 0xffffffff
pop ecx
je 0x40827d
mov eax, dword [ebp + 0xc]
sub eax, esi
push eax
mov eax, dword [ebp + 8]
add eax, esi
push eax
push edi
call fcn.0040729f
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea eax, [ebp - 0x230]
push eax
call fcn.0041525b
mov ebx, eax
test ebx, ebx
pop ecx
je 0x4082f1
lea eax, [ebp - 0x128]
push 0x41ae28
push eax
call sub.msvcrt.dll_fopen
mov edi, eax
test edi, edi
pop ecx
pop ecx
je 0x4082ea
push edi
push esi
push 1
push dword [ebp + 8]
call sub.msvcrt.dll_fwrite
mov esi, 0x4000
jmp 0x4082ce
je 0x4082e3
push edi
push eax
lea eax, [ebp - 0x4230]
push 1
push eax
call sub.msvcrt.dll_fwrite
push esi
lea eax, [ebp - 0x4230]
mov ecx, ebx
call fcn.004154a4
add esp, 0x14
test eax, eax
jge 0x4082bc
push edi
call sub.msvcrt.dll_fclose
pop ecx
mov eax, ebx
call fcn.004156ef
lea eax, [ebp - 0x128]
push eax
call fcn.004065cd
cmp eax, 0xffffffff
pop ecx
mov dword [ebp + 8], eax
je 0x40834b
push 0
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov esi, eax
test esi, esi
jbe 0x408342
mov eax, dword [ebp + 0x14]
mov ebx, dword [ebp + 0x10]
mov dword [eax], esi
lea edi, [esi + 1]
mov eax, ebx
mov dword [ebp - 0xc], 1
call fcn.00407d98
push esi
push dword [ebx]
push dword [ebp + 8]
call fcn.00407256
mov eax, dword [ebx]
add esp, 0xc
mov byte [esi + eax], 0
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov esi, dword [sym.imp.KERNEL32.DLL_DeleteFileA]
lea eax, [ebp - 0x230]
push eax
call esi
lea eax, [ebp - 0x128]
push eax
call esi
mov ebx, dword [ebp - 0xc]
jmp 0x408184