Function at 0x403ac0
Capabilities:
Check http status code
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x258
mov eax, dword [0x4c9890]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x4c8068]
push ebx
push esi
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push edi
add eax, 4
push 4
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x218]
push eax
push 0x49
push 0
mov ebx, ecx
call esi
push 4
lea eax, [ebp - 0x218]
push eax
push 0x4a
push 0
call esi
push 4
lea eax, [ebp - 0x218]
push eax
push 0x67
push 0
call esi
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
lea eax, [ebx + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebx + 0x28]
mov esi, dword [ebx + 0x18]
add esi, dword [ecx]
mov edx, dword [ebx + 0x1c]
adc edx, dword [ecx + 4]
push 0
push 0
push edx
push esi
push eax
mov dword [ebp - 0x214], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x403bd2
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
call fcn.004866f0
push dword [ebx + 0xc]
lea eax, [ebp - 0x20c]
push str._Part:_u__SetFilePointer_fails
push 0x103
push eax
call fcn.00401690
lea eax, [ebp - 0x20c]
push eax
call fcn.00413860
lea eax, [ebp - 0x20c]
push eax
call fcn.004010d0
mov eax, dword [ebx + 0x2c]
add esp, 0x24
test eax, eax
je 0x403bc8
push dword [ebx + 0x30]
push 0
push dword [ebx + 0xc]
push 0x479
call eax
add esp, 0x10
mov edi, 0x8000ffff
jmp 0x40414f
push dword [ebp + 0x14]
xorps xmm0, xmm0
push dword [ebp + 0x10]
movq qword [ebp - 0x258], xmm0
push dword [ebp + 0xc]
movq qword [ebp - 0x240], xmm0
push dword [ebp + 8]
mov ecx, ebx
movq qword [ebp - 0x250], xmm0
movq qword [ebp - 0x248], xmm0
movq qword [ebp - 0x238], xmm0
mov dword [ebp - 0x258], 0x28
mov dword [ebp - 0x23c], 0
call fcn.00403330
mov edi, eax
test edi, edi
js 0x40414f
push dword [ebx + 0xc]
push str._Part:_d_HttpSendRequestExW_begin
call fcn.00413860
add esp, 8
lea eax, [ebp - 0x258]
push ebx
push 8
push 0
push eax
push dword [ebx + 0x3c]
call dword [sym.imp.WININET.dll_HttpSendRequestExW]
test eax, eax
jne 0x403cf7
push eax
push dword [ebx + 8]
call esi
test eax, eax
je 0x403cf7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x403c77
mov edi, eax
jmp 0x403c80
movzx edi, ax
or edi, 0x80070000
push edi
push eax
push 0x4a1dfc
push str._s_failed__error___d__0x_x_
call fcn.00413860
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
call fcn.004866f0
push edi
push dword [ebx + 0xc]
push str._Part:_u_HttpSendRequestExW_Error__hr___.8X
lea eax, [ebp - 0x20c]
push 0x103
push eax
call fcn.00401690
lea eax, [ebp - 0x20c]
push eax
call fcn.004010d0
mov eax, dword [ebx + 0x2c]
add esp, 0x34
test eax, eax
je 0x40414f
push dword [ebx + 0x30]
push 2
push dword [ebx + 0xc]
push 0x479
call eax
add esp, 0x10
jmp 0x40414f
push dword [ebx + 0xc]
push str._Part:_d_HttpSendRequestExW_completed
call fcn.00413860
add esp, 8
push ebx
push 0
push 0
push dword [ebx + 0x3c]
call dword [sym.imp.WININET.dll_HttpEndRequestW]
test eax, eax
jne 0x403d74
push eax
push dword [ebx + 8]
call esi
test eax, eax
je 0x403d74
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x403d31
mov edi, eax
jmp 0x403d3a
movzx edi, ax
or edi, 0x80070000
push edi
push eax
push 0x4a1ed4
push str._s_failed__error___d__0x_x_
call fcn.00413860
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
call fcn.004866f0
push edi
push dword [ebx + 0xc]
push str._Part:_u_HttpEndRequestW_Error__hr___.8X
jmp 0x403cb5
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x403d8d
push dword [ebx + 0x30]
push 1
push dword [ebx + 0xc]
push 0x479
call eax
add esp, 0x10
mov eax, dword [ebx + 0x10]
push 0x4000
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x230], eax
call fcn.0048614e
push 0x4000
mov esi, eax
push 0
push esi
mov dword [ebp - 0x224], esi
call fcn.004866f0
add esp, 0x10
mov dword [ebp - 0x210], 0
test esi, esi
je 0x40406d
push 0
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, eax
neg edi
sbb edi, edi
and edi, 0x7fffbffc
add edi, 0x80004004
cmp edi, 0x80004004
je 0x40406d
lea eax, [ebp - 0x210]
push eax
mov eax, dword [ebp - 0x230]
shl eax, 0xa
push eax
push esi
push dword [ebx + 0x3c]
mov dword [ebp - 0x210], 0
call dword [sym.imp.WININET.dll_InternetReadFile]
mov dword [ebp - 0x228], eax
test eax, eax
je 0x403f8e
mov ecx, dword [ebp - 0x210]
test ecx, ecx
je 0x403ece
push 0
lea eax, [ebp - 0x220]
push eax
push ecx
push esi
push dword [ebp - 0x214]
mov dword [ebp - 0x220], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebx + 0x28]
mov ecx, dword [ebp - 0x220]
add dword [edx], ecx
mov esi, eax
adc dword [edx + 4], 0
push dword [ebx + 0x30]
mov eax, dword [ebx + 0x2c]
push 0
push dword [ebx + 0xc]
push 0x473
call eax
add esp, 0x10
test esi, esi
je 0x403ea1
mov eax, dword [ebp - 0x220]
mov esi, dword [ebp - 0x224]
cmp eax, dword [ebp - 0x210]
jae 0x403dd4
push str._Part:_d_fwrite_met_some_error
call fcn.00413860
add esp, 4
mov edi, 0x80700006
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x214], 0xffffffff
jmp 0x40406d
mov eax, dword [ebx + 0x28]
push dword [eax + 4]
push dword [eax]
push dword [ebx + 0xc]
push str._Part:_d_No_content_to_read__m_pi64BytesWritten___I64d
call fcn.00413860
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebx + 0x28]
mov edx, dword [ebp + 0x14]
add esp, 0x10
sub eax, dword [ebp + 8]
sbb edx, dword [ebp + 0xc]
cmp dword [ecx], eax
jne 0x403f05
cmp dword [ecx + 4], edx
jne 0x403f05
xor edi, edi
jmp 0x40406d
cmp byte [ebx + 0x450], 0
jne 0x403f84
mov dword [ecx], 0
mov dword [ecx + 4], 0
cmp dword [ebx + 0x2c], 0
je 0x403f84
push 0
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, eax
neg edi
sbb edi, edi
and edi, 0x7fffbffc
add edi, 0x80004004
cmp edi, 0x80004004
je 0x403f84
push 0x2000
call fcn.0048614e
mov ecx, dword [ebx + 0x28]
mov esi, eax
push dword [ecx + 4]
push dword [ecx]
push dword [ebx + 0xc]
push str._Part:_u_No_content_to_read__m_pi64BytesWritten___I64d
push 0xfff
push 0x1000
push esi
call fcn.00486606
push dword [ebx + 0x30]
mov eax, dword [ebx + 0x2c]
push esi
push edi
push 0x475
call eax
add esp, 0x30
mov edi, 0x80700006
jmp 0x40406d
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x403f9c
mov edi, eax
jmp 0x403fa5
movzx edi, ax
or edi, 0x80070000
push edi
push eax
push 0x4a1f4c
push str._s_failed__error___d__0x_x_
call fcn.00413860
add esp, 0x10
cmp byte [ebx + 0x450], 0
jne 0x404029
push 0
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x404029
mov eax, dword [ebx + 0x28]
mov dword [eax], 0
mov dword [eax + 4], 0
cmp dword [ebx + 0x2c], 0
je 0x404029
push 0x2000
call fcn.0048614e
mov edx, dword [ebp + 0x14]
push edx
mov edx, dword [ebp + 8]
mov esi, eax
mov eax, dword [ebp + 0x10]
push eax
push dword [ebp + 0xc]
push edx
push str.No_content_to_read__i64From___I64d__i64To___I64d
push 0xfff
push 0x1000
push esi
call fcn.00486606
push dword [ebx + 0x30]
mov eax, dword [ebx + 0x2c]
push esi
push edi
push 0x475
call eax
add esp, 0x34
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
call fcn.004866f0
push edi
push dword [ebx + 0xc]
lea eax, [ebp - 0x20c]
push str._Part:_u_InternetReadFile_Error_:__hr___.8X
push 0x103
push eax
call fcn.00401690
lea eax, [ebp - 0x20c]
push eax
call fcn.004010d0
add esp, 0x24
push dword [ebp - 0x224]
call fcn.004866e2
add esp, 4
test edi, edi
js 0x404149
cmp dword [ebp - 0x228], 1
jne 0x404144
cmp dword [ebp - 0x210], 0
jne 0x404144
push 0
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x21c]
push eax
push 0x20000013
push dword [ebx + 0x3c]
mov dword [ebp - 0x21c], 0
mov dword [ebp - 0x22c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x404100
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x4040e1
mov edi, eax
jmp 0x4040ea
movzx edi, ax
or edi, 0x80070000
push edi
push eax
push str._Part:_d_HttpQueryInfo
push str._s_failed__error___d__0x_x_
call fcn.00413860
add esp, 0x10
jmp 0x404149
push dword [ebp - 0x21c]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebx + 0xc]
push str._Part:_d_ProcessSubPart_for___I64d____I64d___dwInfo___d
call fcn.00413860
mov edi, dword [ebp - 0x21c]
add esp, 0x1c
cmp edi, 0xce
je 0x404140
cmp edi, 0xc8
je 0x404140
add edi, 0x80800000
jmp 0x404149
xor edi, edi
jmp 0x404149
mov edi, 0x8000ffff
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x404168
push dword [ebx + 0x30]
push 0
push dword [ebx + 0xc]
push 0x473
call eax
add esp, 0x10
mov eax, dword [ebp - 0x214]
cmp eax, 0xffffffff
je 0x40417a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx + 0x3c]
test eax, eax
je 0x40419a
push 0
push eax
call dword [sym.imp.WININET.dll_InternetSetStatusCallbackW]
push dword [ebx + 0x3c]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [ebx + 0x3c], 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebx + 0xc]
push str._Part:_d_ProcessSubPart_for___I64d____I64d__end
call fcn.00413860
add esp, 0x18
push 0
push dword [ebx + 8]
call esi
test eax, eax
mov ecx, 0x80004004
cmove edi, ecx
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00487c50
mov esp, ebp
pop ebp
ret 0x10