Function at 0x402658
Capabilities:
Connect to http server
Delete file
Download and write a file
Move file
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x474
push ebx
push esi
xor ebx, ebx
mov esi, ecx
push edi
mov dword [ebp - 0x60], ebx
mov edi, dword [esi + 0x6c]
cmp edi, ebx
jne 0x402697
push str.Protocol_not_supported
add esi, 0x10
mov ecx, esi
call fcn.00404db2
cmp dword [ebp + 0xc], ebx
je 0x402690
mov ecx, dword [ebp + 0x10]
push esi
push 2
pop edx
call dword [ebp + 0xc]
mov al, 1
jmp 0x402eae
mov eax, dword [esi + 0x44]
mov ecx, dword [esi + 0x3c]
mov edx, dword [esi + 0x4c]
push ebx
push ebx
push edi
push eax
movzx eax, word [esi + 0x68]
push ecx
push eax
push edx
push dword [esi]
call dword [sym.imp.WININET.dll_InternetConnectA]
mov dword [ebp - 0xc], eax
cmp eax, ebx
jne 0x4026c1
push str.InternetConnect____failed
jmp 0x402677
push 0x2800
lea ecx, [ebp - 0x54]
call fcn.00404d99
push dword [esi + 0x54]
push dword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [esi + 0x5c]
push dword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp dword [esi + 0x6c], 3
jne 0x402ea1
push ebx
push ebx
lea eax, [ebp - 0x68]
push eax
push ebx
push ebx
push dword [ebp - 0x50]
mov dword [ebp - 0x68], 0x406618
push str.HEAD
push dword [ebp - 0xc]
mov dword [ebp - 0x64], ebx
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
push ebx
push ebx
push ebx
push ebx
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x40272b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 4]
mov ecx, esi
call fcn.00402442
mov ecx, esi
call fcn.004024ba
mov ecx, esi
call fcn.00402566
mov ecx, eax
push 0x64
cdq
pop edi
idiv edi
cmp eax, 2
jne 0x402e80
push str.Content_Length
lea eax, [ebp - 0x5c]
push eax
mov ecx, esi
call fcn.004024fc
mov ecx, dword [eax + 4]
call fcn.00404c2f
push dword [ebp - 0x58]
mov edi, eax
mov dword [ebp - 0x1c], edi
call fcn.004019a0
pop ecx
push dword [ebp - 0x50]
lea ecx, [esi + 0x10]
mov dword [ebp - 0x18], ecx
call fcn.00404db2
mov dword [esi + 0x18], edi
mov dword [esi + 0x1c], ebx
cmp dword [ebp + 0xc], ebx
je 0x4027b0
push dword [ebp - 0x18]
mov ecx, dword [ebp + 0x10]
xor edx, edx
call dword [ebp + 0xc]
test al, al
jne 0x4027b0
push dword [ebp - 0x50]
call fcn.004019a0
pop ecx
jmp 0x402690
push str.Content_Type:
lea eax, [ebp - 0x2c]
push eax
mov ecx, esi
call fcn.004024fc
cmp dword [ebp - 4], ebx
je 0x4027ce
push dword [ebp - 4]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ecx, dword [ebp - 0x28]
mov edx, str.html
call fcn.00404d3d
test eax, eax
jne 0x402d81
mov ecx, dword [ebp - 0x28]
mov edx, 0x4065e4
call fcn.00404d3d
test eax, eax
jne 0x402d81
mov ecx, dword [ebp - 0x28]
mov edx, str.plain
call fcn.00404d3d
test eax, eax
jne 0x402d81
mov edi, 0x400
push edi
lea ecx, [ebp - 0x3c]
call fcn.00404d99
mov ecx, dword [esi + 0x54]
jmp 0x402832
inc dword [ebp - 4]
push dword [ebp - 4]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [ebp - 4]
mov dl, 0x2f
call fcn.00404d15
mov dword [ebp - 4], eax
cmp eax, ebx
jne 0x402820
push edi
lea ecx, [ebp - 0x14]
call fcn.00404d99
push dword [ebp + 8]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 0x38]
lea ecx, [esi + 0x20]
call fcn.00404db2
mov ecx, dword [ebp - 0x10]
call fcn.00402173
mov dword [ebp - 0x4c], eax
push str.Last_Modified:
lea eax, [ebp - 0x5c]
push eax
mov ecx, esi
mov dword [ebp - 0x48], edx
call fcn.004024fc
mov ecx, dword [eax + 4]
call fcn.00401fdf
mov dword [ebp - 0x30], edx
lea edx, [ebp - 0x4c]
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x34], eax
call fcn.00401fcc
test al, al
je 0x4028ac
mov ecx, dword [ebp - 0x10]
call fcn.00402140
mov byte [ebp + 0xb], 1
cmp dword [ebp - 0x1c], eax
je 0x4028af
mov byte [ebp + 0xb], bl
push dword [ebp - 0x58]
call fcn.004019a0
pop ecx
push dword [ebp - 0x10]
cmp byte [ebp + 0xb], bl
je 0x40294b
lea edi, [esi + 0x10]
mov ecx, edi
call fcn.00404db2
mov eax, dword [ebp - 0x1c]
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov esi, dword [ebp + 0xc]
cmp esi, ebx
je 0x40292b
mov ecx, dword [ebp + 0x10]
xor edx, edx
push edi
inc edx
call esi
mov ecx, dword [ebp + 0x10]
neg al
sbb al, al
inc al
push edi
je 0x402918
push 2
pop edx
call esi
push dword [ebp - 0x10]
call fcn.004019a0
push dword [ebp - 0x38]
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
add esp, 0xc
jmp 0x402ea1
push 3
pop edx
call esi
neg al
sbb al, al
inc al
je 0x40292b
mov ecx, dword [ebp + 0x10]
push edi
jmp 0x4028f3
push dword [ebp - 0x10]
call fcn.004019a0
push dword [ebp - 0x38]
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
add esp, 0xc
jmp 0x402ea3
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push edi
lea ecx, [ebp - 0x24]
call fcn.00404d99
push dword [ebp - 0x10]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push str..xdl_
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov ecx, dword [ebp - 0x20]
call fcn.00402140
mov ecx, dword [ebp - 0x20]
mov dword [ebp + 8], eax
call fcn.00402173
mov dword [ebp - 0x4c], eax
push str.Last_Modified:
lea eax, [ebp - 0x5c]
push eax
mov ecx, esi
mov dword [ebp - 0x48], edx
call fcn.004024fc
mov ecx, dword [eax + 4]
call fcn.00401fdf
push dword [ebp - 0x58]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edx
call fcn.004019a0
pop ecx
lea edx, [ebp - 0x4c]
lea ecx, [ebp - 0x34]
call fcn.00401fcc
test al, al
je 0x402a82
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0x1c]
jne 0x402a8e
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push dword [ebp - 0x10]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_MoveFileA]
push dword [ebp - 0x10]
lea edi, [esi + 0x10]
mov ecx, edi
call fcn.00404db2
mov eax, dword [ebp - 0x1c]
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov esi, dword [ebp + 0xc]
cmp esi, ebx
je 0x402a5a
mov ecx, dword [ebp + 0x10]
xor edx, edx
push edi
inc edx
call esi
mov ecx, dword [ebp + 0x10]
neg al
sbb al, al
inc al
push edi
je 0x402a47
push 2
pop edx
call esi
push dword [ebp - 0x20]
call fcn.004019a0
push dword [ebp - 0x10]
call fcn.004019a0
push dword [ebp - 0x38]
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
add esp, 0x10
jmp 0x402ea1
push 3
pop edx
call esi
neg al
sbb al, al
inc al
je 0x402a5a
mov ecx, dword [ebp + 0x10]
push edi
jmp 0x402a1a
push dword [ebp - 0x20]
call fcn.004019a0
push dword [ebp - 0x10]
call fcn.004019a0
push dword [ebp - 0x38]
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
add esp, 0x10
jmp 0x402ea3
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov dword [ebp + 8], ebx
push ebx
push ebx
lea eax, [ebp - 0x68]
push eax
push ebx
push ebx
push dword [ebp - 0x50]
push 0x4065c0
push dword [ebp - 0xc]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [ebp - 4], eax
cmp dword [ebp + 8], ebx
je 0x402b27
lea edi, [ebp - 0x474]
mov dword [ebp - 0xc], 0x80
push ebx
mov ecx, edi
call fcn.00404d99
add edi, 8
dec dword [ebp - 0xc]
jns 0x402abc
push dword [ebp + 8]
lea eax, [ebp - 0x474]
push str.Range:_bytes_d__r_n
push eax
call fcn.00404bb9
add esp, 0xc
push dword [ebp - 0x470]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push ebx
push ebx
push eax
push dword [ebp - 0x470]
push dword [ebp - 4]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x402b0b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xc], 0x80
lea edi, [ebp - 0x68]
sub edi, 8
push dword [edi]
call fcn.004019a0
dec dword [ebp - 0xc]
pop ecx
jns 0x402b15
jmp 0x402b3c
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x402b3c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 4]
mov ecx, esi
call fcn.00402442
mov ecx, esi
call fcn.004024ba
mov ecx, esi
call fcn.00402566
cmp eax, 0xce
je 0x402b66
cmp eax, 0xc8
jne 0x402a1f
push ebx
push 2
push 4
push ebx
push 1
push 0x40000000
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, dword [ebp + 8]
mov dword [ebp - 0xc], eax
cmp edi, ebx
je 0x402b90
push ebx
push ebx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp - 0x1c]
cdq
push 0x64
pop ecx
idiv ecx
mov dword [ebp - 0x40], eax
mov eax, 0x1400000
cmp dword [ebp - 0x40], eax
jle 0x402ba9
mov dword [ebp - 0x40], eax
push dword [ebp - 0x40]
lea ecx, [ebp - 0x4c]
call fcn.00404d99
push ebx
lea ecx, [ebp - 5]
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x60], ebx
call fcn.004018f9
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x40]
push dword [ebp - 0x48]
push dword [ebp - 4]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x402be1
xor eax, eax
jmp 0x402be7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
add dword [ebp - 0x44], ecx
push dword [ebp - 0x44]
push ecx
push dword [ebp - 0x40]
push eax
lea eax, [ebp - 0x34]
push str.code:__d__requested__d_bytes__read__d_bytes__total:__d_of__d
push eax
call fcn.00404e6f
add esp, 0x1c
push dword [ebp - 0x30]
lea ecx, [ebp - 5]
call fcn.00401838
mov ecx, eax
call fcn.004018dd
push ebx
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 0x18]
push dword [ebp - 0x48]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402c39
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x10]
lea edi, [esi + 0x10]
mov ecx, edi
call fcn.00404db2
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x44]
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], ecx
cmp ecx, eax
je 0x402c80
cmp dword [ebp - 0x18], ebx
je 0x402c8a
cmp dword [ebp + 0xc], ebx
je 0x402c72
mov ecx, dword [ebp + 0x10]
xor edx, edx
push edi
inc edx
call dword [ebp + 0xc]
neg al
sbb al, al
inc al
jne 0x402c94
push dword [ebp - 0x30]
call fcn.004019a0
pop ecx
jmp 0x402bc6
cmp dword [ebp + 0xc], ebx
je 0x402c9e
push edi
push 3
jmp 0x402c97
cmp dword [ebp + 0xc], ebx
je 0x402c9e
push edi
push 4
jmp 0x402c97
push edi
push 2
mov ecx, dword [ebp + 0x10]
pop edx
call dword [ebp + 0xc]
push dword [ebp - 0x30]
call fcn.004019a0
pop ecx
push str.Last_Modified:
lea eax, [ebp - 0x34]
push eax
mov ecx, esi
call fcn.004024fc
mov ecx, dword [eax + 4]
call fcn.00401fdf
push dword [ebp - 0x30]
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], edx
call fcn.004019a0
pop ecx
lea eax, [ebp - 0x5c]
push eax
push ebx
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x44], eax
jne 0x402d49
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push dword [ebp - 0x10]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_MoveFileA]
push 0x80
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea ecx, [ebp - 5]
call fcn.0040192e
push dword [ebp - 0x48]
call fcn.004019a0
push dword [ebp - 0x20]
call fcn.004019a0
push dword [ebp - 0x10]
call fcn.004019a0
push dword [ebp - 0x38]
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
add esp, 0x14
jmp 0x402ea3
lea ecx, [ebp - 5]
call fcn.0040192e
push dword [ebp - 0x48]
call fcn.004019a0
push dword [ebp - 0x20]
call fcn.004019a0
push dword [ebp - 0x10]
call fcn.004019a0
push dword [ebp - 0x38]
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
add esp, 0x14
jmp 0x402ea1
push ebx
push ebx
lea eax, [ebp - 0x68]
push eax
push ebx
push ebx
push dword [ebp - 0x50]
push 0x4065c0
push dword [ebp - 0xc]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
push ebx
push ebx
push ebx
push ebx
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x402db2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 4]
mov ecx, esi
call fcn.00402442
mov ecx, esi
call fcn.004024ba
cmp edi, ebx
jne 0x402dcc
mov edi, 0x2800
push edi
call fcn.0040198c
pop ecx
lea ecx, [ebp - 0xc]
push ecx
push edi
push eax
push dword [ebp - 4]
mov dword [ebp + 8], eax
mov dword [ebp - 0xc], ebx
mov dword [esi + 0x1c], ebx
mov dword [esi + 0x18], ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x402df8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [ebp + 8]
movsx eax, byte [esi]
cmp eax, 0xff
jne 0x402e46
movsx eax, byte [esi + 1]
cmp eax, 0xfe
jne 0x402e46
lea eax, [edi + 1]
push eax
call fcn.0040198c
pop ecx
push ebx
push ebx
push edi
mov esi, eax
mov eax, dword [ebp + 8]
push esi
dec edi
push edi
add eax, 2
push eax
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ecx, dword [ebp - 0x18]
push esi
call fcn.00404db2
push esi
call fcn.004019a0
mov esi, dword [ebp + 8]
pop ecx
jmp 0x402e4f
mov ecx, dword [ebp - 0x18]
push esi
call fcn.00404db2
cmp dword [ebp - 4], ebx
je 0x402e5d
push dword [ebp - 4]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp + 0xc], ebx
je 0x402e6e
push dword [ebp - 0x18]
mov ecx, dword [ebp + 0x10]
push 3
pop edx
call dword [ebp + 0xc]
push esi
call fcn.004019a0
push dword [ebp - 0x28]
call fcn.004019a0
pop ecx
pop ecx
jmp 0x402ea3
push ecx
add esi, 0x10
push str.Request_returned_code__d
push esi
call fcn.00404bb9
add esp, 0xc
cmp dword [ebp + 0xc], ebx
je 0x402ea1
mov ecx, dword [ebp + 0x10]
push esi
push 2
pop edx
call dword [ebp + 0xc]
mov bl, 1
push dword [ebp - 0x50]
call fcn.004019a0
pop ecx
mov al, bl
pop edi
pop esi
pop ebx
leave
ret 0xc