Function at 0x406c90
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.004170f0
mov eax, dword [0x4234e0]
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.00401480
add esp, 8
cmp dword [ebp + 0xc], 0
mov dword [esp + 0x34], 0
push 0
je 0x406cff
test edi, edi
jne 0x406cf2
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 0x406d07
mov ecx, dword [edi + 4]
mov edx, dword [edi]
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
jmp 0x406d07
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 0x406d49
push str._HttpDownloader____s__Unable_initialise_HTTP_connection_n
call fcn.00401480
add esp, 8
mov edi, str.InternetOpen
call fcn.00406a60
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409294
mov esp, ebp
pop ebp
ret
push str._HttpDownloader____s__Attempting_to_crack_URL_n
call fcn.00401480
push 0x3c
lea edx, [esp + 0x88]
push 0
push edx
call fcn.004109c0
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.00401480
add esp, 0xc
test edi, edi
je 0x406edf
push 0x400
lea edx, [esp + 0xbc]
push 0
push edx
call fcn.004109c0
add esp, 0xc
push 0x400
lea eax, [esp + 0x4bc]
push 0
push eax
call fcn.004109c0
mov eax, dword [esp + 0x9c]
add esp, 0xc
test eax, eax
jbe 0x406e03
mov ecx, dword [esp + 0x8c]
push eax
push ecx
lea edx, [esp + 0xc0]
push edx
call fcn.0040a230
add esp, 0xc
mov eax, dword [esp + 0xac]
test eax, eax
jbe 0x406e27
push eax
mov eax, dword [esp + 0xac]
push eax
lea ecx, [esp + 0x4c0]
push ecx
call fcn.0040a230
add esp, 0xc
lea edx, [esp + 0xb8]
push edx
push str._HttpDownloader__Hostname___s_n
call fcn.00401480
movzx eax, word [esp + 0x9c]
push eax
push str._HttpDownloader__nPort___d_n
call fcn.00401480
lea ecx, [esp + 0x4c8]
push ecx
push str._HttpDownloader__lpszUrlPath___s_n
call fcn.00401480
mov edx, dword [esp + 0xac]
mov ebx, 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 ebx
call dword [sym.imp.WININET.dll_InternetConnectA]
test eax, eax
mov dword [esp + 0x34], eax
jne 0x406eb6
mov edi, str.InternetConnect
call fcn.00406a60
push ebx
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.00409294
mov esp, ebp
pop ebp
ret
push 0
push 0x400000
push 0
push 0
push 0
lea ecx, [esp + 0x4cc]
push ecx
push 0x41fdc8
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
mov dword [esp + 0x40], ebx
jmp 0x406f09
mov edi, str.CrackURL
call fcn.00406a60
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 0x406f48
mov edi, str.HttpOpenRequest_InternetOpenUrl
call fcn.00406a60
mov edi, dword [esp + 0x30]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
cmp dword [esp + 0x34], ebx
je 0x40742b
push edi
call esi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409294
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s___3__Starting_download..._n
call fcn.00401480
add esp, 8
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestA]
push ebx
call fcn.00406b90
lea ecx, [esp + 0x54]
add esp, 4
push ecx
mov edi, eax
call fcn.0040bdeb
add esp, 4
push esi
push str._HttpDownloader____s___4__Starting_download..._n
call fcn.00401480
add esp, 8
cmp edi, 0x197
mov dword [esp + 0x38], 0
jne 0x40707c
cmp dword [esp + 0x38], 0
jne 0x406fcc
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 0x4071c5
push edi
push esi
push str._HttpDownloader____s__Status_code_is__d_n
call fcn.00401480
add esp, 0xc
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.00401480
add esp, 0xc
cmp edi, 0x2f00
jne 0x407207
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 0x407051
mov edi, dword [esp + 0x44]
jmp 0x407054
or edi, 0xffffffff
cmp edi, 0x197
je 0x406f9f
cmp dword [esp + 0x38], 0
je 0x40707c
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.00401480
push ebx
call fcn.00406be0
mov edi, eax
add esp, 0xc
cmp edi, 0xffffffff
je 0x407404
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.00401480
add esp, 0xc
push 0x8000
lea edx, [esp + 0x8bc]
push 0
push edx
call fcn.004109c0
lea eax, [esp + 0x6c]
add esp, 0xc
push eax
call fcn.0040bdeb
add esp, 4
test edi, edi
jle 0x407286
mov eax, edi
imul eax, eax, 0x64
cdq
idiv dword [esp + 0x48]
mov ebx, 0x64
sub ebx, eax
call fcn.00408f10
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 0x40727a
mov eax, dword [esp + 0x44]
sub edi, eax
test eax, eax
jbe 0x40727a
cmp dword [esp + 0x38], 0
jne 0x407262
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 0x40737b
mov edx, dword [ebx + 0x14]
push 0x41fff8
push edx
lea eax, [esp + 0x40]
push eax
call fcn.0040a1d1
add esp, 0xc
test eax, eax
jne 0x4073bc
push 1
push esi
push str._HttpDownloader____s__Opened_file._Set_downloadWorked_to_TRUE___d__n
mov dword [ebx + 8], 1
call fcn.00401480
add esp, 0xc
cmp dword [ebp + 0xc], 0
je 0x40723d
push 8
call fcn.00409380
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 [0x4316ec], eax
jne 0x407231
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 0x407247
push esi
push str._HttpDownloader____s__Proxy_thread_returning_as_another_has_connected_to_the_proxy_n
call fcn.00401480
mov edx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
push edx
push ebx
call fcn.00406c60
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.00409294
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.00401480
mov eax, dword [esp + 0x3c]
push eax
jmp 0x40741e
mov edx, dword [ecx]
mov dword [eax], edx
mov ecx, dword [ecx + 4]
mov dword [eax + 4], ecx
jmp 0x407247
mov dword [0x4316ec], 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.00401480
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.0040b30c
add esp, 0x10
test edi, edi
jg 0x4070e2
mov ebx, dword [esp + 0x40]
lea ecx, [esp + 0x50]
push ecx
call fcn.0040bdeb
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.0040c553
fstp qword [esp + 8]
add esp, 8
push esi
push str._HttpDownloader____s__Closing_file...__download_took__lf__n
call fcn.00401480
mov eax, dword [esp + 0x48]
push eax
call fcn.0040bd6f
add esp, 0x14
cmp dword [0x424850], 0xffffff9c
jne 0x407311
mov edx, dword [0x424820]
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 [0x424820]
push ecx
push 0
push eax
call dword [sym.imp.USER32.dll_SetWindowPos]
mov ecx, dword [0x424834]
mov edx, dword [0x424820]
push ecx
push edx
mov dword [0x424850], 0x64
call dword [sym.imp.USER32.dll_KillTimer]
mov eax, dword [0x424820]
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.00406c60
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88b0]
xor ecx, esp
call fcn.00409294
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s__Thread_returning_as_another_has_worked_n
call fcn.00401480
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x48]
mov esi, dword [esp + 0x38]
push eax
push ecx
call fcn.00406c60
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.00409294
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.00401480
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x3c]
add esp, 0xc
push ecx
push edx
call fcn.00406c60
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.00409294
mov esp, ebp
pop ebp
ret
push esi
push str._HttpDownloader____s__Could_not_connect._n
call fcn.00401480
mov edi, str.HttpQueryInfo
call fcn.00406a60
mov ecx, dword [esp + 0x3c]
push ecx
mov esi, dword [esp + 0x3c]
push ebx
call fcn.00406c60
add esp, 0x10
mov ecx, dword [esp + 0x88bc]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.00409294
mov esp, ebp
pop ebp
ret