Function at 0x4012d0
Capabilities:
Create tcp socket
Create udp socket
Receive data
Receive data on socket
Reference google public dns server
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10314
call fcn.00411b50
mov eax, dword [0x41d008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x100
lea eax, [ebp - 0x108]
mov dword [ebp - 0x10314], 0x78
push 0
push eax
mov esi, ecx
mov dword [ebp - 0x10310], 0
mov dword [ebp - 0x1030c], 4
mov dword [ebp - 0x10308], 0
call fcn.00407e30
mov ecx, esi
add esp, 0xc
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401330
sub ecx, edx
lea eax, [ebp - 0x108]
push ecx
push esi
push eax
call fcn.00404ba0
push 0x1000
push 0
push dword [0x421894]
call fcn.00407e30
add esp, 0x18
push 0x11
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
mov edi, eax
push 8
lea eax, [ebp - 0x10314]
push eax
push 0x1006
push 0xffff
push edi
call esi
push 8
lea eax, [ebp - 0x1030c]
push eax
push 0x1005
push 0xffff
push edi
call esi
mov ebx, dword [sym.imp.WS2_32.dll_htons]
mov eax, 2
push 0x35
mov word [ebp - 0x102f8], ax
call ebx
push str.8.8.8.8
mov word [ebp - 0x102f6], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 1
mov dword [ebp - 0x102f4], eax
mov dword [ebp - 0x10108], 0x104d2
call ebx
mov word [ebp - 0x10104], ax
lea edx, [ebp - 0x108]
xor eax, eax
lea ecx, [ebp - 0x100fc]
mov dword [ebp - 0x10102], eax
mov word [ebp - 0x100fe], ax
call fcn.00401af0
lea esi, [ebp - 0x100fc]
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x401408
push 1
sub esi, ecx
call ebx
push 1
mov word [ebp + esi - 0x100fb], ax
call ebx
lea ecx, [ebp - 0x100fc]
mov word [ebp + esi - 0x100f9], ax
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401432
push 0x10
sub ecx, edx
lea eax, [ebp - 0x102f8]
push eax
push 0
lea eax, [ecx + 0x11]
push eax
lea eax, [ebp - 0x10108]
push eax
push edi
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
js 0x4019f7
lea eax, [ebp - 0x102fc]
mov dword [ebp - 0x102fc], 0x10
push eax
lea eax, [ebp - 0x102f8]
push eax
push 0
push 0x10000
lea eax, [ebp - 0x10108]
push eax
push edi
call dword [sym.imp.WS2_32.dll_recvfrom]
test eax, eax
js 0x4019f7
lea ecx, [ebp - 0x100fc]
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4014a0
push dword [ebp - 0x10102]
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
lea esi, [ebp - 0x100f7]
sub ecx, edx
mov dword [ebp - 0x10300], 0
add esi, ecx
mov dword [ebp - 0x102fc], 0
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jge 0x401644
lea eax, [ebp - 0x10300]
lea edi, [ecx + ecx*2]
mov ecx, esi
push eax
lea edx, [ebp - 0x10108]
call fcn.00401a10
add esi, dword [ebp - 0x10300]
add esp, 4
mov dword [ebp + edi*4 - 0x101f8], eax
mov dword [ebp + edi*4 - 0x101f4], esi
add esi, 0xa
mov eax, dword [ebp + edi*4 - 0x101f4]
movzx eax, word [eax]
push eax
call ebx
cmp ax, 1
jne 0x4015f7
mov eax, dword [ebp - 0x102fc]
lea edi, [eax + eax*2]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f4]
movzx eax, word [eax + 8]
push eax
call ebx
movzx eax, ax
push eax
call fcn.00403b7c
mov dword [ebp + edi*4 - 0x101f0], eax
add esp, 4
mov eax, dword [ebp + edi*4 - 0x101f4]
movzx eax, word [eax + 8]
push eax
call ebx
xor ecx, ecx
cmp cx, ax
jae 0x4015a5
mov edi, ecx
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov ecx, dword [ebp + eax*4 - 0x101f0]
mov al, byte [edi + esi]
mov byte [edi + ecx], al
inc edi
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f4]
movzx eax, word [eax + 8]
push eax
call ebx
movzx eax, ax
cmp edi, eax
jl 0x401570
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f4]
movzx eax, word [eax + 8]
push eax
call ebx
movzx ecx, ax
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f0]
mov byte [ecx + eax], 0
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f4]
movzx eax, word [eax + 8]
push eax
call ebx
mov edx, dword [ebp - 0x102fc]
movzx eax, ax
add esi, eax
jmp 0x401624
lea eax, [ebp - 0x10300]
mov ecx, esi
push eax
lea edx, [ebp - 0x10108]
call fcn.00401a10
mov edx, dword [ebp - 0x102fc]
add esp, 4
add esi, dword [ebp - 0x10300]
lea ecx, [edx + edx*2]
mov dword [ebp + ecx*4 - 0x101f0], eax
push dword [ebp - 0x10102]
inc edx
mov dword [ebp - 0x102fc], edx
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jl 0x4014e4
push dword [ebp - 0x10100]
mov dword [ebp - 0x102fc], 0
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jge 0x4016e7
jmp 0x401670
lea eax, [ebp - 0x10300]
lea edi, [ecx + ecx*2]
mov ecx, esi
push eax
lea edx, [ebp - 0x10108]
call fcn.00401a10
add esi, dword [ebp - 0x10300]
lea edx, [ebp - 0x10108]
mov dword [ebp + edi*4 - 0xf8], eax
lea eax, [ebp - 0x10300]
mov dword [ebp + edi*4 - 0xf4], esi
add esi, 0xa
push eax
mov ecx, esi
call fcn.00401a10
mov edx, dword [ebp - 0x102fc]
add esp, 8
add esi, dword [ebp - 0x10300]
push dword [ebp - 0x10100]
lea ecx, [edx + edx*2]
inc edx
mov dword [ebp + ecx*4 - 0xf0], eax
mov dword [ebp - 0x102fc], edx
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jl 0x401670
push dword [ebp - 0x100fe]
mov dword [ebp - 0x102fc], 0
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jge 0x401874
lea ebx, [ebx]
lea eax, [ebp - 0x10300]
lea edi, [ecx + ecx*2]
mov ecx, esi
push eax
lea edx, [ebp - 0x10108]
call fcn.00401a10
add esi, dword [ebp - 0x10300]
add esp, 4
mov dword [ebp + edi*4 - 0x102e8], eax
mov dword [ebp + edi*4 - 0x102e4], esi
add esi, 0xa
mov eax, dword [ebp + edi*4 - 0x102e4]
movzx eax, word [eax]
push eax
call ebx
cmp ax, 1
jne 0x401827
mov eax, dword [ebp - 0x102fc]
lea edi, [eax + eax*2]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x102e4]
movzx eax, word [eax + 8]
push eax
call ebx
movzx eax, ax
push eax
call fcn.00403b7c
mov dword [ebp + edi*4 - 0x102e0], eax
add esp, 4
mov eax, dword [ebp + edi*4 - 0x102e4]
movzx eax, word [eax + 8]
push eax
call ebx
xor ecx, ecx
cmp cx, ax
jae 0x4017d5
mov edi, ecx
lea esp, [esp]
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov ecx, dword [ebp + eax*4 - 0x102e0]
mov al, byte [edi + esi]
mov byte [edi + ecx], al
inc edi
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x102e4]
movzx eax, word [eax + 8]
push eax
call ebx
movzx eax, ax
cmp edi, eax
jl 0x4017a0
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x102e4]
movzx eax, word [eax + 8]
push eax
call ebx
movzx ecx, ax
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x102e0]
mov byte [ecx + eax], 0
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x102e4]
movzx eax, word [eax + 8]
push eax
call ebx
mov edx, dword [ebp - 0x102fc]
movzx eax, ax
add esi, eax
jmp 0x401854
lea eax, [ebp - 0x10300]
mov ecx, esi
push eax
lea edx, [ebp - 0x10108]
call fcn.00401a10
mov edx, dword [ebp - 0x102fc]
add esp, 4
add esi, dword [ebp - 0x10300]
lea ecx, [edx + edx*2]
mov dword [ebp + ecx*4 - 0x102e0], eax
push dword [ebp - 0x100fe]
inc edx
mov dword [ebp - 0x102fc], edx
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jl 0x401710
push dword [ebp - 0x10102]
mov dword [ebp - 0x102fc], 0
call ebx
mov ecx, dword [ebp - 0x102fc]
mov esi, dword [sym.imp.WS2_32.dll_inet_ntoa]
movzx eax, ax
cmp ecx, eax
jge 0x40191d
lea ecx, [ecx]
lea eax, [ecx + ecx*2]
mov eax, dword [ebp + eax*4 - 0x101f4]
movzx eax, word [eax]
push eax
call ebx
cmp ax, 1
jne 0x4018ec
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f0]
mov edi, dword [eax]
push edi
call esi
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4018d0
sub eax, edx
push eax
push edi
call esi
push eax
push dword [0x421894]
call fcn.00404ba0
add esp, 0xc
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x101f4]
movzx eax, word [eax]
push eax
call ebx
push dword [ebp - 0x10102]
inc dword [ebp - 0x102fc]
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jl 0x4018a0
push dword [ebp - 0x10100]
mov dword [ebp - 0x102fc], 0
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jge 0x40196b
lea esp, [esp]
lea eax, [ecx + ecx*2]
mov eax, dword [ebp + eax*4 - 0xf4]
movzx eax, word [eax]
push eax
call ebx
push dword [ebp - 0x10100]
inc dword [ebp - 0x102fc]
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jl 0x401940
push dword [ebp - 0x100fe]
mov dword [ebp - 0x102fc], 0
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jge 0x4019f7
mov edi, edi
lea eax, [ecx + ecx*2]
mov eax, dword [ebp + eax*4 - 0x102e4]
movzx eax, word [eax]
push eax
call ebx
cmp ax, 1
jne 0x4019dc
mov eax, dword [ebp - 0x102fc]
lea eax, [eax + eax*2]
mov eax, dword [ebp + eax*4 - 0x102e0]
mov edi, dword [eax]
push edi
call esi
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4019c0
sub eax, edx
push eax
push edi
call esi
push eax
push dword [0x421894]
call fcn.00404ba0
add esp, 0xc
push dword [ebp - 0x100fe]
inc dword [ebp - 0x102fc]
call ebx
mov ecx, dword [ebp - 0x102fc]
movzx eax, ax
cmp ecx, eax
jl 0x401990
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040346d
mov esp, ebp
pop ebp
ret