Function at 0x402240
Capabilities:
Check internet connectivity via wininet
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x42c
mov eax, dword [0x42d024]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
mov ebx, edx
push 0
lea edx, [ebp - 0x42c]
push edx
mov dword [ebp - 0x414], eax
mov dword [ebp - 0x428], ecx
mov dword [ebp - 0x42c], 0
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
test eax, eax
jne 0x40229b
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00413f0d
mov esp, ebp
pop ebp
ret
mov eax, edi
mov dword [ebp - 0x410], 0
call fcn.004021a0
mov edi, eax
push 0
mov dword [ebp - 0x420], edi
push 0
test esi, esi
je 0x4022d0
push esi
push 3
push ebx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebx, eax
mov dword [ebp - 0x418], ebx
jmp 0x4022e3
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x418], eax
mov ebx, eax
test ebx, ebx
je 0x40251d
movzx eax, word [edi + 8]
mov ecx, dword [edi + 4]
push 1
push 0
push 3
push 0
push 0
push eax
push ecx
push ebx
call dword [sym.imp.WININET.dll_InternetConnectA]
mov edi, eax
mov dword [ebp - 0x41c], edi
test edi, edi
je 0x402510
mov edx, dword [ebp - 0x420]
mov cl, byte [edx]
mov eax, 0x400000
mov byte [ebp - 0x409], cl
test cl, cl
je 0x402331
mov eax, 0xc00000
cmp byte [ebp + 0x14], 0
mov ecx, str.POST
jne 0x402341
mov ecx, 0x4275cc
push 1
push eax
mov eax, dword [ebp - 0x414]
push 0
push 0
push 0
push eax
push ecx
push edi
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov esi, eax
mov dword [ebp - 0x414], esi
test esi, esi
je 0x402509
cmp byte [ebp - 0x409], 0
je 0x4023b9
lea ecx, [ebp - 0x424]
push ecx
lea edx, [ebp - 0x408]
push edx
push 0x1f
push edi
mov dword [ebp - 0x408], 0
mov dword [ebp - 0x424], 4
call dword [sym.imp.WININET.dll_InternetQueryOptionA]
or dword [ebp - 0x408], 0x3100
push 4
lea eax, [ebp - 0x408]
push eax
push 0x1f
push esi
call dword [sym.imp.WININET.dll_InternetSetOptionA]
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x402502
call fcn.004042a0
mov ebx, dword [sym.imp.WININET.dll_InternetReadFile]
lea ecx, [ebp - 0x410]
push ecx
push 0x3ff
lea edx, [ebp - 0x404]
push edx
push esi
mov dword [ebp - 0x408], eax
call ebx
test eax, eax
je 0x402465
jmp 0x402400
mov edi, dword [ebp - 0x410]
test edi, edi
je 0x40245f
mov esi, dword [ebp - 0x408]
lea eax, [ebp - 0x404]
push eax
mov byte [ebp + edi - 0x404], 0
call fcn.004042f0
mov eax, dword [ebp - 0x428]
add esp, 4
test eax, eax
je 0x402439
mov ecx, dword [ebp - 0x410]
add dword [eax], ecx
mov ecx, dword [ebp - 0x414]
lea edx, [ebp - 0x410]
push edx
push 0x3ff
lea eax, [ebp - 0x404]
push eax
push ecx
call ebx
mov esi, dword [ebp - 0x414]
test eax, eax
jne 0x402400
mov edi, dword [ebp - 0x41c]
mov edx, dword [ebp - 0x408]
mov ebx, dword [edx + 4]
test ebx, ebx
je 0x4024c0
lea esi, [ebx + 1]
push esi
call fcn.00414f9a
add esp, 4
test eax, eax
je 0x402475
xor ecx, ecx
mov dword [ebp - 0x410], eax
test ebx, ebx
je 0x4024ab
mov edx, dword [ebp - 0x408]
mov esi, dword [edx + 4]
mov edi, dword [edx]
lea esp, [esp]
mov dl, byte [edi + ecx]
mov byte [eax + ecx], dl
inc ecx
cmp ecx, esi
jb 0x4024a0
mov esi, dword [ebp - 0x414]
mov edi, dword [ebp - 0x41c]
mov byte [ebx + eax], 0
jmp 0x4024d7
push 8
call fcn.00414f9a
add esp, 4
test eax, eax
je 0x4024c0
mov dword [ebp - 0x410], eax
mov byte [eax], 0
mov ebx, dword [ebp - 0x408]
mov eax, dword [ebx]
mov dword [ebx + 4], 0
test eax, eax
je 0x4024f3
push eax
call fcn.00414f60
add esp, 4
push ebx
call fcn.00414f60
mov ebx, dword [ebp - 0x418]
add esp, 4
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov edi, dword [ebp - 0x420]
mov eax, dword [edi + 4]
test eax, eax
je 0x40252d
push eax
call fcn.00414f60
add esp, 4
push edi
call fcn.00414f60
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x410]
add esp, 4
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413f0d
mov esp, ebp
pop ebp
ret