Function at 0x407965
Capabilities:
Check http status code
Connect to http server
Get file attributes
Move file
Read and send data from client to server
Read data from internet
Read file on windows
Receive data
Send data
Send http request
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x428100
mov eax, dword fs:[0]
push eax
mov eax, 0x97d4
call fcn.0041d570
mov eax, dword [0x434558]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x97a8], esi
mov ecx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x97b8], eax
xor eax, eax
mov dword [ebp - 0x97bc], ecx
push ecx
lea ecx, [ebp - 0x97a0]
mov dword [ebp - 0x97b0], ebx
mov dword [ebp - 0x97ac], edi
mov dword [ebp - 0x97d0], eax
mov byte [ebp - 0x97a1], al
call fcn.004071eb
cmp dword [ebp - 0x7a5c], 0
jne 0x4079ff
test ebx, ebx
je 0x4079f7
push str.Protocol_not_supported
push 5
push edi
call ebx
add esp, 0xc
xor eax, eax
inc eax
jmp 0x408521
xor eax, eax
push eax
push eax
push dword [ebp - 0x7a5c]
lea eax, [ebp - 0x96e0]
push eax
lea eax, [ebp - 0x9760]
push eax
push dword [ebp - 0x9260]
lea eax, [ebp - 0x9660]
push eax
push dword [esi + 4]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x97b4], eax
xor ecx, ecx
mov dword [ebp - 4], ecx
test eax, eax
jne 0x407a55
test ebx, ebx
je 0x407a4d
push str.InternetConnect___failed
push 5
push edi
call ebx
add esp, 0xc
or edi, 0xffffffff
jmp 0x40851f
xor ebx, ebx
mov edx, ebx
movzx ecx, word [ebp + edx - 0x925c]
lea edx, [edx + 2]
mov word [ebp + edx - 0x7a1a], cx
test cx, cx
jne 0x407a59
lea edx, [ebp - 0x8a5c]
mov esi, edx
mov cx, word [edx]
add edx, 2
cmp cx, bx
jne 0x407a79
lea edi, [ebp - 0x7a18]
sub edx, esi
sub edi, 2
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x407a8f
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
cmp dword [ebp - 0x7a5c], 3
rep movsb byte es:[edi], byte [esi]
jne 0x40853f
push ebx
push 0x400000
lea ecx, [ebp - 0x97dc]
mov dword [ebp - 0x97dc], 0x42ffe4
push ecx
push ebx
push ebx
lea ecx, [ebp - 0x7a18]
mov dword [ebp - 0x97d8], ebx
push ecx
push str.HEAD
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov ebx, eax
mov dword [ebp - 0x97d4], ebx
xor eax, eax
mov byte [ebp - 4], 1
push eax
push eax
push eax
push eax
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x407b17
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x407b17
push 0x11
pop edi
jmp 0x4080a9
mov edi, dword [ebp - 0x97a8]
mov ecx, edi
push ebx
call fcn.004077f9
mov ecx, edi
call fcn.00407793
push 0x13
xor eax, eax
push ebx
mov dword [ebp - 0x97c4], eax
call fcn.004076a6
cmp eax, 0xc8
je 0x407bfb
mov esi, dword [ebp - 0x97b4]
add eax, 0xfffffed3
cmp eax, 1
ja 0x407bf3
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
mov esi, eax
mov dword [ebp - 0x97b4], esi
test ebx, ebx
je 0x407b81
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
mov ebx, eax
mov dword [ebp - 0x97d4], ebx
push str.Location:
mov ecx, edi
call fcn.00407727
lea edx, [ebp - 0x6a18]
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
lea eax, [eax + 2]
test cx, cx
jne 0x407b95
mov eax, dword [ebp - 0x97b0]
cmp word [ebp - 0x6a18], si
jne 0x407bd1
test eax, eax
je 0x407bc9
push str.Redirected_to_unknown_location
push 5
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
or edi, 0xffffffff
jmp 0x4084c0
push dword [ebp - 0x97ac]
mov ecx, edi
push eax
push dword [ebp - 0x97b8]
lea eax, [ebp - 0x6a18]
push eax
call fcn.00407965
mov edi, eax
jmp 0x4084c0
push 0xfffffffffffffffe
pop edi
jmp 0x4084c0
push 5
push ebx
call fcn.004076a6
mov dword [ebp - 0x97c4], eax
test ebx, ebx
je 0x407c20
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
mov ebx, eax
mov dword [ebp - 0x97d4], ebx
jmp 0x407c22
xor eax, eax
push str.Content_Type:
mov ecx, edi
mov byte [ebp - 0x97a2], al
call fcn.00407727
lea edx, [ebp - 0x218]
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
lea eax, [eax + 2]
test cx, cx
jne 0x407c3c
lea eax, [ebp - 0x218]
push str.text_html
push eax
call fcn.0040eeb8
pop ecx
pop ecx
test eax, eax
jne 0x407c79
lea eax, [ebp - 0x218]
push str.text_plain
push eax
call fcn.0040eeb8
pop ecx
pop ecx
test eax, eax
je 0x407cb1
mov esi, dword [ebp - 0x97b0]
mov edi, dword [ebp - 0x97ac]
mov byte [ebp - 0x97a2], 1
test esi, esi
je 0x407cbd
push dword [ebp - 0x97bc]
push 6
push edi
call esi
add esp, 0xc
neg al
sbb al, al
inc al
mov byte [ebp - 0x97a1], al
je 0x407cbd
jmp 0x407d9e
mov esi, dword [ebp - 0x97b0]
mov edi, dword [ebp - 0x97ac]
xor eax, eax
push 0x400
push eax
lea eax, [ebp - 0x1618]
push eax
call fcn.00413be0
add esp, 0xc
push 0x2f
pop eax
push eax
lea eax, [ebp - 0x925c]
push eax
call fcn.0040e1ee
pop ecx
pop ecx
mov ecx, eax
test ecx, ecx
je 0x407d2e
push 0x2f
pop esi
add ecx, 2
lea eax, [ebp - 0x1618]
sub eax, ecx
mov edx, ecx
mov dword [ebp - 0x97bc], eax
mov edi, eax
movzx eax, word [edx]
mov word [edi + edx], ax
lea edx, [edx + 2]
test ax, ax
jne 0x407d04
push esi
push ecx
call fcn.0040e1ee
pop ecx
pop ecx
mov ecx, eax
test ecx, ecx
jne 0x407cef
mov esi, dword [ebp - 0x97b0]
mov edi, dword [ebp - 0x97ac]
lea eax, [ebp - 0x1618]
push 0x3f
push eax
call fcn.0040e1ee
pop ecx
pop ecx
test eax, eax
je 0x407d47
xor ecx, ecx
mov word [eax], cx
test esi, esi
je 0x407d68
lea eax, [ebp - 0x1618]
push eax
push 7
push edi
call esi
add esp, 0xc
neg al
sbb al, al
inc al
mov byte [ebp - 0x97a1], al
jmp 0x407d6e
mov al, byte [ebp - 0x97a1]
test al, al
jne 0x407d93
test esi, esi
je 0x407da6
lea eax, [ebp - 0x97c4]
push eax
push 1
push edi
call esi
add esp, 0xc
neg al
sbb al, al
inc al
mov byte [ebp - 0x97a1], al
je 0x407da6
xor eax, eax
push eax
push 3
push edi
call esi
add esp, 0xc
or edi, 0xffffffff
jmp 0x4080a9
mov edx, dword [ebp - 0x97b8]
test edx, edx
je 0x407dd2
xor eax, eax
cmp word [edx], ax
je 0x407dd2
lea ecx, [ebp - 0xa18]
sub ecx, edx
movzx eax, word [edx]
mov word [ecx + edx], ax
lea edx, [edx + 2]
test ax, ax
jne 0x407dbf
xor edx, edx
jmp 0x407ded
xor edx, edx
mov ecx, edx
movzx eax, word [ecx + 0x43007c]
lea ecx, [ecx + 2]
mov word [ebp + ecx - 0xa1a], ax
test ax, ax
jne 0x407dd6
cmp word [ebp - 0xa18], 0
mov ecx, edx
push 0x5c
pop esi
je 0x407e1c
push 0x2f
lea eax, [ebp - 0xa18]
pop edi
cmp word [eax], di
jne 0x407e0d
mov word [eax], si
inc ecx
lea eax, [ebp - 0xa18]
lea eax, [eax + ecx*2]
cmp word [eax], dx
jne 0x407e05
cmp word [ebp + ecx*2 - 0xa1a], si
jne 0x407e62
lea edx, [ebp - 0x1618]
xor ecx, ecx
mov esi, edx
mov ax, word [edx]
add edx, 2
cmp ax, cx
jne 0x407e30
lea edi, [ebp - 0xa18]
sub edx, esi
sub edi, 2
mov ax, word [edi + 2]
add edi, 2
cmp ax, cx
jne 0x407e46
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
xor edx, edx
rep movsb byte es:[edi], byte [esi]
mov ecx, edx
movzx eax, word [ebp + ecx - 0xa18]
lea ecx, [ecx + 2]
mov word [ebp + ecx - 0x121a], ax
test ax, ax
jne 0x407e64
lea edi, [ebp - 0x1218]
sub edi, 2
mov ax, word [edi + 2]
add edi, 2
cmp ax, dx
jne 0x407e85
mov esi, str..dul_
push str.Last_Modified:
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x97a8]
mov ecx, esi
call fcn.00407727
lea edx, [ebp - 0x1a18]
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
lea eax, [eax + 2]
test cx, cx
jne 0x407eb3
lea ecx, [ebp - 0x1a18]
call fcn.00406fbc
lea ecx, [ebp - 0xa18]
mov dword [ebp - 0x97cc], eax
mov dword [ebp - 0x97bc], edx
call fcn.0040719f
mov edi, eax
mov dword [ebp - 0x97b8], edx
xor eax, eax
push 0x30
push eax
lea eax, [ebp - 0x7a58]
push eax
call fcn.00413be0
mov eax, dword [ebp - 0x97b8]
mov ecx, edi
add esp, 0xc
or ecx, eax
je 0x40801e
cmp edi, dword [ebp - 0x97cc]
jne 0x40801e
cmp eax, dword [ebp - 0x97bc]
jne 0x40801e
lea eax, [ebp - 0x7a58]
push eax
lea eax, [ebp - 0xa18]
push eax
call fcn.0040ea3e
pop ecx
pop ecx
test eax, eax
jne 0x40801e
mov eax, dword [ebp - 0x7a44]
cmp eax, dword [ebp - 0x97c4]
jne 0x40801e
mov eax, dword [ebp - 0x97b0]
test eax, eax
je 0x407f73
push str.File_exists__aborting
push 5
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
cmp byte [ebp - 0x97a2], 0
je 0x408015
xor eax, eax
push eax
lea eax, [ebp - 0xa18]
push 0x8002
push eax
call fcn.0040e674
add esp, 0xc
mov dword [ebp - 0x97cc], eax
push eax
call fcn.0040e29c
mov edi, eax
pop ecx
lea esi, [edi + 1]
push esi
call fcn.0040cb1a
pop ecx
push esi
xor ecx, ecx
mov dword [ebp - 0x97bc], eax
push ecx
push eax
call fcn.00413be0
mov esi, dword [ebp - 0x97cc]
add esp, 0xc
push edi
mov edi, dword [ebp - 0x97bc]
push edi
push esi
call fcn.0040f409
add esp, 0xc
push esi
call fcn.00410cd0
mov eax, dword [ebp - 0x97b0]
pop ecx
test eax, eax
je 0x40800e
push edi
push 8
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
neg al
sbb al, al
inc al
je 0x40800e
lea eax, [ebp - 0xa18]
push eax
call fcn.0040fcdc
pop ecx
push edi
call fcn.0040e095
pop ecx
xor eax, eax
mov edi, eax
jmp 0x4080a9
xor eax, eax
lea ecx, [ebp - 0x1218]
mov dword [ebp - 0x97c0], eax
call fcn.0040719f
or eax, edx
je 0x408071
lea eax, [ebp - 0x7a58]
push eax
lea eax, [ebp - 0x1218]
push eax
call fcn.0040ea3e
pop ecx
pop ecx
test eax, eax
jne 0x408071
push eax
lea eax, [ebp - 0x1218]
push 0x8002
push eax
call fcn.0040e674
mov dword [esi + 0xc], eax
mov eax, dword [ebp - 0x7a44]
mov dword [ebp - 0x97c0], eax
jmp 0x408098
lea eax, [ebp - 0x1218]
push eax
call fcn.0040fcdc
mov dword [esp], 0x180
lea eax, [ebp - 0x1218]
push 0x8302
push eax
call fcn.0040e674
mov dword [esi + 0xc], eax
or edi, 0xffffffff
add esp, 0xc
mov dword [ebp - 0x97e0], edi
cmp dword [esi + 0xc], edi
jne 0x4080b4
mov esi, dword [ebp - 0x97b4]
jmp 0x4084c0
lea eax, [ebp - 0x1218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
or eax, 2
push eax
lea eax, [ebp - 0x1218]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov ecx, dword [ebp - 0x97c0]
mov esi, dword [ebp - 0x97b4]
cmp ecx, dword [ebp - 0x97c4]
jge 0x408336
xor ecx, ecx
lea eax, [ebp - 0x97dc]
push ecx
push 0x400000
push eax
push ecx
push ecx
lea eax, [ebp - 0x7a18]
push eax
push 0x4300dc
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
push dword [ebp - 0x97c0]
mov ebx, eax
lea eax, [ebp - 0x118]
push str.Range:_bytes_d__r_n
push eax
mov dword [ebp - 0x97d4], ebx
call dword [sym.imp.USER32.dll_wsprintfW]
lea ecx, [ebp - 0x118]
add esp, 0xc
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x97d0]
jne 0x40813a
xor eax, eax
sub ecx, edx
push eax
push eax
sar ecx, 1
lea eax, [ebp - 0x118]
push ecx
push eax
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x40816e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4081b4
mov ecx, dword [ebp - 0x97a8]
push ebx
call fcn.004077f9
mov ecx, dword [ebp - 0x97a8]
call fcn.00407793
push 0x13
push ebx
call fcn.004076a6
push 0x64
cdq
pop ecx
idiv ecx
cmp eax, 2
je 0x4081d1
mov eax, dword [ebp - 0x97b0]
test eax, eax
je 0x4081b4
push str.Sould_be__2xx_
push 5
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
mov eax, dword [ebp - 0x97a8]
push dword [eax + 0xc]
call fcn.00410cd0
mov eax, dword [ebp - 0x97a8]
pop ecx
mov dword [eax + 0xc], edi
jmp 0x4084c0
mov ecx, dword [ebp - 0x97a8]
push str.Content_Range:_bytes
call fcn.00407727
lea edx, [ebp - 0x118]
sub edx, eax
movzx ecx, word [eax]
mov word [eax + edx], cx
lea eax, [eax + 2]
test cx, cx
jne 0x4081e9
lea eax, [ebp - 0x118]
push eax
call fcn.0040e6a1
pop ecx
xor esi, esi
mov dword [ebp - 0x97c0], eax
push esi
push eax
mov eax, dword [ebp - 0x97a8]
push dword [eax + 0xc]
call fcn.004100e1
add esp, 0xc
push 0x2800
call fcn.0040cb1a
mov dword [ebp - 0x97c8], esi
mov esi, dword [ebp - 0x97b0]
pop ecx
mov dword [ebp - 0x97b8], eax
jmp 0x408245
mov eax, dword [ebp - 0x97b8]
lea ecx, [ebp - 0x97c8]
push ecx
push 0x2800
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x408263
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x97c8], 0
je 0x4082c9
push dword [ebp - 0x97c8]
mov eax, dword [ebp - 0x97a8]
push dword [ebp - 0x97b8]
push dword [eax + 0xc]
call fcn.00410277
mov eax, dword [ebp - 0x97c8]
add esp, 0xc
add dword [ebp - 0x97c0], eax
test esi, esi
je 0x4082bb
lea eax, [ebp - 0x97c0]
push eax
push 4
push dword [ebp - 0x97ac]
call esi
add esp, 0xc
neg al
sbb al, al
inc al
mov byte [ebp - 0x97a1], al
jmp 0x4082c1
mov al, byte [ebp - 0x97a1]
test al, al
je 0x40823f
push dword [ebp - 0x97b8]
call fcn.0040e095
mov esi, dword [ebp - 0x97b4]
pop ecx
mov ecx, dword [ebp - 0x97c0]
cmp ecx, dword [ebp - 0x97c4]
je 0x408336
mov eax, dword [ebp - 0x97b0]
test eax, eax
je 0x40830b
push str.Error_during_downloading__network_error
push 5
push dword [ebp - 0x97ac]
call eax
mov ecx, dword [ebp - 0x97c0]
add esp, 0xc
mov eax, dword [ebp - 0x97a8]
push ecx
push dword [eax + 0xc]
call fcn.0040f14b
mov eax, dword [ebp - 0x97a8]
push dword [eax + 0xc]
call fcn.00410cd0
mov eax, dword [ebp - 0x97a8]
mov dword [eax + 0xc], edi
jmp 0x4084bd
mov eax, dword [ebp - 0x97a8]
push ecx
push dword [eax + 0xc]
call fcn.0040f14b
mov eax, dword [ebp - 0x97a8]
push dword [eax + 0xc]
call fcn.00410cd0
mov eax, dword [ebp - 0x97bc]
add esp, 0xc
mov ecx, dword [ebp - 0x97cc]
mov dword [ebp - 0x7a24], eax
mov dword [ebp - 0x7a1c], eax
lea eax, [ebp - 0x7a28]
push eax
lea eax, [ebp - 0x1218]
mov dword [ebp - 0x7a28], ecx
push eax
mov dword [ebp - 0x7a20], ecx
call fcn.0040fce5
cmp byte [ebp - 0x97a2], 0
mov eax, dword [ebp - 0x97a8]
pop ecx
pop ecx
mov dword [eax + 0xc], edi
je 0x40845e
xor eax, eax
push eax
lea eax, [ebp - 0x1218]
push 0x8002
push eax
call fcn.0040e674
add esp, 0xc
mov dword [ebp - 0x97bc], eax
push eax
call fcn.0040e29c
pop ecx
mov dword [ebp - 0x97d0], eax
lea edi, [eax + 1]
push edi
call fcn.0040cb1a
pop ecx
push edi
xor ecx, ecx
mov dword [ebp - 0x97b8], eax
push ecx
push eax
call fcn.00413be0
mov edi, dword [ebp - 0x97bc]
add esp, 0xc
push dword [ebp - 0x97d0]
push dword [ebp - 0x97b8]
push edi
call fcn.0040f409
add esp, 0xc
push edi
call fcn.00410cd0
mov eax, dword [ebp - 0x97b0]
mov edi, dword [ebp - 0x97b8]
pop ecx
test eax, eax
je 0x40843a
push edi
push 8
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
neg al
sbb al, al
inc al
mov byte [ebp - 0x97a1], al
jmp 0x408440
mov al, byte [ebp - 0x97a1]
test al, al
je 0x408451
lea eax, [ebp - 0x1218]
push eax
call fcn.0040fcdc
pop ecx
push edi
call fcn.0040e095
mov edi, dword [ebp - 0x97e0]
pop ecx
mov al, byte [ebp - 0x97a1]
test al, al
je 0x408479
mov eax, dword [ebp - 0x97b0]
test eax, eax
je 0x4084c0
xor ecx, ecx
push ecx
push 3
jmp 0x4084b5
lea eax, [ebp - 0xa18]
push eax
call fcn.0040fcdc
pop ecx
lea eax, [ebp - 0xa18]
push eax
lea eax, [ebp - 0x1218]
push eax
call fcn.0040ff6b
pop ecx
pop ecx
test eax, eax
je 0x4084cd
call fcn.00406f3c
mov eax, dword [ebp - 0x97b0]
test eax, eax
je 0x4084c0
push str.Error_during_renaming_tmp_file
push 5
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
test ebx, ebx
je 0x408514
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x408514
lea eax, [ebp - 0xa18]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
and eax, 0xfffffffd
push eax
lea eax, [ebp - 0xa18]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [ebp - 0x97b0]
test eax, eax
je 0x408505
xor ecx, ecx
push ecx
push 9
push dword [ebp - 0x97ac]
call eax
add esp, 0xc
test ebx, ebx
je 0x408510
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor ebx, ebx
mov edi, ebx
test esi, esi
je 0x40851f
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040d5c1
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [ebp - 0x97b4]
jmp 0x408512