Function at 0x402247
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 0x43f718
push 0x41b7e8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
mov eax, 0x3df8
call fcn.0041b720
push ebx
push esi
push edi
xor esi, esi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x2c], esi
or dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x20], esi
call fcn.0041d31d
mov dword [ebp - 0x5c], eax
mov dword [ebp - 4], esi
push 0x434d94
mov ebx, dword [ebp + 0xc]
push ebx
call fcn.0041b750
pop ecx
pop ecx
test eax, eax
je 0x4022b8
push esi
push esi
push dword [ebp + 0x10]
push ebx
push esi
call sub.urlmon.dll_URLDownloadToFileA
mov dword [ebp - 0x20], esi
jmp 0x40292d
mov edi, 0x400
push edi
lea eax, [ebp - 0x670]
push eax
call fcn.0040daa6
pop ecx
pop ecx
push esi
push esi
push esi
push esi
lea eax, [ebp - 0x670]
push eax
call dword [sym.imp.wininet.dll_InternetOpenA]
mov dword [ebp - 0x48], eax
cmp eax, esi
jne 0x4022f0
mov dword [ebp - 0x20], 0x80004005
jmp 0x40292d
push 0x3c
push esi
lea eax, [ebp - 0xb4]
push eax
call fcn.0041b010
add esp, 0xc
mov dword [ebp - 0xb4], 0x3c
lea eax, [ebp - 0x1e70]
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xa0], edi
xor eax, eax
mov word [ebp - 0x9c], ax
lea eax, [ebp - 0x1a70]
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x84], edi
lea eax, [ebp - 0x670]
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x7c], edi
lea eax, [ebp - 0xb4]
push eax
push esi
push ebx
call dword [sym.imp.kernel32.dll_lstrlenA]
push eax
push ebx
call dword [sym.imp.wininet.dll_InternetCrackUrlA]
push esi
push esi
push 3
push 0x4348b2
push 0x4348b3
push dword [ebp - 0x9c]
push dword [ebp - 0xa4]
push dword [ebp - 0x48]
call dword [sym.imp.wininet.dll_InternetConnectA]
mov dword [ebp - 0x40], eax
cmp eax, esi
je 0x4022e4
lea eax, [ebp - 0x1670]
cmp dword [ebp - 0x84], esi
je 0x4023a0
push dword [ebp - 0x88]
jmp 0x4023a5
push 0x434d4c
push eax
call dword [sym.imp.kernel32.dll_lstrcpyA]
cmp dword [ebp - 0x7c], esi
je 0x4023c1
push dword [ebp - 0x80]
lea eax, [ebp - 0x1670]
push eax
call dword [sym.imp.kernel32.dll_lstrcatA]
lea eax, [ebp - 0x1670]
push eax
push esi
call fcn.0041d31d
pop ecx
pop ecx
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x38], 0x3c
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x34], esi
push esi
push 0x4400000
push esi
push 0x4348ba
push 0x434d9c
lea eax, [ebp - 0x1670]
push eax
push 0x434da8
push dword [ebp - 0x40]
call dword [sym.imp.wininet.dll_HttpOpenRequestA]
mov ebx, eax
mov dword [ebp - 0x2c], ebx
cmp ebx, esi
je 0x4022e4
push esi
push 0x20
push 4
push esi
push esi
push 0x40000000
push dword [ebp + 0x10]
call dword [sym.imp.kernel32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x1c], edi
cmp edi, 0xffffffff
je 0x4022e4
push esi
push edi
call dword [sym.imp.kernel32.dll_GetFileSize]
mov dword [ebp + 0xc], eax
cmp dword [ebp + 0x14], esi
jne 0x402449
mov dword [ebp + 0xc], esi
mov dword [ebp - 0x60], esi
cmp dword [ebp + 0xc], esi
je 0x4024df
cmp dword [ebp + 0xc], 0xffffffff
je 0x4024df
lea eax, [ebp - 0x78]
push eax
push esi
push esi
push edi
call dword [sym.imp.kernel32.dll_GetFileTime]
test eax, eax
je 0x4024df
lea eax, [ebp - 0xec]
push eax
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.kernel32.dll_FileTimeToSystemTime]
push 0x1e
lea eax, [ebp - 0x10c]
push eax
push esi
lea eax, [ebp - 0xec]
push eax
call dword [sym.imp.wininet.dll_InternetTimeFromSystemTime]
lea eax, [ebp - 0x10c]
push eax
push dword [ebp + 0xc]
push str.Range:_bytes_d__r_nIf_Range:__s_r_n
lea eax, [ebp - 0x170]
push eax
call dword [sym.imp.user32.dll_wsprintfA]
add esp, 0x10
push 0xa0000000
lea eax, [ebp - 0x170]
push eax
call dword [sym.imp.kernel32.dll_lstrlenA]
push eax
lea eax, [ebp - 0x170]
push eax
push ebx
call dword [sym.imp.wininet.dll_HttpAddRequestHeadersA]
mov dword [ebp - 0x60], 1
mov dword [ebp - 0x24], 1
push esi
push esi
push esi
push esi
push ebx
call dword [sym.imp.wininet.dll_HttpSendRequestA]
test eax, eax
jne 0x402549
cmp dword [ebp - 0x24], esi
je 0x4022e4
call dword [sym.imp.kernel32.dll_GetLastError]
mov ecx, eax
sub ecx, 0x2ee2
je 0x402536
sub ecx, 5
je 0x402536
sub ecx, 0x16
je 0x402536
mov dword [ebp - 0x24], esi
push esi
push 7
push eax
push ebx
call dword [sym.imp.user32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.wininet.dll_InternetErrorDlg]
cmp eax, 0x2f00
jne 0x4024e6
jmp 0x4024df
mov dword [ebp - 0x24], esi
push esi
push esi
push eax
xor eax, eax
push eax
call fcn.0041d31d
add esp, 0x10
jmp 0x4024e6
cmp dword [ebp - 0x24], esi
je 0x4022e4
call dword [sym.imp.kernel32.dll_GetLastError]
mov edi, eax
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x4c], 4
push esi
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x30]
push eax
push 0x20000013
push ebx
call dword [sym.imp.wininet.dll_HttpQueryInfoA]
test eax, eax
jne 0x402585
call dword [sym.imp.kernel32.dll_GetLastError]
mov edi, eax
mov dword [ebp - 0x24], 1
mov eax, dword [ebp - 0x30]
cmp eax, 0x197
je 0x40259d
cmp eax, 0x191
jne 0x4025e9
cmp dword [ebp - 0x24], esi
je 0x4025e9
push esi
push 7
push edi
push ebx
call dword [sym.imp.user32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.wininet.dll_InternetErrorDlg]
cmp eax, 0x2f00
je 0x4025c0
mov dword [ebp - 0x24], esi
jmp 0x40258c
push esi
push esi
push esi
push esi
push ebx
call dword [sym.imp.wininet.dll_HttpSendRequestA]
mov dword [ebp - 0x4c], 4
push esi
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x30]
push eax
push 0x20000013
push ebx
call dword [sym.imp.wininet.dll_HttpQueryInfoA]
jmp 0x40258c
cmp eax, 0xc8
je 0x40272e
cmp eax, 0xce
je 0x40272e
lea ecx, [eax - 0x190]
cmp ecx, 0xc7
ja 0x402714
cmp eax, 0x193
jne 0x402666
mov dword [ebp - 0x6c], 0xf
push esi
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0xcc]
push eax
push 0x14
push ebx
call dword [sym.imp.wininet.dll_HttpQueryInfoA]
test eax, eax
je 0x40265a
push str.Export_Denied
lea eax, [ebp - 0xcc]
push eax
call dword [sym.imp.kernel32.dll_lstrcmpA]
test eax, eax
jne 0x40265a
push esi
push esi
push 0x258
jmp 0x4026ea
push esi
push esi
push 0x193
jmp 0x4026ea
cmp eax, 0x1f4
jne 0x402687
xor edi, edi
inc edi
push edi
push esi
push eax
xor eax, eax
push eax
call fcn.0041d31d
add esp, 0x10
test eax, eax
je 0x4026f5
mov dword [ebp - 0x34], edi
jmp 0x4026f5
cmp eax, 0x1f7
jne 0x4026e3
cmp dword [ebp - 0x44], 5
jge 0x4026c2
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], esi
jl 0x4026af
push 0x3e8
call dword [sym.imp.kernel32.dll_Sleep]
dec dword [ebp - 0x58]
jmp 0x40269a
inc dword [ebp - 0x44]
add dword [ebp - 0x38], 0x1e
mov dword [ebp - 0x34], 1
jmp 0x4023dd
xor edi, edi
inc edi
push edi
push esi
push 0x1f7
xor eax, eax
push eax
call fcn.0041d31d
add esp, 0x10
test eax, eax
je 0x4026f5
mov dword [ebp - 0x34], edi
jmp 0x4023d3
push esi
push esi
push 0x1f4
xor eax, eax
push eax
call fcn.0041d31d
add esp, 0x10
xor eax, eax
cmp dword [ebp - 0x30], 0x194
setne al
dec eax
and eax, 0x6c1fd
add eax, 0x80004005
mov dword [ebp - 0x20], eax
jmp 0x402903
push esi
push esi
push eax
xor eax, eax
push eax
call fcn.0041d31d
add esp, 0x10
mov dword [ebp - 0x20], 0x80004005
jmp 0x402903
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x70], 4
push esi
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x3c]
push eax
push 0x20000005
push ebx
call dword [sym.imp.wininet.dll_HttpQueryInfoA]
mov eax, dword [ebp - 0x3c]
cmp eax, esi
ja 0x402760
mov dword [ebp - 0x3c], 0xe4e1c0
jmp 0x402810
cmp dword [ebp - 0x60], esi
je 0x402810
cmp dword [ebp + 0xc], esi
je 0x402810
cmp eax, dword [ebp + 0xc]
jne 0x402810
mov edi, 0x100
mov dword [ebp - 0x50], edi
push esi
lea eax, [ebp - 0x50]
push eax
lea eax, [ebp - 0x270]
push eax
push 0x35
push ebx
call dword [sym.imp.wininet.dll_HttpQueryInfoA]
test eax, eax
jne 0x402810
mov dword [ebp - 0x50], edi
push esi
lea eax, [ebp - 0x50]
push eax
lea eax, [ebp - 0x270]
push eax
push 0xb
push ebx
call dword [sym.imp.wininet.dll_HttpQueryInfoA]
push esi
test eax, eax
je 0x4027fc
lea eax, [ebp - 0xdc]
push eax
lea eax, [ebp - 0x270]
push eax
call dword [sym.imp.wininet.dll_InternetTimeToSystemTime]
lea eax, [ebp - 0xbc]
push eax
lea eax, [ebp - 0xdc]
push eax
call dword [sym.imp.kernel32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0xbc]
push eax
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.kernel32.dll_CompareFileTime]
cmp eax, 1
jne 0x402810
jmp 0x4022b0
push esi
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_SetFilePointer]
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_SetEndOfFile]
mov ebx, 0x1fa0
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x64], esi
cmp dword [ebp - 0x30], 0xce
jne 0x402836
push 2
push esi
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_SetFilePointer]
jmp 0x40284b
push esi
push esi
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_SetFilePointer]
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_SetEndOfFile]
mov edi, dword [ebp + 8]
add edi, 8
mov eax, dword [edi]
push edi
call dword [eax + 0x28]
test eax, eax
je 0x4028f3
push esi
push dword [ebp - 0x5c]
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
test eax, eax
je 0x4028f3
mov eax, dword [edi]
push edi
call dword [eax + 0x24]
test eax, eax
jne 0x402888
push 0x3e8
call dword [sym.imp.kernel32.dll_Sleep]
jmp 0x4028e8
mov dword [ebp - 0x28], esi
lea eax, [ebp - 0x28]
push eax
push ebx
lea eax, [ebp - 0x3e10]
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.wininet.dll_InternetReadFile]
test eax, eax
je 0x4022e4
cmp dword [ebp - 0x28], esi
je 0x4028c8
mov dword [ebp - 0x68], esi
push esi
lea eax, [ebp - 0x68]
push eax
push dword [ebp - 0x28]
lea eax, [ebp - 0x3e10]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_WriteFile]
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x54], eax
cmp dword [ebp + 0x18], esi
je 0x4028e8
mov ecx, dword [edi]
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp + 0xc]
add edx, eax
push edx
mov edx, dword [ebp - 0x54]
add edx, eax
push edx
push edi
call dword [ecx + 0x2c]
cmp dword [ebp - 0x28], esi
jne 0x40284b
jmp 0x4028fa
mov dword [ebp - 0x64], 1
cmp dword [ebp - 0x64], esi
jne 0x4022e4
cmp dword [ebp - 0x2c], esi
je 0x402911
push dword [ebp - 0x2c]
call dword [sym.imp.wininet.dll_InternetCloseHandle]
cmp dword [ebp - 0x1c], 0xffffffff
je 0x402924
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_CloseHandle]
or dword [ebp - 0x1c], 0xffffffff
cmp dword [ebp - 0x34], esi
jne 0x4023dd
or dword [ebp - 4], 0xffffffff
call fcn.0040294c
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 0x14