Function at 0x40552b
Capabilities:
Connect to http server
Create http request
Download and write a file
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, 0x887c
call fcn.0041c290
mov eax, dword [0x436504]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov dword [ebp - 0x8828], eax
mov eax, dword [0x53a04c]
xor edi, edi
cmp eax, edi
mov esi, ecx
je 0x405589
push eax
push ebx
call fcn.00418f50
test eax, eax
pop ecx
pop ecx
je 0x405589
push ebx
push str._HttpDownloader____s__Skipping_for_debug_purposes._n
call fcn.00408291
pop ecx
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416cc4
leave
ret
push ebx
push str._HttpDownloader____s___1__Starting_download..._n
call fcn.00408291
cmp dword [ebp + 0x10], edi
pop ecx
pop ecx
mov dword [ebp - 0x881c], edi
push edi
je 0x4055b6
mov eax, dword [ebp - 0x8828]
cmp eax, edi
jne 0x4055af
mov eax, dword [esi + 0x18]
push dword [eax + 4]
push dword [eax]
jmp 0x4055b8
push edi
push edi
push dword [ebp + 0xc]
push str.JWrapperDownloader
call dword [sym.imp.WININET.dll_InternetOpenA]
cmp eax, edi
mov dword [ebp - 0x8810], eax
push ebx
jne 0x4055ea
push str._HttpDownloader____s__Unable_initialise_HTTP_connection_n
call fcn.00408291
push str.InternetOpen
call fcn.0040526f
add esp, 0xc
jmp 0x405578
push str._HttpDownloader____s__Attempting_to_crack_URL_n
call fcn.00408291
push 0x3c
lea eax, [ebp - 0x887c]
push edi
push eax
call fcn.00418c50
xor eax, eax
inc eax
add esp, 0x14
mov dword [ebp - 0x8868], eax
mov dword [ebp - 0x884c], eax
lea eax, [ebp - 0x887c]
push eax
push edi
push edi
push dword [esi + 0x10]
mov dword [ebp - 0x887c], 0x3c
call dword [sym.imp.WININET.dll_InternetCrackUrlA]
push eax
push ebx
push str._HttpDownloader____s__Crack_result_is__d_n
mov dword [ebp - 0x8820], eax
call fcn.00408291
add esp, 0xc
cmp dword [ebp - 0x8820], edi
je 0x405762
push 0x400
lea eax, [ebp - 0x808]
push edi
push eax
call fcn.00418c50
add esp, 0xc
push 0x400
lea eax, [ebp - 0x408]
push edi
push eax
call fcn.00418c50
add esp, 0xc
cmp dword [ebp - 0x8868], edi
jbe 0x40569f
push dword [ebp - 0x8868]
lea eax, [ebp - 0x808]
push dword [ebp - 0x886c]
push eax
call fcn.004189a0
add esp, 0xc
cmp dword [ebp - 0x884c], edi
jbe 0x4056c2
push dword [ebp - 0x884c]
lea eax, [ebp - 0x408]
push dword [ebp - 0x8850]
push eax
call fcn.004189a0
add esp, 0xc
lea eax, [ebp - 0x808]
push eax
push str._HttpDownloader__Hostname___s_n
call fcn.00408291
movzx eax, word [ebp - 0x8864]
push eax
push str._HttpDownloader__nPort___d_n
call fcn.00408291
lea eax, [ebp - 0x408]
push eax
push str._HttpDownloader__lpszUrlPath___s_n
call fcn.00408291
add esp, 0x18
push edi
push edi
push 3
push edi
push edi
push dword [ebp - 0x8864]
lea eax, [ebp - 0x808]
push eax
push dword [ebp - 0x8810]
call dword [sym.imp.WININET.dll_InternetConnectA]
cmp eax, edi
mov dword [ebp - 0x881c], eax
jne 0x405744
push str.InternetConnect
call fcn.0040526f
pop ecx
push dword [ebp - 0x881c]
push edi
mov edi, dword [ebp - 0x8810]
call fcn.004053eb
jmp 0x405576
push edi
push 0x400000
push edi
push edi
push edi
lea ecx, [ebp - 0x408]
push ecx
push 0x432b74
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
jmp 0x405784
push str.CrackURL
call fcn.0040526f
pop ecx
push edi
push 0x400800
push edi
push edi
push dword [esi + 0x10]
push dword [ebp - 0x8810]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
cmp eax, edi
mov dword [ebp - 0x880c], eax
jne 0x405795
push str.HttpOpenRequest_InternetOpenUrl
jmp 0x405727
push ebx
push str._HttpDownloader____s___3__Starting_download..._n
call fcn.00408291
pop ecx
pop ecx
push edi
push edi
push edi
push edi
push dword [ebp - 0x880c]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
push dword [ebp - 0x880c]
call fcn.00405353
mov dword [ebp - 0x8818], eax
pop ecx
lea eax, [ebp - 0x8838]
push eax
call fcn.0041a731
pop ecx
push ebx
push str._HttpDownloader____s___4__Starting_download..._n
call fcn.00408291
cmp dword [ebp - 0x8818], 0x197
pop ecx
pop ecx
mov dword [ebp - 0x8814], edi
jne 0x4058b3
cmp dword [ebp - 0x8814], edi
jne 0x40581a
push 0xffffffffffffffff
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [esi + 0xc], edi
mov dword [ebp - 0x8814], 1
jne 0x405908
push dword [ebp - 0x8818]
push ebx
push str._HttpDownloader____s__Status_code_is__d_n
call fcn.00408291
add esp, 0xc
push edi
push 7
push 0x2eee
push dword [ebp - 0x880c]
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.WININET.dll_InternetErrorDlg]
push eax
push ebx
push str._HttpDownloader____s__InternetErrorDlg_return_code_is__d_n
mov dword [ebp - 0x8820], eax
call fcn.00408291
add esp, 0xc
cmp dword [ebp - 0x8820], 0x2f00
jne 0x40593b
push edi
push edi
push edi
push edi
push dword [ebp - 0x880c]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
push dword [ebp - 0x880c]
call fcn.00405353
cmp eax, 0x197
pop ecx
mov dword [ebp - 0x8818], eax
je 0x4057f4
cmp dword [ebp - 0x8814], edi
je 0x4058b3
push dword [esi + 4]
mov dword [esi + 0xc], 1
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
push str._HttpDownloader____s__Connection_setup__querying_length_n
call fcn.00408291
push dword [ebp - 0x880c]
call fcn.00405390
add esp, 0xc
cmp eax, 0xffffffff
mov dword [ebp - 0x8814], eax
mov dword [ebp - 0x8830], edi
mov dword [ebp - 0x882c], edi
je 0x405975
push eax
push ebx
push str._HttpDownloader____s__Required_file_size_is__d_n
mov dword [ebp - 0x882c], 1
mov dword [ebp - 0x8830], eax
call fcn.00408291
add esp, 0xc
jmp 0x405982
push ebx
push str._HttpDownloader____s__Proxy_thread_returning_as_another_has_connected_to_the_proxy_n
call fcn.00408291
push dword [ebp - 0x881c]
mov edi, dword [ebp - 0x8810]
push dword [ebp - 0x880c]
call fcn.004053eb
add esp, 0x10
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x405578
push dword [esi + 4]
mov dword [esi + 0xc], 1
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
push str._HttpDownloader____s__Could_not_get_proxy_credentials._n
call fcn.00408291
push dword [ebp - 0x881c]
mov edi, dword [ebp - 0x8810]
push dword [ebp - 0x880c]
call fcn.004053eb
add esp, 0x10
jmp 0x405578
push ebx
push str._HttpDownloader____s__Required_file_size_is_unknown__n
call fcn.00408291
pop ecx
pop ecx
push 0x8000
lea eax, [ebp - 0x8808]
push edi
push eax
mov dword [ebp - 0x8818], edi
call fcn.00418c50
lea eax, [ebp - 0x8840]
add esp, 0xc
push eax
call fcn.0041a731
cmp dword [ebp - 0x882c], edi
pop ecx
mov dword [ebp - 0x8820], edi
je 0x4059c4
cmp dword [ebp - 0x8814], edi
je 0x405cbf
push ebx
push str._HttpDownloader____s__Looping..._n
call fcn.00408291
cmp dword [ebp - 0x882c], edi
pop ecx
pop ecx
je 0x4059f1
mov eax, dword [ebp - 0x8814]
imul eax, eax, 0x64
cdq
idiv dword [ebp - 0x8830]
push 0x64
pop ecx
sub ecx, eax
push ecx
jmp 0x4059f3
push 0xffffffffffffffff
call fcn.00407824
lea eax, [ebp - 0x8824]
push eax
push 0x8000
lea eax, [ebp - 0x8808]
push eax
push dword [ebp - 0x880c]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x405ca3
push dword [ebp - 0x8824]
push ebx
push str._HttpDownloader____s__Read__d..._n
call fcn.00408291
mov eax, dword [ebp - 0x8824]
sub dword [ebp - 0x8814], eax
add esp, 0xc
cmp eax, edi
jbe 0x405be6
cmp dword [ebp - 0x8818], edi
jne 0x405bc7
push 0xffffffffffffffff
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
push str._HttpDownloader____s__OutputFile_needs_initialising._n
call fcn.00408291
cmp dword [esi + 8], edi
pop ecx
pop ecx
jne 0x405c4b
push 0x432e60
push dword [esi + 0x14]
lea eax, [ebp - 0x8818]
push eax
call fcn.0041894c
add esp, 0xc
test eax, eax
jne 0x405c77
inc eax
push eax
push ebx
push str._HttpDownloader____s__Opened_file._Set_downloadWorked_to_TRUE___d__n
mov dword [esi + 8], eax
call fcn.00408291
add esp, 0xc
cmp dword [ebp + 0x10], edi
push ebx
je 0x405b42
push str._HttpDownloader____s__Copying_proxy_settings._n
call fcn.00408291
cmp dword [0x539fe4], edi
pop ecx
pop ecx
push ebx
je 0x405ad4
push str._HttpDownloader____s__Proxy_settings_exist_already._n
call fcn.00408291
pop ecx
jmp 0x405bb1
push str._HttpDownloader____s__No_existing_proxy_settings_found._n
call fcn.00408291
push 8
call fcn.00416db0
add esp, 0xc
push 8
push edi
push eax
mov dword [0x539fe4], eax
call fcn.00418c50
add esp, 0xc
cmp dword [ebp - 0x8828], edi
push ebx
jne 0x405b1f
push str._HttpDownloader____s__Copying_proxy_settings._n
call fcn.00408291
mov eax, dword [esi + 0x18]
pop ecx
pop ecx
mov ecx, dword [eax]
mov eax, dword [0x539fe4]
mov dword [eax], ecx
mov ecx, dword [esi + 0x18]
jmp 0x405b3a
push str._HttpDownloader____s__Using_override_proxy_settings._n
call fcn.00408291
mov eax, dword [0x539fe4]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x8828]
mov edx, dword [ecx]
mov dword [eax], edx
mov ecx, dword [ecx + 4]
mov dword [eax + 4], ecx
jmp 0x405bb2
push str._HttpDownloader____s__No_proxy_settings_detected._n
call fcn.00408291
push str.Proxy_Non_Auto
push ebx
call fcn.00418f50
add esp, 0x10
test eax, eax
jne 0x405ba6
cmp dword [0x539fe4], edi
jne 0x405ba6
cmp dword [esi + 0x18], edi
je 0x405ba6
push ebx
push str._HttpDownloader____s___Special_Case__No_existing_proxy_settings_found._n
call fcn.00408291
push 8
call fcn.00416db0
add esp, 0xc
push 8
push edi
push eax
mov dword [0x539fe4], eax
call fcn.00418c50
mov eax, dword [esi + 0x18]
mov ecx, dword [eax]
mov eax, dword [0x539fe4]
mov dword [eax], ecx
mov ecx, dword [esi + 0x18]
mov ecx, dword [ecx + 4]
add esp, 0xc
mov dword [eax + 4], ecx
push dword [ebp - 0x8810]
call fcn.0040540f
pop ecx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
push str._HttpDownloader____s__Starting_to_write_data_to_file..._n
call fcn.00408291
pop ecx
pop ecx
push dword [ebp - 0x8818]
lea eax, [ebp - 0x8808]
push dword [ebp - 0x8824]
push 1
push eax
call fcn.00419cec
add esp, 0x10
jmp 0x405bfd
push ebx
push str._HttpDownloader____s__Read_0_bytes_so_finishing._n
call fcn.00408291
pop ecx
pop ecx
mov dword [ebp - 0x8820], 1
cmp dword [ebp - 0x8820], edi
je 0x4059c4
cmp dword [ebp - 0x8814], edi
jle 0x405cbf
push dword [ebp - 0x8814]
push ebx
push str._HttpDownloader____s__Warning:_download_complete_but_required_length_is_still__d._n
call fcn.00408291
add esp, 0xc
xor esi, esi
push dword [ebp - 0x881c]
mov edi, dword [ebp - 0x8810]
push dword [ebp - 0x880c]
call fcn.004053eb
pop ecx
pop ecx
mov eax, esi
jmp 0x40557a
push ebx
push str._HttpDownloader____s__Thread_returning_as_another_has_worked_n
call fcn.00408291
push dword [ebp - 0x881c]
mov edi, dword [ebp - 0x8810]
push dword [ebp - 0x880c]
call fcn.004053eb
add esp, 0x10
push dword [esi]
jmp 0x405930
push dword [esi + 0x14]
push ebx
push str._Error____s__The_file__s_was_not_opened_n
call fcn.00408291
mov edi, dword [ebp - 0x8810]
add esp, 0xc
push dword [ebp - 0x881c]
push dword [ebp - 0x880c]
call fcn.004053eb
pop ecx
pop ecx
jmp 0x405c70
push 0x4330b0
call fcn.0040526f
pop ecx
push dword [ebp - 0x881c]
push dword [ebp - 0x880c]
jmp 0x405734
lea eax, [ebp - 0x8838]
push eax
call fcn.0041a731
cmp dword [ebp - 0x8818], edi
pop ecx
je 0x405d1f
push dword [ebp - 0x883c]
push dword [ebp - 0x8840]
push dword [ebp - 0x8834]
push dword [ebp - 0x8838]
call fcn.0041adc3
pop ecx
pop ecx
fstp qword [esp]
push ebx
push str._HttpDownloader____s__Closing_file...__download_took__lf__n
call fcn.00408291
push dword [ebp - 0x8818]
call fcn.0041a6b5
add esp, 0x14
push 0x64
call fcn.00407824
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor esi, esi
inc esi
jmp 0x405c2b