Function at 0x420240
Capabilities:
Check http status code
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
Send data
Send http request
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x251c
call fcn.004b4380
mov eax, dword [0x50bd24]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x24b8], 0
push 0x200
lea eax, [ebp - 0x424]
mov dword [ebp - 0x24d0], 0
mov esi, ecx
mov dword [ebp - 0x24c0], 0
push edi
push eax
mov dword [ebp - 0x24bc], esi
mov dword [ebp - 0x24cc], 0
mov dword [ebp - 0x24c4], edi
mov dword [ebp - 0x24e0], edi
mov dword [ebp - 0x24c8], edi
call fcn.004b5de0
push 0x100
lea eax, [ebp - 0x224]
push edi
push eax
call fcn.004b5de0
push 0x100
lea eax, [ebp - 0x124]
push edi
push eax
call fcn.004b5de0
push 0x1048
lea eax, [ebp - 0x24b4]
push edi
push eax
call fcn.004b5de0
push 0x1048
lea eax, [ebp - 0x146c]
push edi
push eax
call fcn.004b5de0
lea eax, [ebp - 0x424]
mov dword [ebp - 0x2510], edi
mov dword [ebp - 0x250c], eax
xorps xmm0, xmm0
lea eax, [ebp - 0x224]
movlpd qword [ebp - 0x2518], xmm0
mov dword [ebp - 0x2500], eax
add esp, 0x3c
cmp dword [esi + 0x80], 8
lea eax, [ebp - 0x124]
mov dword [ebp - 0x24f8], eax
lea eax, [ebp - 0x24b4]
mov dword [ebp - 0x24f0], eax
lea eax, [esi + 0x6c]
mov dword [ebp - 0x2504], edi
movlpd qword [ebp - 0x24e8], xmm0
mov dword [ebp - 0x251c], 0x3c
mov dword [ebp - 0x2508], 0x100
mov dword [ebp - 0x24fc], 0x80
mov dword [ebp - 0x24f4], 0x80
mov dword [ebp - 0x24ec], 0x824
jb 0x42038a
mov eax, dword [eax]
lea ecx, [ebp - 0x251c]
push ecx
push 0
push 0
push eax
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
test eax, eax
je 0x420705
mov eax, dword [ebp - 0x2510]
cmp eax, 3
je 0x4203b8
cmp eax, 4
jne 0x420705
push 0
push 0
push 0
push 0
push 0x4e1870
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x24b8], eax
test eax, eax
jne 0x4203dd
lea ebx, [eax + 2]
jmp 0x42070a
cmp dword [esi + 0x38], edi
lea ebx, [esi + 0x38]
jbe 0x420433
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 4
push ebx
push 2
push eax
call esi
push 4
push ebx
push 5
push dword [ebp - 0x24b8]
call esi
push 4
push ebx
push 6
push dword [ebp - 0x24b8]
call esi
push 4
push ebx
push 7
push dword [ebp - 0x24b8]
call esi
push 4
push ebx
push 8
push dword [ebp - 0x24b8]
call esi
mov esi, dword [ebp - 0x24bc]
mov eax, dword [ebp - 0x24b8]
push 0
push 0
push 3
lea ecx, [ebp - 0x124]
push ecx
lea ecx, [ebp - 0x224]
push ecx
push dword [ebp - 0x2504]
lea ecx, [ebp - 0x424]
push ecx
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
mov ebx, eax
mov dword [ebp - 0x24d0], ebx
test ebx, ebx
jne 0x42046f
lea ebx, [eax + 3]
jmp 0x42070a
cmp dword [ebp - 0x24ec], edi
je 0x420497
mov ecx, dword [ebp - 0x24f0]
lea edx, [ebp - 0x146c]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x420485
jmp 0x4204a1
mov dword [ebp - 0x146c], 0x2f
cmp dword [ebp - 0x2510], 4
mov ecx, 0x80800000
push 0
mov eax, SysReAllocString
cmove eax, ecx
push eax
push 0
push 0x4e1870
push 0x4e33f0
lea eax, [ebp - 0x146c]
push eax
push 0x4e3404
push ebx
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
push 0
push 0
push 0
mov ebx, eax
push 0
push ebx
mov dword [ebp - 0x24c0], ebx
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x4206fe
push 0
lea eax, [ebp - 0x24d4]
mov dword [ebp - 0x24bc], edi
push eax
lea eax, [ebp - 0x24bc]
mov dword [ebp - 0x24d4], 4
push eax
push 0x20000013
push ebx
mov ebx, dword [sym.imp.WININET.dll_HttpQueryInfoW]
call ebx
test eax, eax
je 0x4206f7
cmp dword [ebp - 0x24bc], 0xc8
je 0x420542
mov ebx, 4
jmp 0x42070a
push 0
lea eax, [ebp - 0x24d8]
mov dword [ebp - 0x24d8], 0x10
push eax
lea eax, [ebp - 0x24]
xorps xmm0, xmm0
push eax
push 0x3f
push dword [ebp - 0x24c0]
movups xmmword [ebp - 0x24], xmm0
movups xmmword [ebp - 0x14], xmm0
call ebx
test eax, eax
je 0x420587
lea eax, [ebp - 0x24]
push str.chunked
push eax
call fcn.004c2644
add esp, 8
test eax, eax
je 0x4205d0
push 0
lea eax, [ebp - 0x24dc]
mov dword [ebp - 0x24dc], 4
push eax
lea eax, [ebp - 0x24c8]
push eax
push 0x20000005
push dword [ebp - 0x24c0]
call ebx
test eax, eax
jne 0x4205ba
lea ebx, [eax + 5]
jmp 0x42070a
cmp dword [ebp - 0x24c8], 0x3e800000
jbe 0x4205d0
mov ebx, 6
jmp 0x42070a
cmp dword [esi + 0x64], edi
jbe 0x42060e
cmp dword [esi + 0x68], 8
lea eax, [esi + 0x54]
jb 0x4205e0
mov eax, dword [eax]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x24cc], eax
cmp eax, 0xffffffff
jne 0x42060e
mov ebx, 9
jmp 0x420720
push 0x2800
call fcn.004b4085
mov edi, eax
add esp, 4
test edi, edi
jne 0x420629
lea ebx, [eax + 0xa]
jmp 0x4206ea
xor ebx, ebx
mov dword [ebp - 0x24bc], ebx
push 0x2800
push 0
push edi
mov dword [ebp - 0x24c4], 0
call fcn.004b5de0
add esp, 0xc
lea eax, [ebp - 0x24c4]
push eax
push 0x2800
push edi
push dword [ebp - 0x24c0]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x420631
mov eax, dword [ebp - 0x24c4]
test eax, eax
je 0x4206e8
add ebx, eax
cmp dword [esi + 0x64], 0
jbe 0x42069a
push 0
lea ecx, [ebp - 0x24e0]
push ecx
push eax
push edi
push dword [ebp - 0x24cc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4206a4
lea ebx, [eax + 0xb]
jmp 0x4206ea
push eax
push edi
lea ecx, [esi + 0x3c]
call fcn.004078b0
mov ecx, dword [ebp - 0x24c8]
test ecx, ecx
je 0x420631
imul eax, ebx, 0x64
xor edx, edx
div ecx
mov ecx, 0x64
cmp eax, 0x64
cmova eax, ecx
cmp eax, dword [ebp - 0x24bc]
je 0x420631
push 0
push eax
push 0x659
push dword [esi + 4]
mov dword [ebp - 0x24bc], eax
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x420631
xor ebx, ebx
mov eax, dword [ebp - 0x24cc]
cmp eax, 0xffffffff
je 0x420713
jmp 0x42070c
mov ebx, 7
jmp 0x42070a
mov ebx, 8
jmp 0x42070a
mov ebx, 1
xor eax, eax
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x420720
push edi
call fcn.004b408e
add esp, 4
mov eax, dword [ebp - 0x24c0]
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
test eax, eax
je 0x420733
push eax
call edi
mov eax, dword [ebp - 0x24d0]
test eax, eax
je 0x420740
push eax
call edi
mov eax, dword [ebp - 0x24b8]
test eax, eax
je 0x42074d
push eax
call edi
push 0
push ebx
push 0x65a
push dword [esi + 4]
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004b42e4
mov esp, ebp
pop ebp
ret