Function at 0x406ea0
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.00417d80
mov eax, dword [0x4244e0]
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 + 0x68], ebx
mov dword [esp + 0x6c], edi
call fcn.004014a0
add esp, 8
cmp dword [ebp + 0xc], 0
mov dword [esp + 0x40], 0
push 0
je 0x406f0f
test edi, edi
jne 0x406f02
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 0x406f17
mov ecx, dword [edi + 4]
mov edx, dword [edi]
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
jmp 0x406f17
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 + 0x34], eax
push esi
jne 0x406f59
push str._HttpDownloader____s__Unable_initialise_HTTP_connection_n
call fcn.004014a0
add esp, 8
mov edi, str.InternetOpen
call fcn.00406c70
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409da6
mov esp, ebp
pop ebp
ret
push str._HttpDownloader____s__Attempting_to_crack_URL_n
call fcn.004014a0
push 0x3c
lea edx, [esp + 0x88]
push 0
push edx
call fcn.00411ad0
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.004014a0
add esp, 0xc
test edi, edi
je 0x4070f3
push 0x400
lea edx, [esp + 0x4bc]
push 0
push edx
call fcn.00411ad0
add esp, 0xc
push 0x400
lea eax, [esp + 0xbc]
push 0
push eax
call fcn.00411ad0
mov eax, dword [esp + 0x9c]
add esp, 0xc
test eax, eax
jbe 0x407013
mov ecx, dword [esp + 0x8c]
push eax
push ecx
lea edx, [esp + 0x4c0]
push edx
call fcn.0040b040
add esp, 0xc
mov eax, dword [esp + 0xac]
test eax, eax
jbe 0x407037
push eax
mov eax, dword [esp + 0xac]
push eax
lea ecx, [esp + 0xc0]
push ecx
call fcn.0040b040
add esp, 0xc
lea edx, [esp + 0x4b8]
push edx
push str._HttpDownloader__Hostname___s_n
call fcn.004014a0
movzx eax, word [esp + 0x9c]
push eax
push str._HttpDownloader__nPort___d_n
call fcn.004014a0
lea ecx, [esp + 0xc8]
push ecx
push str._HttpDownloader__lpszUrlPath___s_n
call fcn.004014a0
mov edx, dword [esp + 0xac]
mov ecx, dword [esp + 0x4c]
add esp, 0x18
push 0
push 0
push 3
push 0
push 0
push edx
lea eax, [esp + 0x4d0]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetConnectA]
test eax, eax
mov dword [esp + 0x40], eax
jne 0x4070ca
mov edi, str.InternetConnect
call fcn.00406c70
mov edx, dword [esp + 0x34]
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.00409da6
mov esp, ebp
pop ebp
ret
push 0
push 0x400000
push 0
push 0
push 0
lea ecx, [esp + 0xcc]
push ecx
push 0x420f80
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov edi, eax
mov dword [esp + 0x38], edi
jmp 0x40711d
mov edi, str.CrackURL
call fcn.00406c70
mov edx, dword [ebx + 0x10]
mov eax, dword [esp + 0x34]
push 0
push 0x400800
push 0
push 0
push edx
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov dword [esp + 0x38], eax
mov edi, eax
test edi, edi
jne 0x407159
mov edi, str.HttpOpenRequest_InternetOpenUrl
call fcn.00406c70
mov edi, dword [esp + 0x34]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
cmp dword [esp + 0x40], 0
je 0x407142
push edi
call esi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409da6
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s___3__Starting_download..._n
call fcn.004014a0
add esp, 8
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
push edi
call fcn.00406da0
lea ecx, [esp + 0x6c]
add esp, 4
push ecx
mov edi, eax
call fcn.0040cbfb
add esp, 4
push esi
push str._HttpDownloader____s___4__Starting_download..._n
call fcn.004014a0
add esp, 8
cmp edi, 0x197
mov dword [esp + 0x3c], 0
jne 0x40728d
cmp dword [esp + 0x3c], 0
jne 0x4071d5
mov edx, dword [ebx + 4]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [ebx + 0xc], 0
mov dword [esp + 0x3c], 1
jne 0x4072da
push edi
push esi
push str._HttpDownloader____s__Status_code_is__d_n
call fcn.004014a0
mov eax, dword [esp + 0x44]
add esp, 0xc
push 0
push 7
push 0x2eee
push eax
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.004014a0
add esp, 0xc
cmp edi, 0x2f00
jne 0x40731c
mov edi, dword [esp + 0x38]
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
xor eax, eax
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x4c]
push edx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x54], eax
lea eax, [esp + 0x4c]
push eax
push 0x20000013
push edi
mov dword [esp + 0x5c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x407266
mov edi, dword [esp + 0x44]
jmp 0x407269
or edi, 0xffffffff
cmp edi, 0x197
je 0x4071b0
cmp dword [esp + 0x3c], 0
je 0x40728d
mov ecx, dword [ebx + 4]
push ecx
mov dword [ebx + 0xc], 1
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push str._HttpDownloader____s__Connection_setup__querying_length_n
call fcn.004014a0
mov edx, dword [esp + 0x40]
push edx
call fcn.00406df0
mov edi, eax
xor eax, eax
add esp, 0xc
cmp edi, 0xffffffff
mov dword [esp + 0x48], eax
mov dword [esp + 0x44], eax
je 0x407365
push edi
push esi
push str._HttpDownloader____s__Required_file_size_is__d_n
mov dword [esp + 0x50], 1
mov dword [esp + 0x54], edi
call fcn.004014a0
add esp, 0xc
jmp 0x407373
push esi
push str._HttpDownloader____s__Proxy_thread_returning_as_another_has_connected_to_the_proxy_n
call fcn.004014a0
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x40]
mov esi, dword [esp + 0x3c]
push ecx
push edx
call fcn.00406e70
mov eax, dword [ebx + 4]
add esp, 0x10
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.00409da6
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebx + 4]
push ecx
mov dword [ebx + 0xc], 1
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push str._HttpDownloader____s__Could_not_get_proxy_credentials._n
call fcn.004014a0
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x40]
mov esi, dword [esp + 0x3c]
push edx
push eax
call fcn.00406e70
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409da6
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s__Required_file_size_is_unknown__n
call fcn.004014a0
add esp, 8
push 0x8000
lea eax, [esp + 0x8bc]
push 0
push eax
mov dword [esp + 0x48], 0
call fcn.00411ad0
lea ecx, [esp + 0x7c]
add esp, 0xc
push ecx
call fcn.0040cbfb
add esp, 4
cmp dword [esp + 0x44], 0
je 0x4073b0
test edi, edi
je 0x4075e0
mov edi, edi
push esi
push str._HttpDownloader____s__Looping..._n
call fcn.004014a0
add esp, 8
cmp dword [esp + 0x44], 0
je 0x4073e1
mov eax, edi
imul eax, eax, 0x64
cdq
idiv dword [esp + 0x48]
mov ebx, 0x64
sub ebx, eax
call fcn.004092d0
mov ebx, dword [esp + 0x60]
jmp 0x40744b
cmp dword [0x425c50], 0xffffff9c
jne 0x407426
mov eax, dword [0x425c20]
lea edx, [esp + 0x50]
push edx
push eax
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x58]
push 0x40
sub ecx, eax
add ecx, 0x12
push ecx
mov ecx, dword [esp + 0x58]
sub edx, ecx
push edx
push eax
mov eax, dword [0x425c20]
push ecx
push 0
push eax
call dword [sym.imp.USER32.dll_SetWindowPos]
mov ecx, dword [0x425c20]
push 0x408620
push 0x1e
push 0x64
push ecx
mov dword [0x425c50], 0xffffffff
call dword [sym.imp.USER32.dll_SetTimer]
mov dword [0x425c34], eax
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x4c]
push edx
push 0x8000
lea eax, [esp + 0x8c0]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4073b0
mov eax, dword [esp + 0x4c]
sub edi, eax
test eax, eax
jbe 0x4075e0
cmp dword [esp + 0x3c], 0
jne 0x40753a
mov edx, dword [ebx]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [ebx + 8], 0
jne 0x407557
mov eax, dword [ebx + 0x14]
push 0x42120c
push eax
lea ecx, [esp + 0x44]
push ecx
call fcn.0040afe9
add esp, 0xc
test eax, eax
jne 0x407598
push 1
push esi
push str._HttpDownloader____s__Opened_file._Set_downloadWorked_to_TRUE___d__n
mov dword [ebx + 8], 1
call fcn.004014a0
add esp, 0xc
cmp dword [ebp + 0xc], 0
je 0x407515
push 8
call fcn.00409e92
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x68]
add esp, 4
test ecx, ecx
mov dword [0x432b74], eax
jne 0x407509
mov edx, dword [ebx + 0x18]
mov ecx, dword [edx]
mov dword [eax], ecx
mov edx, dword [ebx + 0x18]
mov ecx, dword [edx + 4]
mov dword [eax + 4], ecx
jmp 0x40751f
mov edx, dword [ecx]
mov dword [eax], edx
mov ecx, dword [ecx + 4]
mov dword [eax + 4], ecx
jmp 0x40751f
mov dword [0x432b74], 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.004014a0
mov eax, dword [esp + 0x54]
add esp, 8
mov ecx, dword [esp + 0x3c]
push ecx
push eax
lea edx, [esp + 0x8c0]
push 1
push edx
call fcn.0040c11c
add esp, 0x10
jmp 0x4073b0
push esi
push str._HttpDownloader____s__Thread_returning_as_another_has_worked_n
call fcn.004014a0
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x40]
mov esi, dword [esp + 0x3c]
push eax
push ecx
call fcn.00406e70
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.00409da6
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.004014a0
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x44]
mov esi, dword [esp + 0x40]
add esp, 0xc
push ecx
push edx
call fcn.00406e70
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.00409da6
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x68]
push ecx
call fcn.0040cbfb
mov edx, dword [esp + 0x78]
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x70]
add esp, 4
push edx
mov edx, dword [esp + 0x6c]
push eax
push ecx
push edx
call fcn.0040d063
fstp qword [esp + 8]
add esp, 8
push esi
push str._HttpDownloader____s__Closing_file...__download_took__lf__n
call fcn.004014a0
mov eax, dword [esp + 0x4c]
add esp, 0x10
test eax, eax
je 0x40762c
push eax
call fcn.0040cb7f
add esp, 4
cmp dword [0x425c50], 0xffffff9c
jne 0x407672
mov ecx, dword [0x425c20]
lea eax, [esp + 0x50]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x54]
mov edx, dword [esp + 0x5c]
mov ecx, dword [esp + 0x50]
push 0x40
sub edx, eax
add edx, 0x12
push edx
mov edx, dword [esp + 0x60]
sub edx, ecx
push edx
push eax
mov eax, dword [0x425c20]
push ecx
push 0
push eax
call dword [sym.imp.USER32.dll_SetWindowPos]
mov ecx, dword [0x425c34]
mov edx, dword [0x425c20]
push ecx
push edx
mov dword [0x425c50], 0x64
call dword [sym.imp.USER32.dll_KillTimer]
mov eax, dword [0x425c20]
push 0
push 0
push 0xf
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [ebx + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x38]
mov esi, dword [esp + 0x34]
push edx
push eax
call fcn.00406e70
mov ecx, dword [esp + 0x88c4]
add esp, 8
pop edi
pop esi
pop ebx
xor ecx, esp
mov eax, 1
call fcn.00409da6
mov esp, ebp
pop ebp
ret