Function at 0x40638d
Capabilities:
Check http status code
Check if file exists
Delete file
Download and write a file
Get http content length
Move file
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Set file attributes
Timestomp file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3d8
mov eax, dword [0x42f080]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
push edi
mov edi, edx
lea esi, [ebx + 0x4c]
mov dword [ebp - 0x388], ebx
mov dword [ebp - 0x3a0], eax
mov dword [ebp - 0x3c8], edi
call fcn.00407fcf
lea esi, [ebp - 0x380]
call fcn.00407f9b
mov eax, dword [ebp - 0x380]
cmp dword [eax - 0xc], 0
je 0x4063e8
push 0x42acd4
mov eax, esi
push eax
call fcn.00407a5c
push dword [ebp - 0x3a0]
push ebx
call fcn.00407522
test eax, eax
jne 0x406412
mov esi, SysReAllocStringLen
mov eax, dword [ebp - 0x380]
add eax, 0xfffffff0
call fcn.00408191
mov eax, esi
jmp 0x406f4a
xor edi, edi
cmp dword [ebx + 0x48], edi
je 0x406420
mov esi, ebx
call fcn.004079e5
cmp dword [ebx + 0x44], edi
je 0x406431
mov esi, ebx
call fcn.004079e5
push 2
pop esi
jmp 0x4063fd
lea esi, [ebp - 0x390]
call fcn.004081a9
lea esi, [ebx + 0x28]
mov eax, dword [esi]
push 0x2f
push eax
mov dword [ebp - 0x398], edi
mov dword [ebp - 0x394], edi
call fcn.004136b9
pop ecx
pop ecx
cmp eax, edi
jne 0x406460
or eax, 0xffffffff
jmp 0x406462
sub eax, dword [esi]
lea edx, [eax + 1]
mov eax, dword [esi]
mov ecx, dword [eax - 0xc]
lea eax, [ebp - 0x384]
push eax
sub ecx, edx
mov eax, esi
call fcn.00407b40
lea eax, [ebp - 0x384]
lea edi, [ebp - 0x390]
call fcn.00407a1b
mov eax, dword [ebp - 0x384]
add eax, 0xfffffff0
call fcn.00408191
mov eax, dword [ebp - 0x380]
xor edi, edi
mov dword [ebp - 0x39c], 1
cmp dword [eax - 0xc], edi
je 0x4064d8
mov eax, dword [ebx + 0x50]
cmp eax, edi
je 0x4064d8
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4064d8
lea eax, [ebp - 0x39c]
push eax
push edi
push 0xbd8
push dword [ebx + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, ebx
call fcn.004060bc
test eax, eax
jne 0x4064f9
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
or esi, 0xffffffff
jmp 0x4063fd
cmp dword [ebx + 0x44], edi
je 0x406518
mov esi, ebx
call fcn.004079e5
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
jmp 0x40642c
mov eax, dword [esi]
push edi
push 0x4600010
push 0x430e34
push edi
push str.HTTP_1.0
push eax
push 0x42ace4
push dword [ebx + 8]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [ebx + 0xc], eax
cmp eax, edi
jne 0x406553
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0x54], eax
mov esi, ebx
call fcn.004079e5
jmp 0x4064e3
push 0x10f
lea eax, [ebp - 0x23b]
push edi
push eax
mov byte [ebp - 0x23c], 0
call fcn.00414930
add esp, 0xc
push 0x40
lea eax, [ebp - 0x53]
push edi
push eax
mov byte [ebp - 0x54], 0
call fcn.00414930
add esp, 0xc
lea eax, [ebp - 0x3c4]
push eax
mov dword [ebp - 0x3a0], edi
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [ebp - 0x380]
cmp dword [eax - 0xc], edi
je 0x40663e
push 0x13c
lea eax, [ebp - 0x378]
push edi
push eax
mov dword [ebp - 0x37c], edi
call fcn.00414930
add esp, 0xc
lea eax, [ebp - 0x37c]
push eax
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
je 0x40663e
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
lea eax, [ebp - 0x3d8]
push eax
lea eax, [ebp - 0x368]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
mov eax, dword [ebp - 0x35c]
mov dword [ebp - 0x394], eax
cmp eax, edi
jbe 0x406621
push eax
lea eax, [ebp - 0x54]
push str.Range:_bytes_d_
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov dword [ebp - 0x3a0], 1
jmp 0x40663e
push 0x80
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebx + 0x44], edi
jne 0x4064fe
push edi
push edi
lea eax, [ebp - 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [ebp - 0x54]
push eax
push dword [ebx + 0xc]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x4066be
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, ebx
mov dword [ebx + 0x54], eax
call fcn.004079e5
mov ebx, dword [ebx + 0x54]
sub ebx, 0x2ee2
je 0x4066a6
sub ebx, 5
je 0x40668e
sub ebx, 0x16
jne 0x4064e3
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, reloc.OLEAUT32.dll_VariantClear
jmp 0x4063fd
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, VariantClear
jmp 0x4063fd
cmp dword [ebx + 0x44], edi
jne 0x4064fe
push edi
lea eax, [ebp - 0x38c]
push eax
lea eax, [ebp - 0x3b0]
push eax
push 0x20000013
push dword [ebx + 0xc]
mov dword [ebp - 0x3b0], edi
mov dword [ebp - 0x38c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x406541
mov eax, dword [ebp - 0x3b0]
mov dword [ebp - 0x384], edi
cmp eax, 0x12e
ja 0x406ac2
cmp eax, 0x12d
jae 0x406a3b
sub eax, 0xc8
je 0x406a00
sub eax, 3
je 0x406737
sub eax, 3
jne 0x406add
push 0x40
lea eax, [ebp - 0x9b]
push edi
push eax
mov byte [ebp - 0x9c], 0
call fcn.00414930
add esp, 0xc
push edi
lea eax, [ebp - 0x38c]
push eax
lea eax, [ebp - 0x9c]
push eax
push 0xb
push dword [ebx + 0xc]
mov dword [ebp - 0x38c], 0x40
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x406798
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x380]
mov dword [ebx + 0x54], eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
and dword [ebp - 0x394], edi
jmp 0x40654a
lea eax, [ebp - 0x9c]
push eax
lea ebx, [ebp - 0x3c4]
call fcn.00407768
mov ax, word [ebp - 0x3b8]
cmp ax, word [ebp - 0x3cc]
jne 0x40680a
mov ax, word [ebp - 0x3ba]
cmp ax, word [ebp - 0x3ce]
jne 0x40680a
mov ax, word [ebp - 0x3bc]
cmp ax, word [ebp - 0x3d0]
jne 0x40680a
mov ax, word [ebp - 0x3be]
cmp ax, word [ebp - 0x3d2]
jne 0x40680a
mov ax, word [ebp - 0x3c2]
cmp ax, word [ebp - 0x3d6]
jne 0x40680a
mov ax, word [ebp - 0x3c4]
cmp ax, word [ebp - 0x3d8]
je 0x406826
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
and dword [ebp - 0x394], edi
mov dword [ebp - 0x384], 1
mov ebx, dword [ebp - 0x388]
xor edi, edi
cmp dword [ebx + 0x44], edi
jne 0x4064fe
cmp dword [ebp - 0x384], edi
je 0x4068dd
push dword [ebx + 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [esi]
push edi
push 0x4600010
push 0x430e34
push edi
push str.HTTP_1.0
push esi
push 0x42ace4
push dword [ebx + 8]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [ebx + 0xc], eax
cmp eax, edi
je 0x406541
cmp dword [ebx + 0x44], edi
jne 0x4064fe
push edi
push edi
push edi
push edi
push eax
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x406541
cmp dword [ebx + 0x44], edi
jne 0x4064fe
push edi
lea eax, [ebp - 0x38c]
push eax
lea eax, [ebp - 0x3b0]
push eax
push 0x20000013
push dword [ebx + 0xc]
mov dword [ebp - 0x38c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x406541
cmp dword [ebp - 0x3b0], 0xc8
jne 0x406541
push 0x40
pop esi
push esi
lea eax, [ebp - 0xe3]
push edi
push eax
mov byte [ebp - 0xe4], 0
call fcn.00414930
add esp, 0xc
push edi
lea eax, [ebp - 0x38c]
push eax
lea eax, [ebp - 0xe4]
push eax
push 0xb
push dword [ebx + 0xc]
mov dword [ebp - 0x38c], esi
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
call esi
test eax, eax
je 0x406938
lea eax, [ebp - 0xe4]
push eax
lea ebx, [ebp - 0x3c4]
call fcn.00407768
mov ebx, dword [ebp - 0x388]
xor edi, edi
push edi
lea eax, [ebp - 0x38c]
push eax
lea eax, [ebp - 0x3b4]
push eax
push 0x20000005
push dword [ebx + 0xc]
mov dword [ebp - 0x3b4], edi
mov dword [ebp - 0x38c], 4
call esi
test eax, eax
jne 0x406975
mov dword [ebp - 0x3b4], 0x32000
mov dword [ebp - 0x394], edi
mov eax, dword [ebp - 0x3b4]
mov ecx, dword [ebp - 0x394]
mov esi, dword [ebp - 0x380]
add eax, ecx
mov dword [ebp - 0x398], eax
mov dword [ebx + 0x5c], eax
mov dword [ebp - 0x39c], 2
cmp dword [esi - 0xc], edi
je 0x4069c9
mov eax, dword [ebx + 0x50]
cmp eax, edi
je 0x4069c9
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4069c9
lea eax, [ebp - 0x39c]
push eax
push edi
push 0xbd8
push dword [ebx + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [ebx + 0x44], edi
jne 0x4064fe
mov ecx, esi
call fcn.0040627c
test eax, eax
jne 0x406af8
mov esi, ebx
call fcn.004079e5
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, SysReAllocStringLen
jmp 0x4063fd
mov eax, dword [ebp - 0x380]
cmp dword [eax - 0xc], edi
jne 0x406a2a
mov esi, ebx
call fcn.004079e5
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, reloc.OLEAUT32.dll_SysReAllocString
jmp 0x4063fd
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x40682c
mov esi, 0x401
push esi
call fcn.00412242
pop ecx
push esi
push edi
push eax
mov dword [ebp - 0x388], eax
call fcn.00414930
add esp, 0xc
push edi
lea eax, [ebp - 0x38c]
push eax
push dword [ebp - 0x388]
mov dword [ebp - 0x38c], 0x400
push 0x21
push dword [ebx + 0xc]
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
push dword [ebp - 0x388]
test eax, eax
jne 0x406a90
call fcn.00411d81
pop ecx
jmp 0x406541
lea eax, [ebx + 0x4c]
push eax
call fcn.00407f6c
mov esi, ebx
call fcn.004079e5
push dword [ebp - 0x388]
call fcn.00411d81
mov eax, dword [ebp - 0x390]
pop ecx
add eax, 0xfffffff0
call fcn.00408191
xor esi, esi
inc esi
jmp 0x4063fd
sub eax, 0x193
je 0x406f19
dec eax
je 0x406ef1
sub eax, 0x60
je 0x406ed0
cmp dword [ebp - 0x3a0], edi
je 0x406ec2
mov dword [ebp - 0x384], 1
jmp 0x40682c
push edi
push 0x80
push 4
push edi
push 1
push 0xc0000000
push dword [ebp - 0x380]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x388], esi
cmp esi, 0xffffffff
je 0x4069e1
lea eax, [ebp - 0x3ac]
push eax
lea eax, [ebp - 0x3c4]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x3ac]
push eax
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp - 0x384], edi
je 0x406b64
push edi
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x406b6f
push 2
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x1001
call fcn.00412242
pop ecx
mov dword [ebp - 0x384], eax
mov dword [ebp - 0x3a4], edi
mov dword [ebp - 0x39c], 3
push 0x1001
push edi
push dword [ebp - 0x384]
call fcn.00414930
add esp, 0xc
cmp dword [ebx + 0x44], edi
jne 0x406ca2
lea eax, [ebp - 0x3a4]
push eax
push 0x1000
push dword [ebp - 0x384]
push dword [ebx + 0xc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x406cf9
mov eax, dword [ebp - 0x3a4]
add dword [ebp - 0x394], eax
mov eax, dword [ebx + 0x50]
cmp eax, edi
je 0x406c04
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x406c04
lea eax, [ebp - 0x39c]
push eax
push edi
push 0xbd8
push dword [ebx + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [ebp - 0x3a4], edi
jbe 0x406c39
push edi
lea eax, [ebp - 0x3a0]
push eax
push dword [ebp - 0x3a4]
mov dword [ebp - 0x3a0], edi
push dword [ebp - 0x384]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x3a4], edi
ja 0x406b90
mov eax, dword [ebp - 0x394]
cmp eax, dword [ebp - 0x398]
jae 0x406d73
mov esi, ebx
call fcn.004079e5
push dword [ebp - 0x384]
call fcn.00411d81
mov esi, dword [ebp - 0x388]
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x3ac]
push eax
lea eax, [ebp - 0x3c4]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x3ac]
push eax
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4064e3
push dword [ebp - 0x384]
call fcn.00411d81
pop ecx
mov esi, ebx
call fcn.004079e5
mov esi, dword [ebp - 0x388]
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x3ac]
push eax
lea eax, [ebp - 0x3c4]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x3ac]
push eax
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406505
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push dword [ebp - 0x384]
mov dword [ebx + 0x54], eax
call fcn.00411d81
pop ecx
call esi
mov esi, ebx
mov dword [ebx + 0x54], eax
call fcn.004079e5
mov esi, dword [ebp - 0x388]
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x3ac]
push eax
lea eax, [ebp - 0x3c4]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x3ac]
push eax
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, reloc.OLEAUT32.dll_VariantCopy
jmp 0x4063fd
mov eax, dword [ebx + 0x50]
cmp eax, edi
je 0x406d9b
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x406d9b
lea eax, [ebp - 0x39c]
push eax
push edi
push 0xbd8
push dword [ebx + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
push 0x40
lea eax, [ebp - 0x12b]
push edi
push eax
mov byte [ebp - 0x12c], 0
call fcn.00414930
add esp, 0xc
push edi
lea eax, [ebp - 0x38c]
push eax
lea eax, [ebp - 0x12c]
push eax
push 0x17
push dword [ebx + 0xc]
mov dword [ebp - 0x38c], 0x40
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x406de7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0x54], eax
jmp 0x406dfd
push str.close
lea eax, [ebp - 0x12c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x406e0c
mov esi, ebx
call fcn.004079e5
mov esi, dword [ebp - 0x388]
jmp 0x406e18
push dword [ebx + 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [ebx + 0xc], edi
push dword [ebp - 0x384]
call fcn.00411d81
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x3ac]
push eax
lea eax, [ebp - 0x3c4]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x3ac]
push eax
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x3c8]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x406e81
push 0x80
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push esi
mov esi, dword [ebp - 0x380]
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
mov eax, dword [ebp - 0x390]
jne 0x406eab
add eax, 0xfffffff0
call fcn.00408191
mov esi, reloc.OLEAUT32.dll_SysReAllocStringLen
jmp 0x4063fd
add eax, 0xfffffff0
call fcn.00408191
lea eax, [esi - 0x10]
call fcn.00408191
xor eax, eax
jmp 0x406f4a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0x54], eax
jmp 0x4064e3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0x54], eax
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, SafeArrayLock
jmp 0x4063fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, ebx
mov dword [ebx + 0x54], eax
call fcn.004079e5
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov esi, reloc.OLEAUT32.dll_VariantInit
jmp 0x4063fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, ebx
mov dword [ebx + 0x54], eax
call fcn.004079e5
mov eax, dword [ebp - 0x390]
add eax, 0xfffffff0
call fcn.00408191
mov eax, dword [ebp - 0x380]
add eax, 0xfffffff0
call fcn.00408191
mov eax, reloc.OLEAUT32.dll_SafeArrayGetDim
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00411d8c
leave
ret 4