Function at 0x4016bd
Capabilities:
Check http status code
Connect to http server
Create http request
Download and write a file
Download url
Get file size
Get http content length
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
push 0xffffffffffffffff
push 0x41f698
push 0x410fa4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
mov eax, 0x6624
call fcn.00411570
push ebx
push esi
push edi
mov dword [ebp - 0x1c], ecx
xor ebx, ebx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x20], ebx
or dword [ebp - 0x24], 0xffffffff
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x70], ebx
mov dword [ebp - 4], ebx
mov byte [ebp - 0x1a9c], bl
mov esi, dword [ebp + 8]
push esi
lea eax, [ebp - 0x1a9c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
push str.file:__
push esi
call fcn.004114e0
pop ecx
pop ecx
test eax, eax
je 0x401740
push ebx
push ebx
push dword [ebp + 0xc]
push esi
push ebx
call sub.urlmon.dll_URLDownloadToFileA
mov dword [ebp - 0x28], ebx
jmp 0x402173
push str.https:__
push esi
call fcn.004114e0
pop ecx
pop ecx
test eax, eax
je 0x401758
mov dword [ebp - 0x70], 1
mov dword [ebp - 0x38], ebx
cmp dword [ebp + 0x14], ebx
je 0x4017b5
push 0x3ee
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_GetDlgItem]
mov dword [ebp - 0x84], eax
mov dword [ebp - 0xec], eax
mov dword [ebp - 0x38], eax
mov esi, 0x400
push esi
lea eax, [ebp - 0xa9c]
push eax
push 0xbb8
push dword [0x4283a4]
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x84]
call dword [sym.imp.USER32.dll_SetWindowTextA]
jmp 0x4017c0
mov esi, 0x400
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
push esi
lea eax, [ebp - 0x169c]
push eax
call fcn.0040fde4
pop ecx
pop ecx
push ebx
push ebx
push ebx
push ebx
lea eax, [ebp - 0x169c]
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x50], eax
cmp eax, ebx
jne 0x4017f3
mov dword [ebp - 0x28], 1
jmp 0x402173
push 0x3c
push ebx
lea eax, [ebp - 0xc8]
push eax
call fcn.00410ef0
add esp, 0xc
mov dword [ebp - 0xc8], 0x3c
lea eax, [ebp - 0x429c]
mov dword [ebp - 0xb8], eax
mov dword [ebp - 0xb4], esi
mov word [ebp - 0xb0], bx
lea eax, [ebp - 0x469c]
mov dword [ebp - 0x9c], eax
mov dword [ebp - 0x98], esi
lea eax, [ebp - 0x169c]
mov dword [ebp - 0x94], eax
mov dword [ebp - 0x90], esi
lea eax, [ebp - 0xc8]
push eax
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
push eax
push dword [ebp + 8]
call dword [sym.imp.WININET.dll_InternetCrackUrlA]
cmp dword [ebp + 0x14], ebx
je 0x401891
push esi
lea eax, [ebp - 0xa9c]
push eax
push 0xbb9
push dword [0x4283a4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push ebx
push ebx
push 3
mov eax, 0x41f682
push eax
push eax
push dword [ebp - 0xb0]
push dword [ebp - 0xb8]
push dword [ebp - 0x50]
call dword [sym.imp.WININET.dll_InternetConnectA]
mov dword [ebp - 0x48], eax
cmp eax, ebx
je 0x4017e7
lea eax, [ebp - 0x3a9c]
cmp dword [ebp - 0x98], ebx
je 0x4018d2
push dword [ebp - 0x9c]
jmp 0x4018d7
push 0x41f680
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
cmp dword [ebp - 0x90], ebx
je 0x4018f9
push dword [ebp - 0x94]
lea eax, [ebp - 0x3a9c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea eax, [ebp - 0x3a9c]
push eax
push ebx
call fcn.0040d674
pop ecx
pop ecx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x4c], 0x3c
mov dword [ebp - 0x44], ebx
cmp dword [ebp + 0x14], ebx
je 0x401942
push esi
lea eax, [ebp - 0xa9c]
push eax
push 0xbba
push dword [0x4283a4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
lea eax, [ebp - 0x3a9c]
push ebx
cmp dword [ebp - 0x70], ebx
je 0x401955
push 0x4c00000
jmp 0x40195a
push 0x4400000
push ebx
push 0x41f682
push str.HTTP_1.1
push eax
push 0x41f670
push dword [ebp - 0x48]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [ebp - 0x20], eax
cmp eax, ebx
je 0x4017e7
push ebx
push 0x20
push 4
push ebx
push ebx
push 0x40000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
je 0x4017e7
push ebx
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov dword [ebp - 0x34], eax
cmp dword [ebp + 0x10], ebx
jne 0x4019b3
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x6c], ebx
cmp dword [ebp - 0x34], ebx
je 0x401a52
cmp dword [ebp - 0x34], 0xffffffff
je 0x401a52
lea eax, [ebp - 0x8c]
push eax
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_GetFileTime]
test eax, eax
je 0x401a52
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x8c]
push eax
call dword [sym.imp.KERNEL32.DLL_FileTimeToSystemTime]
push 0x1e
lea eax, [ebp - 0x138]
push eax
push ebx
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.WININET.dll_InternetTimeFromSystemTime]
lea eax, [ebp - 0x138]
push eax
push dword [ebp - 0x34]
push str.Range:_bytes_d__r_nIf_Range:__s_r_n
lea eax, [ebp - 0x19c]
push eax
call fcn.0041136c
add esp, 0x10
push 0xa0000000
lea eax, [ebp - 0x19c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
push eax
lea eax, [ebp - 0x19c]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersA]
mov dword [ebp - 0x6c], 1
mov dword [ebp - 0x30], 1
cmp dword [ebp + 0x14], ebx
je 0x401a83
push esi
lea eax, [ebp - 0xa9c]
push eax
push 0xbbb
push dword [0x4283a4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x401b75
cmp dword [ebp - 0x30], ebx
je 0x4017e7
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebp - 0xd0], eax
mov ecx, eax
sub ecx, 0x2ee2
je 0x401ae4
sub ecx, 5
je 0x401ae4
sub ecx, 0x16
je 0x401ae4
mov dword [ebp - 0x30], ebx
push ebx
push 7
push eax
push dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.WININET.dll_InternetErrorDlg]
test eax, eax
jne 0x401a83
mov dword [ebp - 0x30], 1
jmp 0x401a83
mov dword [ebp - 0x30], ebx
mov ecx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 0x80]
mov dword [ebp - 0xcc], ecx
cmp ecx, ebx
jne 0x401a83
push esi
cmp eax, 0x2ee2
jne 0x401b10
lea eax, [ebp - 0x129c]
push eax
push 0x198
jmp 0x401b21
cmp eax, 0x2ee7
lea eax, [ebp - 0x129c]
push eax
push 0x7eb
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x2a9c]
push eax
push 0x7d4
push dword [0x4283a4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x80]
mov dword [ebp - 0xd8], eax
cmp eax, ebx
jne 0x401a83
push ebx
lea eax, [ebp - 0x2a9c]
push eax
lea eax, [ebp - 0x129c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x401a83
cmp dword [ebp - 0x30], ebx
je 0x4017e7
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x5c], 4
push ebx
lea eax, [ebp - 0x5c]
push eax
lea eax, [ebp - 0x2c]
push eax
push 0x20000013
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x401bb5
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x30], 1
mov eax, dword [ebp - 0x2c]
cmp eax, 0x197
je 0x401bcd
cmp eax, 0x191
jne 0x401c33
cmp dword [ebp - 0x30], ebx
je 0x401c33
push ebx
push 7
push dword [ebp - 0x68]
push dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.WININET.dll_InternetErrorDlg]
mov dword [ebp - 0xd4], eax
cmp eax, 0x4c7
je 0x401c2e
cmp eax, ebx
jne 0x401c01
cmp dword [ebp - 0x2c], 0x197
je 0x401c2e
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
mov dword [ebp - 0x5c], 4
push ebx
lea eax, [ebp - 0x5c]
push eax
lea eax, [ebp - 0x2c]
push eax
push 0x20000013
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
jmp 0x401bbc
mov dword [ebp - 0x30], ebx
jmp 0x401bbc
cmp eax, 0xc8
je 0x401f6c
cmp eax, 0xce
je 0x401f6c
cmp eax, 0x1a0
jne 0x401c5f
cmp dword [ebp - 0x34], ebx
je 0x401c5f
cmp dword [ebp - 0x34], 0xffffffff
jne 0x401738
cmp eax, 0x190
jb 0x401f01
cmp eax, 0x258
jae 0x401f01
cmp eax, 0x193
jne 0x401ce1
mov eax, dword [ebp - 0x1c]
push esi
cmp dword [eax + 0x8c], ebx
lea eax, [ebp - 0xe9c]
push eax
je 0x401cab
push 0x7d4
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x59c]
push eax
push 0x193
jmp 0x401cc5
push 0x2bc
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x59c]
push eax
push 0x258
push dword [0x4283a4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x80]
mov dword [ebp - 0xe8], eax
jmp 0x401ed5
cmp eax, 0x1f4
jne 0x401d5a
push esi
lea eax, [ebp - 0xe9c]
push eax
push 0x2be
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x59c]
push eax
push 0x25a
push dword [0x4283a4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x80]
mov dword [ebp - 0xe4], eax
cmp eax, ebx
jne 0x401ef5
push 0x34
lea eax, [ebp - 0xe9c]
push eax
lea eax, [ebp - 0x59c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 6
jne 0x401ef5
mov dword [ebp - 0x44], 1
jmp 0x401ef5
cmp eax, 0x1f7
jne 0x401e4f
cmp dword [ebp - 0x54], 5
jge 0x401dd3
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], ebx
jl 0x401dca
cmp dword [ebp + 0x14], ebx
je 0x401dba
push esi
lea eax, [ebp - 0xa9c]
push eax
push 0xbbc
push dword [0x4283a4]
call edi
push dword [ebp - 0x58]
lea eax, [ebp - 0xa9c]
push eax
lea eax, [ebp - 0x1e9c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x1e9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push 0x3e8
call dword [sym.imp.KERNEL32.DLL_Sleep]
dec dword [ebp - 0x58]
jmp 0x401d71
inc dword [ebp - 0x54]
add dword [ebp - 0x4c], 0x1e
jmp 0x401e43
push esi
lea eax, [ebp - 0xe9c]
push eax
push 0x2bd
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x59c]
push eax
push 0x259
push dword [0x4283a4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x80]
mov dword [ebp - 0xf0], eax
cmp eax, ebx
jne 0x401ef5
push 0x34
lea eax, [ebp - 0xe9c]
push eax
lea eax, [ebp - 0x59c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 6
jne 0x401ef5
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x4c], 0x3c
mov dword [ebp - 0x44], 1
jmp 0x40216a
push esi
lea eax, [ebp - 0xe9c]
push eax
push 0x2be
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x59c]
push eax
push dword [ebp - 0x2c]
push dword [0x4283a4]
call edi
lea eax, [ebp - 0x59c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
test eax, eax
jne 0x401ea0
push dword [ebp - 0x2c]
push str.HTTP_ErrorCode_d
lea eax, [ebp - 0x59c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x41f634
lea eax, [ebp - 0x59c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea eax, [ebp - 0x1a9c]
push eax
lea eax, [ebp - 0x59c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x80]
mov dword [ebp - 0xf8], eax
cmp eax, ebx
jne 0x401ef5
lea eax, [ebp - 0xe9c]
push 0x40
push eax
lea eax, [ebp - 0x59c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
mov dword [ebp - 0x28], 1
jmp 0x40211f
push esi
lea eax, [ebp - 0x269c]
push eax
push 0x2bf
push dword [0x4283a4]
call edi
push esi
lea eax, [ebp - 0x3e9c]
push eax
push 0x25b
push dword [0x4283a4]
call edi
push dword [ebp - 0x2c]
lea eax, [ebp - 0x3e9c]
push eax
lea eax, [ebp - 0x229c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x80]
mov dword [ebp - 0xf4], eax
cmp eax, ebx
jne 0x401ef5
push 0x40
lea eax, [ebp - 0x269c]
push eax
lea eax, [ebp - 0x229c]
jmp 0x401ee8
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x78], 4
push ebx
lea eax, [ebp - 0x78]
push eax
lea eax, [ebp - 0x40]
push eax
push 0x20000005
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
cmp dword [ebp - 0x40], ebx
ja 0x401f9e
mov dword [ebp - 0x40], 0xe4e1c0
jmp 0x402053
cmp dword [ebp - 0x6c], ebx
je 0x402053
mov eax, dword [ebp - 0x34]
cmp eax, ebx
je 0x402053
cmp dword [ebp - 0x40], eax
jne 0x402053
mov dword [ebp - 0x74], 0x100
push ebx
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x69c]
push eax
push 0x35
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x402053
push ebx
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x69c]
push eax
push 0xb
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
push ebx
test eax, eax
je 0x40203f
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x69c]
push eax
call dword [sym.imp.WININET.dll_InternetTimeToSystemTime]
lea eax, [ebp - 0xe0]
push eax
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.DLL_SystemTimeToFileTime]
lea eax, [ebp - 0xe0]
push eax
lea eax, [ebp - 0x8c]
push eax
call dword [sym.imp.KERNEL32.DLL_CompareFileTime]
cmp eax, 1
jne 0x402053
jmp 0x401738
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_SetEndOfFile]
mov dword [ebp - 0x80], 0x1fa0
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x60], ebx
cmp dword [ebp - 0x2c], 0xce
jne 0x402082
mov eax, dword [ebp - 0x1c]
add dword [eax + 0x44], 0xffffff9c
push 2
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
jmp 0x402097
push ebx
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_SetEndOfFile]
mov dword [ebp - 0x3c], ebx
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x80]
lea eax, [ebp - 0x663c]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40210f
cmp dword [ebp - 0x3c], ebx
je 0x4020d5
mov dword [ebp - 0x7c], ebx
push ebx
lea eax, [ebp - 0x7c]
push eax
push dword [ebp - 0x3c]
lea eax, [ebp - 0x663c]
push eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0x64], eax
cmp dword [ebp + 0x14], ebx
je 0x4020f7
mov ecx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x34]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x64]
add ecx, eax
push ecx
push dword [ebp - 0x1c]
call fcn.00401668
push ebx
mov eax, dword [ebp - 0x1c]
push dword [eax + 0x70]
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
je 0x40210f
cmp dword [ebp - 0x3c], ebx
jne 0x402097
jmp 0x402116
mov dword [ebp - 0x60], 1
cmp dword [ebp - 0x60], ebx
jne 0x4017e7
cmp dword [ebp + 0x14], ebx
je 0x402149
push esi
lea eax, [ebp - 0xa9c]
push eax
push 0xbbd
push dword [0x4283a4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
cmp dword [ebp - 0x20], ebx
je 0x402157
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x24], 0xffffffff
je 0x40216a
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
or dword [ebp - 0x24], 0xffffffff
cmp dword [ebp - 0x44], ebx
jne 0x401915
or dword [ebp - 4], 0xffffffff
call fcn.0040219b
mov eax, dword [ebp - 0x28]
neg eax
sbb eax, eax
and eax, 0x80004005
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 0x10