Function at 0x40171c
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 0x41f888
push 0x41140c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
mov eax, 0x9224
call fcn.004118d0
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x1c], edi
xor esi, esi
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x20], esi
or dword [ebp - 0x24], 0xffffffff
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x70], esi
mov dword [ebp - 4], esi
push 0x41f6fc
push dword [ebp + 8]
call fcn.00411a80
pop ecx
pop ecx
test eax, eax
je 0x40178e
push esi
push esi
push dword [ebp + 0xc]
push dword [ebp + 8]
push esi
call sub.urlmon.dll_URLDownloadToFileA
mov dword [ebp - 0x28], esi
jmp 0x40217d
push 0x41f704
push dword [ebp + 8]
call fcn.00411a80
pop ecx
pop ecx
test eax, eax
je 0x4017a8
mov dword [ebp - 0x70], 1
mov dword [ebp - 0x38], esi
cmp dword [ebp + 0x14], esi
je 0x4017fd
push 0x3ee
push dword [edi + 4]
call dword [sym.imp.USER32.dll_GetDlgItem]
mov edi, eax
mov dword [ebp - 0xf0], edi
mov dword [ebp - 0xd8], edi
mov dword [ebp - 0x38], edi
mov ebx, 0x800
push ebx
lea eax, [ebp - 0xa9c]
push eax
push 0xbb8
push dword [0x427df4]
call dword [sym.imp.USER32.dll_LoadStringA]
lea eax, [ebp - 0xa9c]
push eax
push edi
call dword [sym.imp.USER32.dll_SetWindowTextA]
jmp 0x401802
mov ebx, 0x800
push ebx
lea eax, [ebp - 0x229c]
push eax
call fcn.00409021
pop ecx
pop ecx
push esi
push esi
push esi
push esi
lea eax, [ebp - 0x229c]
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x50], eax
cmp eax, esi
jne 0x401835
mov dword [ebp - 0x28], 1
jmp 0x40217d
push 0xf
pop ecx
xor eax, eax
lea edi, [ebp - 0xc4]
rep stosd dword es:[edi], eax
mov dword [ebp - 0xc4], 0x3c
lea eax, [ebp - 0x4a9c]
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xb0], ebx
mov word [ebp - 0xac], si
lea eax, [ebp - 0x5a9c]
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x94], ebx
lea eax, [ebp - 0x229c]
mov dword [ebp - 0x90], eax
mov dword [ebp - 0x8c], ebx
lea eax, [ebp - 0xc4]
push eax
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push dword [ebp + 8]
call dword [sym.imp.WININET.dll_InternetCrackUrlA]
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
cmp dword [ebp + 0x14], esi
je 0x4018d4
push ebx
lea eax, [ebp - 0xa9c]
push eax
push 0xbb9
push dword [0x427df4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push esi
push esi
push 3
push 0x41f70d
push 0x41f70e
push dword [ebp - 0xac]
push dword [ebp - 0xb4]
push dword [ebp - 0x50]
call dword [sym.imp.WININET.dll_InternetConnectA]
mov dword [ebp - 0x48], eax
cmp eax, esi
je 0x401829
lea eax, [ebp - 0x3a9c]
cmp dword [ebp - 0x94], esi
je 0x401918
push dword [ebp - 0x98]
jmp 0x40191d
push 0x41f710
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp dword [ebp - 0x8c], esi
je 0x40193f
push dword [ebp - 0x90]
lea eax, [ebp - 0x3a9c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x54], 0x3c
mov dword [ebp - 0x44], esi
cmp dword [ebp + 0x14], esi
je 0x401979
push ebx
lea eax, [ebp - 0xa9c]
push eax
push 0xbba
push dword [0x427df4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
lea eax, [ebp - 0x3a9c]
push esi
cmp dword [ebp - 0x70], esi
je 0x40199d
push 0x4c00000
push esi
push 0x41f712
push 0x41f714
push eax
push 0x41f720
jmp 0x4019b3
push 0x4400000
push esi
push 0x41f724
push 0x41f728
push eax
push 0x41f734
push dword [ebp - 0x48]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [ebp - 0x20], eax
cmp eax, esi
je 0x401829
push esi
push 0x20
push 4
push esi
push esi
push 0x40000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
je 0x401829
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x34], eax
cmp dword [ebp + 0x10], esi
jne 0x4019fb
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x6c], esi
cmp dword [ebp - 0x34], esi
je 0x401a9a
cmp dword [ebp - 0x34], 0xffffffff
je 0x401a9a
lea eax, [ebp - 0x88]
push eax
push esi
push esi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
je 0x401a9a
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
push 0x1e
lea eax, [ebp - 0x138]
push eax
push esi
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.004117d4
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], esi
je 0x401acb
push ebx
lea eax, [ebp - 0xa9c]
push eax
push 0xbbb
push dword [0x427df4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push esi
push esi
push esi
push esi
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x401bb7
cmp dword [ebp - 0x30], esi
je 0x401829
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xf4], eax
mov ecx, eax
sub ecx, 0x2ee2
je 0x401b2c
sub ecx, 5
je 0x401b2c
sub ecx, 0x16
je 0x401b2c
mov dword [ebp - 0x30], esi
push esi
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 0x401acb
mov dword [ebp - 0x30], 1
jmp 0x401acb
mov dword [ebp - 0x30], esi
mov ecx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 0x78]
mov dword [ebp - 0xc8], ecx
cmp ecx, esi
jne 0x401acb
push ebx
cmp eax, 0x2ee2
jne 0x401b55
lea eax, [ebp - 0x2a9c]
push eax
push 0x198
jmp 0x401b66
cmp eax, 0x2ee7
lea eax, [ebp - 0x2a9c]
push eax
push 0x7eb
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x6a9c]
push eax
push 0x7d4
push dword [0x427df4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x78]
mov dword [ebp - 0xd4], eax
cmp eax, esi
jne 0x401acb
push esi
lea eax, [ebp - 0x6a9c]
push eax
lea eax, [ebp - 0x2a9c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x401acb
cmp dword [ebp - 0x30], esi
je 0x401829
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x5c], 4
push esi
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 0x401bf7
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 0x401c0f
cmp eax, 0x191
jne 0x401c75
cmp dword [ebp - 0x30], esi
je 0x401c75
push esi
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 - 0xf8], eax
cmp eax, 0x4c7
je 0x401c70
cmp eax, esi
jne 0x401c43
cmp dword [ebp - 0x2c], 0x197
je 0x401c70
push esi
push esi
push esi
push esi
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
mov dword [ebp - 0x5c], 4
push esi
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 0x401bfe
mov dword [ebp - 0x30], esi
jmp 0x401bfe
cmp eax, 0xc8
je 0x401f76
cmp eax, 0xce
je 0x401f76
cmp eax, 0x1a0
jne 0x401ca1
cmp dword [ebp - 0x34], esi
je 0x401ca1
cmp dword [ebp - 0x34], 0xffffffff
jne 0x401786
cmp eax, 0x190
jb 0x401f11
cmp eax, 0x258
jae 0x401f11
cmp eax, 0x193
jne 0x401d20
mov eax, dword [ebp - 0x1c]
push ebx
cmp dword [eax + 0x90], esi
lea eax, [ebp - 0x1a9c]
push eax
je 0x401ced
push 0x7d4
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x129c]
push eax
push 0x193
jmp 0x401d07
push 0x2bc
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x129c]
push eax
push 0x258
push dword [0x427df4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x78]
mov dword [ebp - 0xdc], eax
jmp 0x401ee5
cmp eax, 0x1f4
jne 0x401d96
push ebx
lea eax, [ebp - 0x1a9c]
push eax
push 0x2be
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x129c]
push eax
push 0x25a
push dword [0x427df4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x78]
mov dword [ebp - 0xec], eax
cmp eax, esi
jne 0x401f05
push 0x34
lea eax, [ebp - 0x1a9c]
push eax
lea eax, [ebp - 0x129c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 6
jne 0x401f05
mov dword [ebp - 0x44], 1
jmp 0x401f05
cmp eax, 0x1f7
jne 0x401e88
cmp dword [ebp - 0x4c], 5
jge 0x401e0f
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], esi
jl 0x401e06
cmp dword [ebp + 0x14], esi
je 0x401df6
push ebx
lea eax, [ebp - 0xa9c]
push eax
push 0xbbc
push dword [0x427df4]
call edi
push dword [ebp - 0x58]
lea eax, [ebp - 0xa9c]
push eax
lea eax, [ebp - 0x429c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x429c]
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 0x401dad
inc dword [ebp - 0x4c]
add dword [ebp - 0x54], 0x1e
jmp 0x401e7c
push ebx
lea eax, [ebp - 0x1a9c]
push eax
push 0x2bd
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x129c]
push eax
push 0x259
push dword [0x427df4]
call edi
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x78]
mov dword [ebp - 0xe8], eax
cmp eax, esi
jne 0x401f05
push 0x34
lea eax, [ebp - 0x1a9c]
push eax
lea eax, [ebp - 0x129c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 6
jne 0x401f05
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x54], 0x3c
mov dword [ebp - 0x44], 1
jmp 0x402174
push ebx
lea eax, [ebp - 0x1a9c]
push eax
push 0x2be
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x129c]
push eax
push dword [ebp - 0x2c]
push dword [0x427df4]
call edi
lea eax, [ebp - 0x129c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jne 0x401ed9
push dword [ebp - 0x2c]
push str.HTTP_ErrorCode_d
lea eax, [ebp - 0x129c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x78]
mov dword [ebp - 0xcc], eax
cmp eax, esi
jne 0x401f05
lea eax, [ebp - 0x1a9c]
push 0x40
push eax
lea eax, [ebp - 0x129c]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
mov dword [ebp - 0x28], 1
jmp 0x402129
push ebx
lea eax, [ebp - 0x729c]
push eax
push 0x2bf
push dword [0x427df4]
call edi
push ebx
lea eax, [ebp - 0x529c]
push eax
push 0x25b
push dword [0x427df4]
call edi
push dword [ebp - 0x2c]
lea eax, [ebp - 0x529c]
push eax
lea eax, [ebp - 0x629c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x78]
mov dword [ebp - 0xd0], eax
cmp eax, esi
jne 0x401f05
push 0x40
lea eax, [ebp - 0x729c]
push eax
lea eax, [ebp - 0x629c]
jmp 0x401ef8
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x78], 4
push esi
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], esi
ja 0x401fa8
mov dword [ebp - 0x40], 0xe4e1c0
jmp 0x40205d
cmp dword [ebp - 0x6c], esi
je 0x40205d
mov eax, dword [ebp - 0x34]
cmp eax, esi
je 0x40205d
cmp dword [ebp - 0x40], eax
jne 0x40205d
mov dword [ebp - 0x74], pe_nt_image_headers32
push esi
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x29c]
push eax
push 0x35
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x40205d
push esi
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x29c]
push eax
push 0xb
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
push esi
test eax, eax
je 0x402049
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x29c]
push eax
call dword [sym.imp.WININET.dll_InternetTimeToSystemTime]
lea eax, [ebp - 0xe4]
push eax
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0xe4]
push eax
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_CompareFileTime]
cmp eax, 1
jne 0x40205d
jmp 0x401786
push esi
push esi
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], esi
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x64], esi
cmp dword [ebp - 0x2c], 0xce
jne 0x40208c
mov eax, dword [ebp - 0x1c]
add dword [eax + 0x44], 0xffffff9c
push 2
push esi
push esi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x4020a1
push esi
push esi
push esi
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], esi
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x80]
lea eax, [ebp - 0x923c]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x402119
cmp dword [ebp - 0x3c], esi
je 0x4020df
mov dword [ebp - 0x7c], esi
push esi
lea eax, [ebp - 0x7c]
push eax
push dword [ebp - 0x3c]
lea eax, [ebp - 0x923c]
push eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0x60], eax
cmp dword [ebp + 0x14], esi
je 0x402101
mov ecx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x34]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x60]
add ecx, eax
push ecx
push dword [ebp - 0x1c]
call fcn.004016c7
push esi
mov eax, dword [ebp - 0x1c]
push dword [eax + 0x70]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x402119
cmp dword [ebp - 0x3c], esi
jne 0x4020a1
jmp 0x402120
mov dword [ebp - 0x64], 1
cmp dword [ebp - 0x64], esi
jne 0x401829
cmp dword [ebp + 0x14], esi
je 0x402153
push ebx
lea eax, [ebp - 0xa9c]
push eax
push 0xbbd
push dword [0x427df4]
call edi
lea eax, [ebp - 0xa9c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.USER32.dll_SetWindowTextA]
cmp dword [ebp - 0x20], esi
je 0x402161
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x24], 0xffffffff
je 0x402174
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x24], 0xffffffff
cmp dword [ebp - 0x44], esi
jne 0x40194c
or dword [ebp - 4], 0xffffffff
call fcn.004021a5
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