Function at 0x51b510
Capabilities:
Get local ipv4 addresses
Get socket information
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0xb8
push ebx
push ebp
push esi
push edi
xor edi, edi
mov esi, ecx
mov dword [esp + 0x1c], edi
mov eax, dword [esi + 4]
mov ebx, 1
xor ebp, ebp
cmp eax, edi
mov dword [esp + 0x34], edx
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x38], ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], edi
je 0x51b5f8
cmp byte [eax], 0x2d
jne 0x51b5f8
push 0x74
push eax
call fcn.00570260
add esp, 8
test eax, eax
je 0x51b570
mov dword [esp + 0x38], edi
mov eax, dword [esi + 4]
push 0x6e
push eax
call fcn.00570260
add esp, 8
test eax, eax
mov ebx, 1
je 0x51b58b
mov dword [esp + 0x30], ebx
mov ecx, dword [esi + 4]
push 0x62
push ecx
call fcn.00570260
add esp, 8
test eax, eax
je 0x51b5a1
mov dword [esp + 0x18], ebx
mov edx, dword [esi + 4]
push 0x6b
push edx
call fcn.00570260
add esp, 8
test eax, eax
je 0x51b5b7
mov dword [esp + 0x20], ebx
mov eax, dword [esi + 4]
push 0x64
push eax
call fcn.00570260
add esp, 8
test eax, eax
je 0x51b5cb
mov ebp, ebx
cmp ebp, edi
mov ebx, 2
je 0x51b5f8
mov eax, dword [esi + 8]
cmp eax, edi
je 0x51b675
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
je 0x51b69f
mov dword [esp + 0x14], ebx
mov ebx, 3
mov eax, dword [esi + ebx*4]
cmp eax, edi
je 0x51b675
mov dword [esp + 0x28], ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x51b606
sub eax, edx
cmp eax, 0x5a
jbe 0x51b629
xor edx, edx
mov ecx, 0x1452
call fcn.0041d620
mov ecx, dword [esi + ebx*4]
push eax
jmp 0x51bb6e
mov ecx, dword [esi + ebx*4 + 4]
inc ebx
mov dword [esp + 0x10], ebx
call fcn.004f4570
test eax, eax
je 0x51b655
mov edx, dword [esi + ebx*4]
push edx
call fcn.00570543
add esp, 4
cmp ax, di
mov dword [esp + 0x24], eax
jbe 0x51b69f
inc ebx
mov dword [esp + 0x10], ebx
mov eax, dword [esi + ebx*4]
cmp eax, edi
je 0x51b6bd
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x51b69f
mov eax, dword [esi + ebx*4 + 4]
inc ebx
cmp eax, edi
jne 0x51b68d
mov edx, dword [esi]
push edi
push edi
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
push eax
call fcn.00570543
add esp, 4
cmp ax, di
mov dword [esp + 0x2c], eax
ja 0x51b6b8
mov edx, dword [esi]
push 3
push edi
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
inc ebx
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x28]
mov ecx, dword [esi + ebx*4]
call fcn.0051b1e0
mov ebp, eax
cmp ebp, edi
je 0x51b728
cmp dword [ebp + 0x158], edi
jne 0x51b6ed
xor edx, edx
mov ecx, 0x1453
call fcn.0041d620
push eax
mov eax, dword [esi + ebx*4]
push eax
jmp 0x51bb6f
mov ecx, dword [esp + 0x24]
cmp cx, di
je 0x51b9fd
mov ax, word [ebp + 0xc8]
cmp ax, cx
je 0x51b9fd
mov edx, dword [esp + 0x28]
movzx ecx, ax
mov eax, dword [esi + edx*4]
push ecx
push eax
xor edx, edx
mov ecx, 0x1451
call fcn.0041d620
push eax
jmp 0x51bb74
call fcn.0051afa0
mov ebp, eax
cmp ebp, edi
jne 0x51b74c
mov edx, dword [esi]
push 2
push edi
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
mov ecx, dword [esi + ebx*4]
mov edx, ebp
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x51b751
mov eax, dword [esp + 0xd0]
add eax, 0x15d4
lea edx, [ebp + 0x64]
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x51b770
mov cx, word [esp + 0x24]
lea ebx, [ebp + 0xc8]
push edi
mov word [ebx], cx
mov dword [ebp + 0x14c], 2
call fcn.00570bc6
mov edx, dword [esp + 0x24]
mov cx, word [esp + 0x30]
mov dword [ebp + 0x178], eax
mov dword [ebp + 0x17c], eax
mov dword [ebp + 0x180], eax
mov dword [ebp + 0x158], 1
mov dword [ebp + 0x15c], edx
mov eax, dword [esp + 0x20]
mov dword [ebp + 0x160], eax
mov eax, dword [esp + 0x18]
add esp, 4
cmp eax, edi
mov word [ebp + 0x164], cx
mov dword [ebp + 0x168], edi
mov word [ebp + 0x16c], di
je 0x51b802
mov edx, eax
mov eax, dword [esi + edx*4]
push eax
lea ecx, [ebp + 0xca]
mov edx, 0x64
call fcn.0041ee40
cmp word [esp + 0x24], di
mov ecx, dword [esp + 0xd0]
mov dword [ebp + 0x194], ecx
jne 0x51b8e2
push 0x5ae5a0
mov edx, 0x64
lea ecx, [esp + 0x68]
call fcn.0041ee40
mov al, byte [ebp + 0xca]
test al, al
mov edx, dword [0x5ae598]
lea edi, [ebp + 0xca]
mov dword [esp + 0x14], edx
je 0x51b861
push edi
mov edx, 0x64
mov ecx, 0x5ae5a0
call fcn.0041ee40
mov dword [0x5ae598], 2
mov dx, word [0x59bcfc]
mov cx, word [0x59bcf8]
push 0
push 0
push 1
push ebx
call fcn.005049f0
mov dword [ebp + 0x190], eax
lea eax, [esp + 0x64]
push eax
mov edx, 0x64
mov ecx, 0x5ae5a0
call fcn.0041ee40
mov ecx, dword [esp + 0x14]
mov dword [0x5ae598], ecx
cmp dword [ebp + 0x190], 0xffffffff
jne 0x51b990
mov ecx, ebp
call fcn.0051b0e0
mov ecx, 0x1454
xor edx, edx
call fcn.0041d620
push eax
push str.__sockudp:__s
push 0x5a7240
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xb8
ret 8
push edi
push 2
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [ebp + 0x190], eax
jne 0x51b906
mov ecx, ebp
call fcn.0051b0e0
mov ecx, 0x1455
jmp 0x51b8b8
push 0x5ae5a0
mov edx, 0x64
lea ecx, [esp + 0x68]
call fcn.0041ee40
mov al, byte [ebp + 0xca]
test al, al
mov edx, dword [0x5ae598]
lea edi, [ebp + 0xca]
mov dword [esp + 0x14], edx
je 0x51b94d
push edi
mov edx, 0x64
mov ecx, 0x5ae5a0
call fcn.0041ee40
mov dword [0x5ae598], 2
mov dx, word [ebx]
mov ecx, dword [ebp + 0x190]
call fcn.00504920
mov ebx, eax
lea eax, [esp + 0x64]
push eax
mov edx, 0x64
mov ecx, 0x5ae5a0
call fcn.0041ee40
test ebx, ebx
mov ecx, dword [esp + 0x14]
mov dword [0x5ae598], ecx
jne 0x51b990
mov ecx, ebp
call fcn.0051b0e0
mov ecx, 0x1456
jmp 0x51b8b8
mov edx, dword [0x5b4314]
mov eax, dword [ebp + 0x190]
push 0x23
push 0x8038
push edx
push eax
call dword [sym.imp.WSOCK32.dll_WSAAsyncSelect]
mov eax, dword [ebp + 0x190]
cmp eax, 0xffffffff
je 0x51b9fd
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x58]
push edx
push eax
mov dword [esp + 0x2c], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jne 0x51b9fd
mov eax, dword [esp + 0x58]
push eax
call dword [sym.imp.WSOCK32.dll_inet_ntoa]
push eax
mov edx, 0x64
mov ecx, edi
call fcn.0041ee40
mov ecx, dword [esp + 0x56]
push ecx
call dword [sym.imp.WSOCK32.dll_ntohs]
mov word [ebp + 0x12e], ax
mov eax, dword [esp + 0x18]
test eax, eax
mov ebx, dword [esp + 0x10]
je 0x51ba2a
mov eax, dword [esi + ebx*4]
test eax, eax
je 0x51ba2a
push eax
call fcn.005705cb
add esp, 4
test eax, eax
mov dword [esp + 0x18], eax
jg 0x51ba29
mov dword [esp + 0x18], 0
inc ebx
mov ecx, dword [esi + ebx*4]
test ecx, ecx
jne 0x51ba73
mov eax, dword [esp + 0x30]
test eax, eax
jne 0x51ba46
mov eax, dword [ebp + 0x15c]
test eax, eax
jmp 0x51bdc3
mov ebx, dword [esp + 0x34]
mov ax, word [0x583b70]
mov edx, ebx
mov word [edx], ax
mov cl, byte [0x583b72]
mov byte [edx + 2], cl
mov dword [esp + 0x10], ebx
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x51ba65
sub ebx, ecx
jmp 0x51bb2b
mov eax, dword [esp + 0x38]
test eax, eax
je 0x51bac7
cmp byte [ecx], 0x26
jne 0x51bac7
mov edx, dword [esp + 0xcc]
call fcn.0041bb90
test eax, eax
jne 0x51bab7
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x51baa1
mov ecx, ebp
call fcn.0051b0e0
xor edx, edx
mov ecx, 0x1457
call fcn.0041d620
mov edx, dword [esi + ebx*4]
push eax
push edx
jmp 0x51bb6f
mov ecx, dword [eax + 0xc]
mov edx, dword [eax]
mov ebx, dword [eax + 8]
add ecx, edx
mov dword [esp + 0x10], ecx
jmp 0x51bb1d
mov edi, dword [esp + 0x34]
push esi
mov edx, edi
mov ecx, ebx
mov byte [edi], 0
call fcn.004f4660
mov eax, edi
mov dword [esp + 0x10], edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x51bae1
sub eax, edx
mov ebx, eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x51bb1d
mov edi, dword [esp + 0x34]
cmp byte [ebx + edi - 1], 0xa
je 0x51bb1d
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x51bb00
mov ax, word [0x583b70]
mov word [edi], ax
mov cl, byte [0x583b72]
mov byte [edi + 2], cl
add ebx, 2
mov eax, dword [esp + 0x18]
test eax, eax
je 0x51bb2b
cmp eax, ebx
jge 0x51bb2b
mov ebx, eax
mov ecx, dword [ebp + 0x140]
test ecx, ecx
je 0x51bbf7
mov edx, dword [ebp + 0x144]
lea eax, [edx + ebx]
cmp eax, 0x4000
jle 0x51bb91
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x51bb5a
mov ecx, ebp
call fcn.0051b0e0
xor edx, edx
mov ecx, 0x1458
call fcn.0041d620
push eax
mov eax, dword [esp + 0x2c]
mov ecx, dword [esi + eax*4]
push ecx
push str.__sockudp:__s__s
push 0x5a7240
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xb8
ret 8
add eax, 0xa
push eax
push ecx
call fcn.00571c26
add esp, 8
test eax, eax
jne 0x51bbcd
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x51bbb3
mov ecx, ebp
call fcn.0051b0e0
mov edx, dword [esi]
push 2
push 0
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
mov edi, dword [ebp + 0x144]
mov esi, dword [esp + 0x10]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
add edi, eax
mov dword [ebp + 0x140], eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [ebp + 0x144], ebx
jmp 0x51bc54
lea eax, [ebx + 0xa]
push eax
call fcn.00570098
add esp, 4
test eax, eax
mov dword [ebp + 0x140], eax
jne 0x51bc38
mov eax, dword [ebp + 0x15c]
test eax, eax
jne 0x51bc1e
mov ecx, ebp
call fcn.0051b0e0
mov edx, dword [esi]
push 2
push 0
xor ecx, ecx
call fcn.00479790
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 8
mov esi, dword [esp + 0x10]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0x144], ebx
mov edx, dword [esp + 0x1c]
xor ecx, ecx
mov dword [esp + 0x3c], ecx
lea eax, [esp + 0x1c]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x44], ecx
xor edi, edi
push eax
mov dword [esp + 0x54], edi
mov dword [esp + 0x4c], ecx
mov word [esp + 0x40], 2
mov dword [esp + 0x44], edx
call dword [sym.imp.WSOCK32.dll_htons]
mov ecx, dword [esp + 0x4c]
mov word [esp + 0x3e], ax
mov edx, dword [ecx]
mov dword [esp + 0x40], edx
mov eax, dword [ebp + 0x144]
cmp eax, 0x2000
jle 0x51bcaf
mov eax, 0x2000
mov edx, dword [ebp + 0x140]
push 0x10
lea ecx, [esp + 0x40]
push ecx
push edi
push eax
mov eax, dword [ebp + 0x190]
push edx
push eax
call dword [sym.imp.WSOCK32.dll_sendto]
mov esi, eax
cmp esi, 0xffffffff
jne 0x51bd1e
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x51bdcc
mov edx, dword [ebp + 0x190]
movzx ecx, ax
shl ecx, 0x10
or ecx, 2
push ecx
push edx
mov dword [ebp + 0x184], eax
mov eax, dword [0x5b4314]
push 0x8038
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 8
push edi
call fcn.00570bc6
add esp, 4
cmp esi, edi
mov dword [ebp + 0x17c], eax
jle 0x51bd77
mov edx, dword [ebp + 0x170]
mov eax, dword [ebp + 0x144]
add edx, esi
cmp esi, eax
mov dword [ebp + 0x170], edx
jge 0x51bd77
sub eax, esi
mov dword [ebp + 0x144], eax
mov ebp, dword [ebp + 0x140]
push eax
lea ecx, [esi + ebp]
push ecx
push ebp
call fcn.00571040
add esp, 0xc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 8
mov edx, dword [ebp + 0x140]
push edx
call fcn.005700aa
mov dword [ebp + 0x140], edi
mov dword [ebp + 0x144], edi
mov eax, dword [0x5ae60c]
add esp, 4
cmp eax, edi
je 0x51bdbd
cmp dword [ebp + 0x15c], edi
je 0x51bdc5
mov eax, dword [ebp + 0x148]
mov ecx, dword [0x5b4314]
push ebp
push eax
push 0x803a
push ecx
call dword [sym.imp.USER32.dll_PostMessageA]
cmp dword [ebp + 0x15c], edi
jne 0x51bdcc
mov ecx, ebp
call fcn.0051b0e0
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 8