Function at 0x403e20
Capabilities:
Connect to http server
Create http request
Download and write a file
Get http content length
Parse url
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x549beb
mov eax, dword fs:[0]
push eax
mov eax, 0x12c0
call fcn.00531c50
mov eax, dword [0x5aaef0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 0x1c]
lea eax, [ebp + 8]
mov edi, dword [ebp + 8]
cmp ebx, 0x10
push 0
cmovae eax, edi
mov dword [ebp - 4], 1
push 0x55ae30
push eax
call fcn.00403010
add esp, 0xc
test eax, eax
jne 0x403e84
cmp dword [ebp + 0x18], eax
setne al
test eax, eax
sete al
test al, al
jne 0x4042ca
cmp dword [ebp + 0x34], 0x10
lea eax, [ebp + 0x20]
push 0
cmovae eax, dword [ebp + 0x20]
push 0x55ae30
push eax
call fcn.00403010
add esp, 0xc
test eax, eax
jne 0x403eb6
cmp dword [ebp + 0x30], eax
setne al
test eax, eax
sete al
test al, al
jne 0x4042ca
push 0x55ae30
lea ecx, [ebp - 0x1270]
call fcn.004026a0
xor eax, eax
mov byte [ebp - 4], 2
push 0xff
mov dword [ebp - 0x1284], eax
xor edi, edi
mov dword [ebp - 0x127c], eax
xor ebx, ebx
mov dword [ebp - 0x1274], eax
mov dword [ebp - 0x1280], eax
mov dword [ebp - 0x1290], eax
mov dword [ebp - 0x1278], eax
mov byte [ebp - 0x210], al
lea eax, [ebp - 0x20f]
push edi
push eax
mov dword [ebp - 0x1288], 0
mov dword [ebp - 0x128c], 4
call fcn.00531650
push 0x7f
lea eax, [ebp - 0x10f]
mov byte [ebp - 0x110], bl
push edi
push eax
call fcn.00531650
push 0x7f
lea eax, [ebp - 0x8f]
mov byte [ebp - 0x90], bl
push edi
push eax
call fcn.00531650
push 0x823
lea eax, [ebp - 0x1257]
mov byte [ebp - 0x1258], bl
push edi
push eax
call fcn.00531650
push 0x823
lea eax, [ebp - 0xa33]
mov byte [ebp - 0xa34], bl
push edi
push eax
call fcn.00531650
push 0x38
lea eax, [ebp - 0x12c8]
push edi
push eax
call fcn.00531650
lea eax, [ebp - 0x210]
mov dword [ebp - 0x12cc], 0x3c
mov dword [ebp - 0x12bc], eax
lea ecx, [ebp - 0x12cc]
add esp, 0x48
mov dword [ebp - 0x12b8], pe_nt_image_headers32
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp - 0x110]
mov dword [ebp - 0x12b0], eax
lea eax, [ebp - 0x90]
mov dword [ebp - 0x12a8], eax
lea eax, [ebp - 0x1258]
push ecx
mov dword [ebp - 0x12a0], eax
lea eax, [ebp + 8]
cmovae eax, dword [ebp + 8]
push edi
push edi
push eax
mov dword [ebp - 0x12ac], 0x80
mov dword [ebp - 0x12a4], 0x80
mov dword [ebp - 0x129c], 0x824
call dword [sym.imp.WININET.dll_InternetCrackUrlA]
test eax, eax
je 0x404237
cmp dword [ebp - 0x12c0], 3
jne 0x404237
push edi
push edi
push edi
push edi
push str.down
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x1288], eax
test eax, eax
je 0x404237
push edi
push edi
push 3
lea ecx, [ebp - 0x90]
push ecx
lea ecx, [ebp - 0x110]
push ecx
push dword [ebp - 0x12b4]
lea ecx, [ebp - 0x210]
push ecx
push eax
call dword [sym.imp.WININET.dll_InternetConnectA]
mov esi, eax
mov dword [ebp - 0x1284], esi
test esi, esi
je 0x404237
cmp dword [ebp - 0x129c], ebx
je 0x4040a1
mov ecx, dword [ebp - 0x12a0]
lea edx, [ebp - 0xa34]
sub edx, ecx
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x404092
jmp 0x4040ad
mov eax, 0x2f
mov word [ebp - 0xa34], ax
push 0
push 0x80200000
push 0
push 0x55ae30
push str.HTTP_1.1
lea eax, [ebp - 0xa34]
push eax
push str.HEAD
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
push 0xa
push eax
mov dword [ebp - 0x127c], eax
call fcn.00406aa0
mov esi, eax
add esp, 8
test esi, esi
je 0x404239
push 0
lea eax, [ebp - 0x128c]
mov dword [ebp - 0x1278], ebx
push eax
lea eax, [ebp - 0x1278]
mov dword [ebp - 0x128c], 4
push eax
mov eax, dword [ebp - 0x127c]
push 0x20000005
push eax
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x404134
cmp dword [ebp - 0x1278], 0x3e800000
ja 0x404237
push 0
push 0x80200000
push 0
push 0x55ae30
push str.HTTP_1.1
lea eax, [ebp - 0xa34]
push eax
mov eax, dword [ebp - 0x1284]
push 0x55b108
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
push 0xa
push ebx
call fcn.00406aa0
mov esi, eax
add esp, 8
test esi, esi
je 0x404239
cmp dword [ebp + 0x34], 0x10
lea ecx, [ebp + 0x20]
push 0
cmovae ecx, dword [ebp + 0x20]
push 0x80
push 2
push 0
push 1
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x1274], esi
cmp esi, 0xffffffff
jne 0x4041af
xor esi, esi
jmp 0x404252
push 0x2800
call fcn.0040b2ca
mov edi, eax
add esp, 4
test edi, edi
je 0x404237
cmp byte [0x5b0920], 0
jne 0x404237
jmp 0x4041d0
push 0x2800
push 0
push edi
mov dword [ebp - 0x1280], 0
call fcn.00531650
add esp, 0xc
lea eax, [ebp - 0x1280]
push eax
push 0x2800
push edi
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40422e
mov eax, dword [ebp - 0x1280]
test eax, eax
je 0x4042c0
push 0
lea ecx, [ebp - 0x1290]
push ecx
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
je 0x404239
mov esi, dword [ebp - 0x1274]
cmp byte [0x5b0920], 0
je 0x4041d0
xor esi, esi
push dword [ebp - 0x1274]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x404252
push edi
call fcn.0040b2d3
add esp, 4
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
test ebx, ebx
je 0x40425f
push ebx
call edi
mov eax, dword [ebp - 0x127c]
test eax, eax
je 0x40426c
push eax
call edi
mov eax, dword [ebp - 0x1284]
test eax, eax
je 0x404279
push eax
call edi
mov eax, dword [ebp - 0x1288]
test eax, eax
je 0x404286
push eax
call edi
cmp dword [ebp - 0x125c], 0x10
jb 0x40429d
push dword [ebp - 0x1270]
call fcn.0040b2d3
add esp, 4
mov ebx, dword [ebp + 0x1c]
mov edi, dword [ebp + 8]
mov dword [ebp - 0x125c], 0xf
mov dword [ebp - 0x1260], 0
mov byte [ebp - 0x1270], 0
jmp 0x4042cc
mov esi, 1
jmp 0x404239
xor esi, esi
cmp ebx, 0x10
jb 0x4042da
push edi
call fcn.0040b2d3
add esp, 4
cmp dword [ebp + 0x34], 0x10
mov dword [ebp + 0x1c], 0xf
mov dword [ebp + 0x18], 0
mov byte [ebp + 8], 0
jb 0x4042fd
push dword [ebp + 0x20]
call fcn.0040b2d3
add esp, 4
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0052fe70
mov esp, ebp
pop ebp
ret