Function at 0x4056bd
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.0041bc70
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 0x40571b
push eax
push ebx
call fcn.00418a20
test eax, eax
pop ecx
pop ecx
je 0x40571b
push ebx
push str._HttpDownloader____s__Skipping_for_debug_purposes._n
call fcn.0040855c
pop ecx
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416fa4
leave
ret
push ebx
push str._HttpDownloader____s___1__Starting_download..._n
call fcn.0040855c
cmp dword [ebp + 0x10], edi
pop ecx
pop ecx
mov dword [ebp - 0x8818], edi
push edi
je 0x405748
mov eax, dword [ebp - 0x8828]
cmp eax, edi
jne 0x405741
mov eax, dword [esi + 0x18]
push dword [eax + 4]
push dword [eax]
jmp 0x40574a
push edi
push edi
push dword [ebp + 0xc]
push str.JWrapperDownloader
call dword [sym.imp.WININET.dll_InternetOpenA]
cmp eax, edi
mov dword [ebp - 0x8814], eax
push ebx
jne 0x405781
push str._HttpDownloader____s__Unable_initialise_HTTP_connection_n
call fcn.0040855c
push str.InternetOpen
push str.HttpDownloader
call fcn.00407d64
add esp, 0x10
jmp 0x40570a
push str._HttpDownloader____s__Attempting_to_crack_URL_n
call fcn.0040855c
push 0x3c
lea eax, [ebp - 0x887c]
push edi
push eax
call fcn.00418720
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
mov dword [ebp - 0x8810], edi
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.0040855c
add esp, 0xc
cmp dword [ebp - 0x8820], edi
je 0x40593d
push 0x400
lea eax, [ebp - 0x408]
push edi
push eax
call fcn.00418720
add esp, 0xc
push 0x400
lea eax, [ebp - 0x808]
push edi
push eax
call fcn.00418720
add esp, 0xc
cmp dword [ebp - 0x8868], edi
jbe 0x40583c
push dword [ebp - 0x8868]
lea eax, [ebp - 0x408]
push dword [ebp - 0x886c]
push eax
call fcn.004185f0
add esp, 0xc
cmp dword [ebp - 0x884c], edi
jbe 0x40585f
push dword [ebp - 0x884c]
lea eax, [ebp - 0x808]
push dword [ebp - 0x8850]
push eax
call fcn.004185f0
add esp, 0xc
cmp dword [ebp - 0x8870], 4
jne 0x405872
mov dword [ebp - 0x8810], 1
lea eax, [ebp - 0x408]
push eax
push str._HttpDownloader__Hostname___s_n
call fcn.0040855c
movzx eax, word [ebp - 0x8864]
push eax
push str._HttpDownloader__nPort___d_n
call fcn.0040855c
lea eax, [ebp - 0x808]
push eax
push str._HttpDownloader__lpszUrlPath___s_n
call fcn.0040855c
push dword [ebp - 0x8810]
push str._HttpDownloader__secure___d_n
call fcn.0040855c
add esp, 0x20
push edi
push edi
push 3
push edi
push edi
push dword [ebp - 0x8864]
lea eax, [ebp - 0x408]
push eax
push dword [ebp - 0x8814]
call dword [sym.imp.WININET.dll_InternetConnectA]
cmp eax, edi
mov dword [ebp - 0x8818], eax
jne 0x405908
push str.InternetConnect
push str.HttpDownloader
call fcn.00407d64
push dword [ebp - 0x8818]
push edi
mov edi, dword [ebp - 0x8814]
call fcn.0040557d
jmp 0x40577c
cmp dword [ebp - 0x8810], edi
mov eax, 0x400000
je 0x40591a
mov eax, 0xc00000
push edi
push eax
push edi
push edi
push str.HTTP_1.1
lea eax, [ebp - 0x808]
push eax
push 0x431f28
push dword [ebp - 0x8818]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
jmp 0x405965
push str.CrackURL
push str.HttpDownloader
call fcn.00407d64
pop ecx
pop ecx
push edi
push 0x400800
push edi
push edi
push dword [esi + 0x10]
push dword [ebp - 0x8814]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
cmp eax, edi
mov dword [ebp - 0x880c], eax
jne 0x405979
push str.HttpOpenRequest_InternetOpenUrl
jmp 0x4058e7
push ebx
push str._HttpDownloader____s___3__Starting_download..._n
call fcn.0040855c
pop ecx
pop ecx
push edi
push edi
push edi
push edi
push dword [ebp - 0x880c]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x405a39
lea eax, [ebp - 0x8820]
push eax
lea eax, [ebp - 0x8810]
push eax
push 0x1f
push dword [ebp - 0x880c]
mov dword [ebp - 0x8820], 4
call dword [sym.imp.WININET.dll_InternetQueryOptionA]
or dword [ebp - 0x8810], 0x3180
push 4
lea eax, [ebp - 0x8810]
push eax
push 0x1f
push dword [ebp - 0x880c]
call dword [sym.imp.WININET.dll_InternetSetOptionA]
test eax, eax
jne 0x405a05
push str.InternetSetOption
push str.HttpDownloader
call fcn.00407d64
push str._HttpDownloader__Unable_to_set_internet_option_correctly
call fcn.0040855c
add esp, 0xc
push edi
push edi
push edi
push edi
push dword [ebp - 0x880c]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x405a39
push str.HttpSendRequest
push str.HttpDownloader
call fcn.00407d64
push dword [ebp - 0x8818]
push dword [ebp - 0x880c]
jmp 0x4058f8
push dword [ebp - 0x880c]
call fcn.004054e5
mov dword [ebp - 0x8810], eax
pop ecx
lea eax, [ebp - 0x8838]
push eax
call fcn.0041a11b
pop ecx
push ebx
push str._HttpDownloader____s___4__Starting_download..._n
call fcn.0040855c
cmp dword [ebp - 0x8810], 0x197
pop ecx
pop ecx
mov dword [ebp - 0x881c], edi
jne 0x405b3a
cmp dword [ebp - 0x881c], edi
jne 0x405aa1
push 0xffffffffffffffff
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [esi + 0xc], edi
mov dword [ebp - 0x881c], 1
jne 0x405b8b
push dword [ebp - 0x8810]
push ebx
push str._HttpDownloader____s__Status_code_is__d_n
call fcn.0040855c
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.0040855c
add esp, 0xc
cmp dword [ebp - 0x8820], 0x2f00
jne 0x405bbe
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.004054e5
cmp eax, 0x197
pop ecx
mov dword [ebp - 0x8810], eax
je 0x405a7b
cmp dword [ebp - 0x881c], edi
je 0x405b3a
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.0040855c
push dword [ebp - 0x880c]
call fcn.00405522
add esp, 0xc
cmp eax, 0xffffffff
mov dword [ebp - 0x881c], eax
mov dword [ebp - 0x8830], edi
mov dword [ebp - 0x882c], edi
je 0x405bde
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.0040855c
add esp, 0xc
jmp 0x405beb
push ebx
push str._HttpDownloader____s__Proxy_thread_returning_as_another_has_connected_to_the_proxy_n
call fcn.0040855c
push dword [ebp - 0x8818]
mov edi, dword [ebp - 0x8814]
push dword [ebp - 0x880c]
call fcn.0040557d
add esp, 0x10
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x40570a
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.0040855c
jmp 0x405a28
push ebx
push str._HttpDownloader____s__Required_file_size_is_unknown__n
call fcn.0040855c
pop ecx
pop ecx
push 0x8000
lea eax, [ebp - 0x8808]
push edi
push eax
mov dword [ebp - 0x8810], edi
call fcn.00418720
lea eax, [ebp - 0x8840]
add esp, 0xc
push eax
call fcn.0041a11b
cmp dword [ebp - 0x882c], edi
pop ecx
mov dword [ebp - 0x8820], edi
je 0x405c2d
cmp dword [ebp - 0x881c], edi
je 0x405f16
push ebx
push str._HttpDownloader____s__Looping..._n
call fcn.0040855c
cmp dword [ebp - 0x882c], edi
pop ecx
pop ecx
je 0x405c5a
mov eax, dword [ebp - 0x881c]
imul eax, eax, 0x64
cdq
idiv dword [ebp - 0x8830]
push 0x64
pop ecx
sub ecx, eax
push ecx
jmp 0x405c5c
push 0xffffffffffffffff
call fcn.00407a7b
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 0x405f0c
push dword [ebp - 0x8824]
push ebx
push str._HttpDownloader____s__Read__d..._n
call fcn.0040855c
mov eax, dword [ebp - 0x8824]
sub dword [ebp - 0x881c], eax
add esp, 0xc
cmp eax, edi
jbe 0x405e4f
cmp dword [ebp - 0x8810], edi
jne 0x405e30
push 0xffffffffffffffff
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
push str._HttpDownloader____s__OutputFile_needs_initialising._n
call fcn.0040855c
cmp dword [esi + 8], edi
pop ecx
pop ecx
jne 0x405eb4
push 0x432270
push dword [esi + 0x14]
lea eax, [ebp - 0x8810]
push eax
call fcn.00418593
add esp, 0xc
test eax, eax
jne 0x405ee0
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.0040855c
add esp, 0xc
cmp dword [ebp + 0x10], edi
push ebx
je 0x405dab
push str._HttpDownloader____s__Copying_proxy_settings._n
call fcn.0040855c
cmp dword [0x539fe4], edi
pop ecx
pop ecx
push ebx
je 0x405d3d
push str._HttpDownloader____s__Proxy_settings_exist_already._n
call fcn.0040855c
pop ecx
jmp 0x405e1a
push str._HttpDownloader____s__No_existing_proxy_settings_found._n
call fcn.0040855c
push 8
call fcn.00417090
add esp, 0xc
push 8
push edi
push eax
mov dword [0x539fe4], eax
call fcn.00418720
add esp, 0xc
cmp dword [ebp - 0x8828], edi
push ebx
jne 0x405d88
push str._HttpDownloader____s__Copying_proxy_settings._n
call fcn.0040855c
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 0x405da3
push str._HttpDownloader____s__Using_override_proxy_settings._n
call fcn.0040855c
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 0x405e1b
push str._HttpDownloader____s__No_proxy_settings_detected._n
call fcn.0040855c
push str.Proxy_Non_Auto
push ebx
call fcn.00418a20
add esp, 0x10
test eax, eax
jne 0x405e0f
cmp dword [0x539fe4], edi
jne 0x405e0f
cmp dword [esi + 0x18], edi
je 0x405e0f
push ebx
push str._HttpDownloader____s___Special_Case__No_existing_proxy_settings_found._n
call fcn.0040855c
push 8
call fcn.00417090
add esp, 0xc
push 8
push edi
push eax
mov dword [0x539fe4], eax
call fcn.00418720
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 - 0x8814]
call fcn.004055a1
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.0040855c
pop ecx
pop ecx
push dword [ebp - 0x8810]
lea eax, [ebp - 0x8808]
push dword [ebp - 0x8824]
push 1
push eax
call fcn.004197bc
add esp, 0x10
jmp 0x405e66
push ebx
push str._HttpDownloader____s__Read_0_bytes_so_finishing._n
call fcn.0040855c
pop ecx
pop ecx
mov dword [ebp - 0x8820], 1
cmp dword [ebp - 0x8820], edi
je 0x405c2d
cmp dword [ebp - 0x881c], edi
jle 0x405f16
push dword [ebp - 0x881c]
push ebx
push str._HttpDownloader____s__Warning:_download_complete_but_required_length_is_still__d._n
call fcn.0040855c
add esp, 0xc
xor esi, esi
push dword [ebp - 0x8818]
mov edi, dword [ebp - 0x8814]
push dword [ebp - 0x880c]
call fcn.0040557d
pop ecx
pop ecx
mov eax, esi
jmp 0x40570c
push ebx
push str._HttpDownloader____s__Thread_returning_as_another_has_worked_n
call fcn.0040855c
push dword [ebp - 0x8818]
mov edi, dword [ebp - 0x8814]
push dword [ebp - 0x880c]
call fcn.0040557d
add esp, 0x10
push dword [esi]
jmp 0x405bb3
push dword [esi + 0x14]
push ebx
push str._Error____s__The_file__s_was_not_opened_n
call fcn.0040855c
mov edi, dword [ebp - 0x8814]
add esp, 0xc
push dword [ebp - 0x8818]
push dword [ebp - 0x880c]
call fcn.0040557d
pop ecx
pop ecx
jmp 0x405ed9
push 0x4324c0
jmp 0x405a1e
lea eax, [ebp - 0x8838]
push eax
call fcn.0041a11b
cmp dword [ebp - 0x8810], edi
pop ecx
je 0x405f76
push dword [ebp - 0x883c]
push dword [ebp - 0x8840]
push dword [ebp - 0x8834]
push dword [ebp - 0x8838]
call fcn.0041a7a3
pop ecx
pop ecx
fstp qword [esp]
push ebx
push str._HttpDownloader____s__Closing_file...__download_took__lf__n
call fcn.0040855c
push dword [ebp - 0x8810]
call fcn.0041a09f
add esp, 0x14
push 0x64
call fcn.00407a7b
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor esi, esi
inc esi
jmp 0x405e94