Function at 0x402d20
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 0x54b58b
mov eax, dword fs:[0]
push eax
mov eax, 0x12c0
call fcn.0052c730
mov eax, dword [0x5acf20]
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 0x55bce0
push eax
call fcn.00405100
add esp, 0xc
test eax, eax
jne 0x402d84
cmp dword [ebp + 0x18], eax
setne al
test eax, eax
sete al
test al, al
jne 0x4031ae
cmp dword [ebp + 0x34], 0x10
lea eax, [ebp + 0x20]
push 0
cmovae eax, dword [ebp + 0x20]
push 0x55bce0
push eax
call fcn.00405100
add esp, 0xc
test eax, eax
jne 0x402db6
cmp dword [ebp + 0x30], eax
setne al
test eax, eax
sete al
test al, al
jne 0x4031ae
push 0x55bce0
lea ecx, [ebp - 0x1270]
call fcn.00401f10
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.0052cdb0
push 0x7f
lea eax, [ebp - 0x10f]
mov byte [ebp - 0x110], bl
push edi
push eax
call fcn.0052cdb0
push 0x7f
lea eax, [ebp - 0x8f]
mov byte [ebp - 0x90], bl
push edi
push eax
call fcn.0052cdb0
push 0x823
lea eax, [ebp - 0x1257]
mov byte [ebp - 0x1258], bl
push edi
push eax
call fcn.0052cdb0
push 0x823
lea eax, [ebp - 0xa33]
mov byte [ebp - 0xa34], bl
push edi
push eax
call fcn.0052cdb0
push 0x38
lea eax, [ebp - 0x12c8]
push edi
push eax
call fcn.0052cdb0
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], 0x100
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 0x403125
cmp dword [ebp - 0x12c0], 3
jne 0x403125
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 0x403125
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 0x403125
cmp dword [ebp - 0x129c], ebx
je 0x402fa1
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 0x402f92
jmp 0x402fad
mov eax, 0x2f
mov word [ebp - 0xa34], ax
push 0
push 0x80200000
push 0
push 0x55bce0
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.00404a40
mov esi, eax
add esp, 8
test esi, esi
je 0x403127
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 0x403034
cmp dword [ebp - 0x1278], 0x3e800000
ja 0x403125
push 0
push 0x80200000
push 0
push 0x55bce0
push str.HTTP_1.1
lea eax, [ebp - 0xa34]
push eax
mov eax, dword [ebp - 0x1284]
push 0x55bfd0
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
push 0xa
push ebx
call fcn.00404a40
mov esi, eax
add esp, 8
test esi, esi
je 0x403127
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 0x4030af
xor esi, esi
jmp 0x403140
push 0x2800
call fcn.0040601e
mov edi, eax
add esp, 4
test edi, edi
je 0x403125
push 0x2800
push 0
push edi
mov dword [ebp - 0x1280], 0
call fcn.0052cdb0
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 0x4030c2
mov eax, dword [ebp - 0x1280]
test eax, eax
je 0x40311e
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 0x403127
mov esi, dword [ebp - 0x1274]
jmp 0x4030c2
mov esi, 1
jmp 0x403127
xor esi, esi
push dword [ebp - 0x1274]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x403140
push edi
call fcn.00406027
add esp, 4
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
test ebx, ebx
je 0x40314d
push ebx
call edi
mov eax, dword [ebp - 0x127c]
test eax, eax
je 0x40315a
push eax
call edi
mov eax, dword [ebp - 0x1284]
test eax, eax
je 0x403167
push eax
call edi
mov eax, dword [ebp - 0x1288]
test eax, eax
je 0x403174
push eax
call edi
cmp dword [ebp - 0x125c], 0x10
jb 0x40318b
push dword [ebp - 0x1270]
call fcn.00406027
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 0x4031b0
xor esi, esi
cmp ebx, 0x10
jb 0x4031be
push edi
call fcn.00406027
add esp, 4
cmp dword [ebp + 0x34], 0x10
mov dword [ebp + 0x1c], 0xf
mov dword [ebp + 0x18], 0
mov byte [ebp + 8], 0
jb 0x4031e1
push dword [ebp + 0x20]
call fcn.00406027
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.0052c2cf
mov esp, ebp
pop ebp
ret