Function at 0x401000
Capabilities:
Resolve dns
Send icmp echo request

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x4a12d8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [str.SoraPing]
mov dl, byte [0x47d93c]
push ebx
push esi
push edi
mov edi, ecx
mov ecx, dword [0x47d938]
mov dword [ebp - 0x24], eax
xor eax, eax
push edi
mov dword [ebp - 0x20], ecx
mov byte [ebp - 0x1c], dl
mov dword [ebp - 0x1b], eax
mov dword [ebp - 0x17], eax
mov dword [ebp - 0x13], eax
mov dword [ebp - 0xf], eax
mov dword [ebp - 0xb], eax
mov word [ebp - 7], ax
mov byte [ebp - 5], al
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x30], eax
cmp eax, 0xffffffff
jne 0x4010c4
mov ecx, dword [0x4a3180]
push str.Unable_to_convert_address__lets_try_resolving_DNS_since_it_might_be_one_
mov edx, str.bw_check
mov esi, 3
call fcn.00425020
add esp, 4
push 0
lea eax, [ebp - 0x38]
push eax
push 0
push 8
push 1
push edi
call dword [sym.imp.DNSAPI.dll_DnsQuery_A]
test eax, eax
je 0x4010bb
push str.Error_resolving_DNS__this_is_not_an_ip_nor_a_DNS
mov ecx, dword [0x4a3180]
mov edx, str.bw_check
mov esi, 1
call fcn.00425020
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043e590
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x38]
mov edx, dword [ecx + 0x18]
mov dword [ebp - 0x30], edx
call dword [sym.imp.IPHLPAPI.DLL_IcmpCreateFile]
mov dword [ebp - 0x34], eax
cmp eax, 0xffffffff
jne 0x401122
mov ecx, dword [0x4a3180]
push str.Unable_to_open_handle.
mov edx, str.bw_check
mov esi, 1
call fcn.00425020
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4a3180]
push eax
push str.IcmpCreatefile_returned_error:__ld
mov edx, str.bw_check
call fcn.00425020
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043e590
mov esp, ebp
pop ebp
ret
push 0x3c
call dword [sym.imp.MSVCR100.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
jne 0x40113d
push str.Unable_to_allocate_memory
jmp 0x40108f
xor ebx, ebx
xor esi, esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x2c], esi
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp - 0x34]
push 0x3e8
push 0x3c
push edi
push 0
push 0x20
lea eax, [ebp - 0x24]
push eax
push ecx
push edx
call dword [sym.imp.IPHLPAPI.DLL_IcmpSendEcho]
test eax, eax
je 0x401197
mov eax, dword [edi + 8]
mov ecx, dword [edi + 4]
push eax
push ecx
mov ecx, dword [0x4a3180]
push esi
push str.Ping_message__d_with_status:__d_and_RoundTripTime:__d
mov edx, str.bw_check
mov esi, 3
call fcn.00425020
mov esi, dword [ebp - 0x2c]
add esp, 0x10
add ebx, dword [edi + 8]
jmp 0x4011a7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2b02
jne 0x4011f2
inc dword [ebp - 0x28]
inc esi
mov dword [ebp - 0x2c], esi
cmp esi, 5
jl 0x401147
push edi
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [ebp - 0x28]
add esp, 4
mov esi, 3
cmp eax, 5
jne 0x40122b
mov ecx, dword [0x4a3180]
push str.0_pings_succeed__this_means_a_really_bad_network_or_serves_is_not_answering_to_echo__assuming_the_last_one_
mov edx, str.bw_check
call fcn.00425020
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043e590
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x4a3180]
push eax
push str.IcmpSendEcho_failed_internal_error__Error_code:__ld
mov edx, str.bw_check
mov esi, 1
call fcn.00425020
push edi
call dword [sym.imp.MSVCR100.dll_free]
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043e590
mov esp, ebp
pop ebp
ret
mov ecx, 5
sub ecx, eax
xor edx, edx
mov eax, ebx
div ecx
mov ecx, dword [0x4a3180]
mov edx, str.bw_check
push eax
push str.Average_ping:__d
call fcn.00425020
mov ecx, dword [ebp - 0x28]
imul ecx, ecx, 0x3e8
add ecx, ebx
mov eax, 0xcccccccd
mul ecx
mov ecx, dword [ebp - 4]
add esp, 8
pop edi
mov eax, edx
pop esi
xor ecx, ebp
shr eax, 2
pop ebx
call fcn.0043e590
mov esp, ebp
pop ebp
ret