Function at 0x406e00
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
Resolve function by parsing pe exports
Send data
Send http request
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
mov eax, 0x88b4
call fcn.004180a0
mov eax, dword [0x421420]
xor eax, esp
mov dword [esp + 0x88b0], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov esi, ecx
mov ebx, edx
push esi
push str._HttpDownloader____s___1__Starting_download..._n
mov dword [esp + 0x44], ebx
mov dword [esp + 0x54], edi
call fcn.0040a3e4
call fcn.00409e01
add eax, 0x20
push eax
call fcn.0040a0fa
add esp, 0xc
cmp dword [ebp + 0xc], 0
mov dword [esp + 0x34], 0
push 0
je 0x406e7d
test edi, edi
jne 0x406e70
mov eax, dword [ebx + 0x18]
mov ecx, dword [eax + 4]
mov edx, dword [eax]
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
jmp 0x406e85
mov ecx, dword [edi + 4]
mov edx, dword [edi]
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
jmp 0x406e85
mov ecx, dword [ebp + 8]
push 0
push 0
push ecx
push str.JWrapperDownloader
call dword [sym.imp.WININET.dll_InternetOpenA]
test eax, eax
mov dword [esp + 0x30], eax
push esi
jne 0x406ec7
push str._HttpDownloader____s__Unable_initialise_HTTP_connection_n
call fcn.0040a3e4
add esp, 8
mov edi, str.InternetOpen
call fcn.00406bd0
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
push str._HttpDownloader____s__Attempting_to_crack_URL_n
call fcn.0040a3e4
push 0x3c
lea edx, [esp + 0x88]
push 0
push edx
call fcn.0040fa70
mov ecx, dword [ebx + 0x10]
mov eax, 1
add esp, 0x14
mov dword [esp + 0x90], eax
mov dword [esp + 0xac], eax
lea eax, [esp + 0x7c]
push eax
push 0
push 0
push ecx
mov dword [esp + 0x8c], 0x3c
call dword [sym.imp.WININET.dll_InternetCrackUrlA]
mov edi, eax
push edi
push esi
push str._HttpDownloader____s__Crack_result_is__d_n
call fcn.0040a3e4
add esp, 0xc
test edi, edi
je 0x407061
push 0x400
lea edx, [esp + 0xbc]
push 0
push edx
call fcn.0040fa70
add esp, 0xc
push 0x400
lea eax, [esp + 0x4bc]
push 0
push eax
call fcn.0040fa70
mov eax, dword [esp + 0x9c]
add esp, 0xc
test eax, eax
jbe 0x406f81
mov ecx, dword [esp + 0x8c]
push eax
push ecx
lea edx, [esp + 0xc0]
push edx
call fcn.0040a2c0
add esp, 0xc
mov eax, dword [esp + 0xac]
test eax, eax
jbe 0x406fa5
push eax
mov eax, dword [esp + 0xac]
push eax
lea ecx, [esp + 0x4c0]
push ecx
call fcn.0040a2c0
add esp, 0xc
lea edx, [esp + 0xb8]
push edx
push str._HttpDownloader__Hostname___s_n
call fcn.0040a3e4
movzx eax, word [esp + 0x9c]
push eax
push str._HttpDownloader__nPort___d_n
call fcn.0040a3e4
lea ecx, [esp + 0x4c8]
push ecx
push str._HttpDownloader__lpszUrlPath___s_n
call fcn.0040a3e4
mov edx, dword [esp + 0xac]
mov ecx, dword [esp + 0x48]
add esp, 0x18
push 0
push 0
push 3
push 0
push 0
push edx
lea eax, [esp + 0xd0]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetConnectA]
test eax, eax
mov dword [esp + 0x34], eax
jne 0x407038
mov edi, str.InternetConnect
call fcn.00406bd0
mov edx, dword [esp + 0x30]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
push 0
push 0x400000
push 0
push 0
push 0
lea ecx, [esp + 0x4cc]
push ecx
push 0x41e9a8
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
mov dword [esp + 0x40], ebx
jmp 0x40708b
mov edi, str.CrackURL
call fcn.00406bd0
mov edx, dword [ebx + 0x10]
mov eax, dword [esp + 0x30]
push 0
push 0x400800
push 0
push 0
push edx
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov dword [esp + 0x40], eax
mov ebx, eax
test ebx, ebx
jne 0x4070ca
mov edi, str.HttpOpenRequest_InternetOpenUrl
call fcn.00406bd0
mov edi, dword [esp + 0x30]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
cmp dword [esp + 0x34], ebx
je 0x4075eb
push edi
call esi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s___3__Starting_download..._n
call fcn.0040a3e4
call fcn.00409e01
add eax, 0x20
push eax
call fcn.0040a0fa
add esp, 0xc
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestA]
push ebx
call fcn.00406d00
lea ecx, [esp + 0x54]
add esp, 4
push ecx
mov edi, eax
call fcn.0040aee5
add esp, 4
push esi
push str._HttpDownloader____s___4__Starting_download..._n
call fcn.0040a3e4
call fcn.00409e01
add eax, 0x20
push eax
call fcn.0040a0fa
add esp, 0xc
cmp edi, 0x197
mov dword [esp + 0x38], 0
jne 0x40722b
cmp dword [esp + 0x38], 0
jne 0x40716a
mov edx, dword [esp + 0x3c]
mov eax, dword [edx + 4]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esp + 0x3c]
cmp dword [ecx + 0xc], 0
mov dword [esp + 0x38], 1
jne 0x407385
push edi
push esi
push str._HttpDownloader____s__Status_code_is__d_n
call fcn.0040a3e4
add esp, 0xc
call fcn.00409e01
add eax, 0x20
push eax
call fcn.0040a0fa
add esp, 4
push 0
push 7
push 0x2eee
push ebx
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.WININET.dll_InternetErrorDlg]
mov edi, eax
push edi
push esi
push str._HttpDownloader____s__InternetErrorDlg_return_code_is__d_n
call fcn.0040a3e4
add esp, 0xc
cmp edi, 0x2f00
jne 0x4073c7
xor edi, edi
push edi
push edi
push edi
push edi
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestA]
lea edx, [esp + 0x5c]
push edx
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x4c]
push ecx
push 0x20000013
push ebx
mov dword [esp + 0x58], edi
mov dword [esp + 0x5c], 4
mov dword [esp + 0x70], edi
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x407200
mov edi, dword [esp + 0x44]
jmp 0x407203
or edi, 0xffffffff
cmp edi, 0x197
je 0x40713d
cmp dword [esp + 0x38], 0
je 0x40722b
mov eax, dword [esp + 0x3c]
mov ecx, dword [eax + 4]
push ecx
mov dword [eax + 0xc], 1
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push str._HttpDownloader____s__Connection_setup__querying_length_n
call fcn.0040a3e4
push ebx
call fcn.00406d50
mov edi, eax
add esp, 0xc
cmp edi, 0xffffffff
je 0x4075c4
push edi
push esi
push str._HttpDownloader____s__Required_file_size_is__d_n
mov dword [esp + 0x44], 0
mov dword [esp + 0x54], edi
call fcn.0040a3e4
add esp, 0xc
call fcn.00409e01
add eax, 0x20
push eax
call fcn.0040a0fa
add esp, 4
push 0x8000
lea edx, [esp + 0x8bc]
push 0
push edx
call fcn.0040fa70
lea eax, [esp + 0x6c]
add esp, 0xc
push eax
call fcn.0040aee5
add esp, 4
test edi, edi
jle 0x407446
mov eax, edi
imul eax, eax, 0x64
cdq
idiv dword [esp + 0x48]
mov ebx, 0x64
sub ebx, eax
call fcn.004092c0
mov eax, dword [esp + 0x40]
lea ecx, [esp + 0x44]
push ecx
push 0x8000
lea edx, [esp + 0x8c0]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40743a
mov eax, dword [esp + 0x44]
sub edi, eax
test eax, eax
jbe 0x40743a
cmp dword [esp + 0x38], 0
jne 0x407422
mov ebx, dword [esp + 0x3c]
mov ecx, dword [ebx]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [ebx + 8], 0
jne 0x40753b
mov edx, dword [ebx + 0x14]
push 0x41ebd8
push edx
lea eax, [esp + 0x40]
push eax
call fcn.0040a580
add esp, 0xc
test eax, eax
jne 0x40757c
push 1
push esi
push str._HttpDownloader____s__Opened_file._Set_downloadWorked_to_TRUE___d__n
mov dword [ebx + 8], 1
call fcn.0040a3e4
add esp, 0xc
cmp dword [ebp + 0xc], 0
je 0x4073fd
push 8
call fcn.00409680
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x50]
add esp, 4
test ecx, ecx
mov dword [0x42f6dc], eax
jne 0x4073f1
mov ecx, dword [ebx + 0x18]
mov edx, dword [ecx]
mov dword [eax], edx
mov ecx, dword [ebx + 0x18]
mov edx, dword [ecx + 4]
mov dword [eax + 4], edx
jmp 0x407407
push esi
push str._HttpDownloader____s__Proxy_thread_returning_as_another_has_connected_to_the_proxy_n
call fcn.0040a3e4
mov edx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
push edx
push ebx
call fcn.00406dd0
mov eax, dword [esp + 0x4c]
mov ecx, dword [eax + 4]
add esp, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x3c]
mov edx, dword [eax + 4]
push edx
mov dword [eax + 0xc], 1
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push str._HttpDownloader____s__Could_not_get_proxy_credentials._n
call fcn.0040a3e4
mov eax, dword [esp + 0x3c]
push eax
jmp 0x4075de
mov edx, dword [ecx]
mov dword [eax], edx
mov ecx, dword [ecx + 4]
mov dword [eax + 4], ecx
jmp 0x407407
mov dword [0x42f6dc], 0
mov edx, dword [ebx]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push str._HttpDownloader____s__Starting_to_write_data_to_file..._n
call fcn.0040a3e4
mov eax, dword [esp + 0x4c]
add esp, 8
mov ecx, dword [esp + 0x38]
push ecx
push eax
lea edx, [esp + 0x8c0]
push 1
push edx
call fcn.0040a98e
add esp, 0x10
test edi, edi
jg 0x4072a2
mov ebx, dword [esp + 0x40]
lea ecx, [esp + 0x50]
push ecx
call fcn.0040aee5
mov edx, dword [esp + 0x68]
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x58]
add esp, 4
push edx
mov edx, dword [esp + 0x54]
push eax
push ecx
push edx
call fcn.0040b6d5
fstp qword [esp + 8]
add esp, 8
push esi
push str._HttpDownloader____s__Closing_file...__download_took__lf__n
call fcn.0040a3e4
mov eax, dword [esp + 0x48]
push eax
call fcn.0040ae69
add esp, 0x14
cmp dword [0x422840], 0xffffff9c
jne 0x4074d1
mov edx, dword [0x422810]
lea ecx, [esp + 0x6c]
push ecx
push edx
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
push 0x40
sub ecx, eax
add ecx, 0x12
push ecx
mov ecx, dword [esp + 0x74]
sub edx, ecx
push edx
push eax
mov eax, dword [0x422810]
push ecx
push 0
push eax
call dword [sym.imp.USER32.dll_SetWindowPos]
mov ecx, dword [0x422824]
mov edx, dword [0x422810]
push ecx
push edx
mov dword [0x422840], 0x64
call dword [sym.imp.USER32.dll_KillTimer]
mov eax, dword [0x422810]
push 0
push 0
push 0xf
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [esp + 0x3c]
mov edx, dword [ecx + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esp + 0x34]
mov esi, dword [esp + 0x30]
push eax
push ebx
call fcn.00406dd0
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s__Thread_returning_as_another_has_worked_n
call fcn.0040a3e4
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x48]
mov esi, dword [esp + 0x38]
push eax
push ecx
call fcn.00406dd0
mov edx, dword [ebx]
add esp, 0x10
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x14]
push eax
push esi
push str._Error____s__The_file__s_was_not_opened_n
call fcn.0040a3e4
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x3c]
add esp, 0xc
push ecx
push edx
call fcn.00406dd0
mov eax, dword [ebx]
add esp, 8
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409594
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s__Could_not_connect._n
call fcn.0040a3e4
mov edi, str.HttpQueryInfo
call fcn.00406bd0
mov ecx, dword [esp + 0x3c]
push ecx
mov esi, dword [esp + 0x3c]
push ebx
call fcn.00406dd0
add esp, 0x10
mov ecx, dword [esp + 0x88bc]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.00409594
mov esp, ebp
pop ebp
ret