Function at 0x405040
Capabilities:
Check internet connectivity via wininet
Connect to http server
Create http request
Create thread
Download and write a file
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 0x46166f
mov eax, dword fs:[0]
push eax
mov eax, 0x2500
call fcn.0043d5f0
mov eax, dword [0x49106c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x24a8], ecx
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0x18]
mov edx, dword [ebp + 0x10]
mov esi, dword [ebp + 0x14]
mov dword [ebp - 0x24ac], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x24b4], 0
mov dword [ebp - 0x24e0], eax
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x24e4], eax
mov eax, dword [ebp + 0x1c]
push 0xffffffffffffffff
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x24], eax
mov dword [ecx + 0x1c], esi
mov dword [ecx + 0x20], edx
mov byte [ecx + 0x18], 1
push dword [edi]
mov dword [ebp - 0x24c8], edx
mov dword [ebp - 0x24c4], esi
mov dword [ebp - 0x24c0], edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x405930
lea eax, [ebp - 0x2498]
mov dword [ebp - 0x2498], 8
push eax
lea eax, [ebp - 0x24d0]
push eax
push 0x32
push 0
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
test eax, eax
je 0x405bbb
mov eax, dword [ebp - 0x24d0]
and eax, 1
je 0x405bbb
push 0xffffffffffffffff
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x405930
push 0
lea eax, [ebp - 0x2498]
mov dword [ebp - 0x2498], 0
push eax
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test eax, eax
je 0x405bb4
test byte [ebp - 0x2498], 0x20
jne 0x405bb4
push 0xffffffffffffffff
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x405930
push 0x473818
lea ecx, [ebp - 0x24a0]
call fcn.00406700
mov eax, dword [ebp - 0x24a8]
mov dword [ebp - 4], 0
mov eax, dword [eax + 4]
cmp dword [eax - 0xc], 0
je 0x405206
push 4
push str.POST
lea ecx, [ebp - 0x24a0]
call fcn.004076f0
push str.text_xml
lea ecx, [ebp - 0x24b0]
call fcn.00406700
push str.content_type
lea ecx, [ebp - 0x2498]
mov byte [ebp - 4], 1
call fcn.00406700
mov ecx, dword [ebp - 0x24a8]
lea eax, [ebp - 0x24b0]
push eax
lea eax, [ebp - 0x2498]
mov byte [ebp - 4], 2
push eax
call fcn.00404860
lea ecx, [ebp - 0x2498]
call fcn.004061b0
lea ecx, [ebp - 0x24b0]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004067a0
mov eax, dword [ebp - 0x24c8]
mov byte [ebp - 4], 3
push dword [eax]
lea eax, [ebp - 0x249c]
push dword [esi]
push str.bytes_d__d
push eax
call fcn.004082d0
add esp, 0x10
lea ecx, [ebp - 0x2498]
push 0x473874
call fcn.00406700
mov ecx, dword [ebp - 0x24a8]
lea eax, [ebp - 0x249c]
push eax
lea eax, [ebp - 0x2498]
mov byte [ebp - 4], 4
push eax
call fcn.00404860
lea ecx, [ebp - 0x2498]
mov byte [ebp - 4], 3
mov esi, eax
call fcn.004061b0
cmp esi, 2
jne 0x4052fa
push 0x473880
lea ecx, [ebp - 0x2498]
call fcn.00406700
mov esi, dword [ebp - 0x24a8]
lea eax, [ebp - 0x2498]
push eax
lea eax, [ebp - 0x24b0]
push eax
lea ecx, [esi + 0x30]
call fcn.00405fb0
lea ecx, [esi + 0x30]
push dword [eax]
lea eax, [ebp - 0x24cc]
push eax
call fcn.00407960
lea ecx, [ebp - 0x2498]
call fcn.004061b0
push str.Range
lea ecx, [ebp - 0x2498]
call fcn.00406700
lea eax, [ebp - 0x249c]
mov byte [ebp - 4], 5
push eax
lea eax, [ebp - 0x2498]
mov ecx, esi
push eax
call fcn.00404860
lea ecx, [ebp - 0x2498]
mov byte [ebp - 4], 3
call fcn.004061b0
mov eax, dword [ebp - 0x24a8]
add eax, 0x30
push eax
lea eax, [ebp - 0x24a4]
push eax
call fcn.00404180
push 0xffffffffffffffff
mov byte [ebp - 4], 6
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, dword [ebp + 0x1c]
cmp dword [esi], 0
jne 0x40590f
mov ecx, dword [ebp - 0x24a8]
push 0
push 0
push 0
push 0
push dword [ecx + 0x44]
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ecx, dword [ebp - 0x24a8]
push eax
lea ecx, [ecx + 0xc]
call fcn.00405c00
mov ecx, dword [ebp - 0x24a8]
cmp dword [ecx + 0xc], 0
jne 0x405387
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 6
jmp 0x405bc0
lea ecx, [ebp - 0x2494]
call fcn.004020d0
push 4
push dword [0x4862c0]
mov eax, 0x50
mov dword [ebp - 0x44], 2
mov word [ebp - 0x48], ax
mov eax, ecx
push 0x21
push eax
mov dword [ebp - 0x40], 4
call fcn.00445b4a
push eax
call fcn.004012e0
add esp, 0x14
lea ecx, [ebp - 0x2494]
call fcn.004020d0
mov eax, dword [ebp - 0x24ac]
push dword [eax]
call fcn.00401880
test eax, eax
jne 0x40540b
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 8
jmp 0x405bc0
push 0xffffffffffffffff
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [esi], 0
jne 0x40590f
mov ecx, dword [ebp - 0x24a8]
lea eax, [ebp - 0x2452]
push 0
push 0
push 3
push 0x473898
push 0x47389c
push dword [ebp - 0x48]
push eax
push dword [ecx + 0xc]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov esi, eax
mov dword [ebp - 0x24ac], esi
mov byte [ebp - 4], 7
test esi, esi
jne 0x40548b
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
lea eax, [esi + 7]
jmp 0x405bc0
mov ecx, 0x1bb
mov eax, 0x84c03300
cmp word [ebp - 0x48], cx
mov edi, 0x84403300
lea ecx, [ebp - 0x24b8]
cmove edi, eax
lea eax, [ebp - 0x204c]
push eax
call fcn.00406700
lea eax, [ebp - 0x104a]
mov byte [ebp - 4], 8
push eax
lea ecx, [ebp - 0x24b8]
call fcn.004065f0
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x4058f9
mov eax, dword [ebp - 0x24a8]
cmp dword [eax + 0x4c], 0
je 0x405502
push str.HTTP_1.1
lea ecx, [ebp - 0x28]
call fcn.00406010
mov dword [ebp - 0x24b4], 1
cmp dword [eax + 0x14], 8
jb 0x405504
mov eax, dword [eax]
jmp 0x405504
xor eax, eax
push 0
push edi
push 0
push 0
push eax
push dword [ebp - 0x24b8]
push dword [ebp - 0x24a0]
push esi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov edi, eax
mov dword [ebp - 0x24b0], edi
mov byte [ebp - 4], 9
test byte [ebp - 0x24b4], 1
je 0x40553c
lea ecx, [ebp - 0x28]
call fcn.00406d00
test edi, edi
jne 0x40558a
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
lea eax, [edi + 9]
jmp 0x405bc0
mov esi, dword [ebp - 0x24c0]
push 0xffffffffffffffff
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x4058ee
lea eax, [ebp - 0x24b4]
mov dword [ebp - 0x24b4], 4
push eax
lea eax, [ebp - 0x2498]
push eax
push 0x1f
push edi
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
or dword [ebp - 0x2498], 0x100
lea eax, [ebp - 0x2498]
push 4
push eax
push 0x1f
push edi
call dword [sym.imp.WININET.dll_InternetSetOptionW]
mov eax, dword [ebp - 0x24a0]
mov ecx, 0x4738b4
nop
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x405616
test dx, dx
je 0x405612
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x405616
add eax, 4
add ecx, 4
test dx, dx
jne 0x4055f0
xor eax, eax
jmp 0x40561b
sbb eax, eax
or eax, 1
test eax, eax
sete al
test al, al
je 0x40563b
mov eax, dword [ebp - 0x24a4]
push 0
push 0
push dword [eax - 0xc]
push eax
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
jmp 0x4056a9
mov edx, dword [ebp - 0x24a8]
lea ecx, [ebp - 0x2498]
lea edx, [edx + 4]
call fcn.004114e0
lea eax, [ebp - 0x2498]
mov byte [ebp - 4], 0xa
push eax
lea ecx, [ebp - 0x24d4]
call fcn.00406850
mov ecx, dword [ebp - 0x2498]
mov edx, dword [eax + 4]
push dword [ecx - 0xc]
mov eax, dword [ebp - 0x24a4]
push edx
push dword [eax - 0xc]
push eax
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
lea ecx, [ebp - 0x24d4]
mov dword [ebp - 0x24b4], eax
call fcn.004067d0
lea ecx, [ebp - 0x2498]
mov byte [ebp - 4], 9
call fcn.004061b0
mov eax, dword [ebp - 0x24b4]
test eax, eax
jne 0x4056f9
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 0xa
jmp 0x405bc0
push 0xffffffffffffffff
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x4058ee
lea eax, [ebp - 0x24b4]
mov dword [ebp - 0x24b4], edi
push eax
lea eax, [ebp - 0x24bc]
push eax
call fcn.00403ca0
lea eax, [ebp - 0x24b4]
mov byte [ebp - 4], 0xb
push eax
lea eax, [ebp - 0x2498]
mov dword [ebp - 0x24b4], edi
push eax
call fcn.00403b20
mov ecx, dword [ebp - 0x24a8]
add ecx, 8
mov byte [ebp - 4], 0xc
push eax
call fcn.00406690
lea ecx, [ebp - 0x2498]
mov byte [ebp - 4], 0xb
call fcn.004061b0
mov eax, dword [ebp - 0x24a8]
push 0x4738bc
push dword [eax + 8]
call fcn.004446e4
add esp, 8
test eax, eax
je 0x4057f2
mov eax, dword [ebp - 0x24a8]
push 0x4738c4
push dword [eax + 8]
call fcn.004446e4
add esp, 8
test eax, eax
je 0x4057f2
lea ecx, [ebp - 0x24bc]
call fcn.004061b0
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 0xb
jmp 0x405bc0
mov eax, dword [ebp - 0x24a8]
push 0
push 0
push eax
push 0x404fb0
push 0
mov dword [eax + 0x10], edi
push 0
mov dword [eax + 0x14], 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebp - 0x24a8]
mov dword [ecx + 0x14], eax
lea eax, [ecx + 0x28]
push eax
lea eax, [ebp - 0x24bc]
push eax
call fcn.00403d90
push 0xffffffffffffffff
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x4058e3
push 0x4738cc
lea ecx, [ebp - 0x24b4]
call fcn.00406700
mov ecx, dword [ebp - 0x24a8]
lea eax, [ebp - 0x24b4]
push eax
lea eax, [ebp - 0x24cc]
push eax
lea ecx, [ecx + 0x28]
call fcn.00405fb0
lea ecx, [ebp - 0x24b4]
call fcn.004061b0
push 0x20000
call fcn.0043cb8a
add esp, 4
mov dword [ebp - 0x24e8], 0
mov esi, eax
mov dword [ebp - 0x250c], 0x28
mov eax, dword [ebp - 0x24c0]
xorps xmm0, xmm0
movups xmmword [ebp - 0x24f8], xmm0
push 0xffffffffffffffff
movups xmmword [ebp - 0x2508], xmm0
mov dword [ebp - 0x24f4], 0x20000
push dword [eax]
mov dword [ebp - 0x24f8], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
je 0x405940
push 1
push esi
call fcn.0043cb7c
add esp, 8
lea ecx, [ebp - 0x24bc]
call fcn.004061b0
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 0xf
jmp 0x405bc0
mov eax, dword [ebp - 0x24c0]
push 0xffffffffffffffff
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x4058d8
push 0
push 4
lea eax, [ebp - 0x250c]
push eax
push edi
call dword [sym.imp.WININET.dll_InternetReadFileExW]
mov edx, dword [ebp - 0x24a8]
mov ecx, dword [ebp - 0x24f4]
mov dword [ebp - 0x24b4], ecx
mov dword [edx + 0x10], 0
test eax, eax
je 0x405b55
test ecx, ecx
je 0x405a75
mov eax, dword [ebp - 0x24c8]
mov ecx, dword [ebp - 0x24c4]
mov eax, dword [eax]
sub eax, dword [ecx]
mov dword [ebp - 0x2498], eax
nop dword [eax]
mov eax, dword [ebp - 0x24c0]
push 0xffffffffffffffff
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x4058d8
mov eax, dword [ebp - 0x24c4]
xorps xmm0, xmm0
mov ecx, dword [ebp - 0x24b4]
mov edx, dword [ebp - 0x2498]
mov dword [ebp - 0x24dc], 0
mov eax, dword [eax]
mov dword [ebp - 0x24d4], eax
lea eax, [ebp - 0x24dc]
mov dword [ebp - 0x24d8], 0
movq qword [ebp - 0x24d0], xmm0
push eax
mov eax, dword [ebp - 0x24e0]
push 0
cmp edx, ecx
jae 0x405a1b
push edx
jmp 0x405a1c
push ecx
push esi
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x405a65
call fcn.004014a0
cmp eax, 0x80070070
jne 0x405a5d
mov eax, dword [ebp - 0x24c0]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0
push 0
push 0x464
push dword [ebp - 0x24e4]
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x4059b0
test eax, eax
js 0x405af6
mov eax, dword [ebp - 0x24c4]
mov ecx, dword [ebp - 0x24b4]
add dword [eax], ecx
jmp 0x405a7b
mov eax, dword [ebp - 0x24c4]
mov edx, dword [ebp - 0x24c8]
mov eax, dword [eax]
cmp eax, dword [edx]
jae 0x405a97
test ecx, ecx
je 0x405a97
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
je 0x405940
push 1
push esi
call fcn.0043cb7c
add esp, 8
lea ecx, [ebp - 0x24bc]
call fcn.004061b0
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
xor eax, eax
jmp 0x405bc0
push 1
push esi
call fcn.0043cb7c
add esp, 8
lea ecx, [ebp - 0x24bc]
call fcn.004061b0
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 0xe
jmp 0x405bc0
push 1
push esi
call fcn.0043cb7c
add esp, 8
lea ecx, [ebp - 0x24bc]
call fcn.004061b0
lea ecx, [ebp - 0x24b0]
call fcn.00405be0
lea ecx, [ebp - 0x24b8]
call fcn.004061b0
lea ecx, [ebp - 0x24ac]
call fcn.00405be0
lea ecx, [ebp - 0x24a4]
call fcn.004061b0
lea ecx, [ebp - 0x249c]
call fcn.004061b0
lea ecx, [ebp - 0x24a0]
call fcn.004061b0
mov eax, 0xc
jmp 0x405bc0
mov eax, 5
jmp 0x405bc0
mov eax, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0043c397
mov esp, ebp
pop ebp
ret 0x1c