Function at 0x41f040
Capabilities:
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information
Get socket status

Disassembly:
mov eax, 0x3548
call fcn.00457d20
push ebx
mov ebx, dword [esp + 0x3554]
push ebp
mov ebp, dword [esp + 0x3554]
mov al, byte [ebx + 1]
push esi
push edi
mov edi, dword [ebp + 4]
mov esi, ecx
cmp al, 1
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], edi
jne 0x41f4ba
push 1
push 0
push 0
push 0
push 1
push 2
mov byte [ebx], 0
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov ecx, dword [esi + 4]
push eax
push ebp
add ecx, 0x27600
call fcn.00442570
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x41f0bf
push 8
push ebx
push edi
mov ecx, esi
mov byte [ebx + 1], 0x5b
call fcn.0041c1d0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov ax, word [ebx + 2]
mov cl, byte [0x493b50]
mov word [esp + 0x22], ax
mov byte [esp + 0x14c], cl
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x14d]
mov edx, dword [ebx + 4]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push edx
stosb byte es:[edi], al
call dword [sym.imp.WS2_32.dll_inet_ntoa]
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 6
mov eax, ecx
mov esi, edi
mov edi, edx
push str.0.0.0.
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x154]
push ecx
call fcn.00459d50
add esp, 0xc
test eax, eax
jne 0x41f1f6
lea edx, [ebx + 8]
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
mov eax, dword [ebp + 0x1c]
dec ecx
add edx, ecx
mov esi, edx
mov dword [esp + 0x18], edx
sub esi, ebx
inc esi
cmp eax, 2
jne 0x41f87e
lea edi, [esi + ebx]
jmp 0x41f168
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 8]
test eax, eax
je 0x41f1c5
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1c]
push 8
push edx
push edi
push ebp
push eax
mov dword [esp + 0x30], 1
call fcn.0041c300
test eax, eax
je 0x41f87e
cmp byte [edi], 0
je 0x41f1c1
inc esi
inc edi
mov dword [esp + 0x1c], edi
lea edi, [ebx + 8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xfe
cmp esi, ecx
jg 0x41f87e
cmp dword [ebp + 0x1c], 2
je 0x41f160
mov edx, dword [esp + 0x18]
cmp dword [ebp + 0x1c], 2
jne 0x41f87e
lea edi, [edx + 1]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov cl, byte [0x493b50]
xor eax, eax
mov byte [esp + 0x1550], cl
mov ecx, 0x400
lea edi, [esp + 0x1551]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x24]
mov ecx, dword [ebp + 0x10]
cmp eax, 0xffffffff
je 0x41f253
mov esi, dword [esp + 0x10]
lea eax, [eax + eax*2]
shl eax, 6
mov edx, dword [esi + 4]
mov edx, dword [edx + 0x275c8]
add eax, edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea ecx, [esp + 0x1558]
push str._s__s_SOCKS4
push ecx
call fcn.00457c43
add esp, 0x10
jmp 0x41f274
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea edx, [esp + 0x1554]
push str._s_unknown_SOCKS4
push edx
call fcn.00457c43
mov esi, dword [esp + 0x1c]
add esp, 0xc
mov al, byte [0x493b50]
mov ecx, 0x400
mov byte [esp + 0x54c], al
xor eax, eax
lea edi, [esp + 0x54d]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x22]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
and eax, 0xffff
lea edx, [esp + 0x14c]
push eax
push edx
lea eax, [esp + 0x554]
push str.CONNECT__s:_d
push eax
call fcn.00457c43
mov ecx, dword [esi + 4]
add esp, 0x10
mov eax, dword [ecx + 0xa558]
test eax, eax
je 0x41f302
lea edi, [esp + 0x54c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1550]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x1550]
push eax
call fcn.00430470
mov edi, str.CONNECT
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
mov eax, dword [ebp + 0x24]
not ecx
dec ecx
cmp eax, 0xffffffff
lea edi, [esp + ecx + 0x54c]
je 0x41f414
mov edx, dword [esi + 4]
lea ecx, [eax + eax*2]
shl ecx, 6
mov eax, dword [edx + 0x275c8]
mov eax, dword [ecx + eax + 0x74]
cmp eax, 0xffffffff
je 0x41f414
mov ecx, eax
shl ecx, 8
add ecx, eax
lea ecx, [eax + ecx*2]
lea ecx, [ecx + ecx*2]
lea eax, [eax + ecx*2]
mov ecx, dword [edx + 0x275e8]
lea eax, [ecx + eax*4]
mov ecx, dword [eax + 0x303c]
test ecx, ecx
je 0x41f414
cmp dword [eax + 0x3048], 1
jne 0x41f414
mov ecx, dword [eax + 0x1034]
test ecx, ecx
je 0x41f392
mov eax, ecx
jmp 0x41f395
add eax, 0x31
push eax
push edi
mov ecx, esi
call fcn.00426140
test eax, eax
je 0x41f414
mov eax, dword [esi + 4]
mov edx, dword [eax + 0x1cb0]
test edx, edx
jne 0x41f3ed
lea edx, [esp + 0x14c]
add eax, 0x18b0
push edx
push eax
push ebx
call fcn.00457c43
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x14]
not ecx
dec ecx
push ecx
push ebx
push eax
mov ecx, esi
call fcn.0041c1d0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
mov ecx, dword [esp + 0x18]
push edx
push ecx
mov ecx, esi
call fcn.0041c1d0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov edx, dword [esp + 0x22]
push 1
push edx
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, dword [ebp + 8]
and eax, 0xffff
push eax
lea eax, [esp + 0x154]
push eax
push ebp
push ecx
mov ecx, esi
call fcn.00425b50
test eax, eax
jne 0x41f45f
mov edx, dword [esp + 0x14]
push 0xa
push ebx
push edx
mov ecx, esi
mov byte [ebx + 1], 0x5c
call fcn.0041c1d0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov edx, dword [ebp + 8]
lea eax, [esp + 0x30]
lea ecx, [esp + 0x38]
push eax
push ecx
push edx
mov dword [esp + 0x3c], 0x10
call dword [sym.imp.WS2_32.dll_getsockname]
mov eax, dword [esp + 0x3c]
mov cx, word [esp + 0x3a]
mov edi, dword [esp + 0x14]
mov dword [ebx + 2], eax
push 8
mov word [ebx + 4], cx
push ebx
push edi
mov ecx, esi
mov byte [ebx + 1], 0x5a
call fcn.0041c1d0
mov edx, dword [ebp + 8]
push 0
push edi
push edx
push ebp
mov ecx, esi
call fcn.00423a00
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
cmp al, 2
jne 0x41f87e
mov al, byte [0x493b50]
mov ecx, 0x400
mov byte [esp + 0x1550], al
xor eax, eax
lea edi, [esp + 0x1551]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x24]
mov ecx, dword [ebp + 0x10]
cmp eax, 0xffffffff
je 0x41f51a
mov edx, dword [esi + 4]
lea eax, [eax + eax*2]
shl eax, 6
mov edx, dword [edx + 0x275c8]
add eax, edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea ecx, [esp + 0x1558]
push str._s__s_SOCKS4
push ecx
call fcn.00457c43
add esp, 0x10
jmp 0x41f537
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea edx, [esp + 0x1554]
push str._s_unknown_SOCKS4
push edx
call fcn.00457c43
add esp, 0xc
mov eax, dword [esi + 4]
mov ecx, dword [eax + 0xa558]
test ecx, ecx
je 0x41f61c
mov dl, byte [0x493b50]
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x2555]
mov byte [esp + 0x2554], dl
mov byte [esp + 0x54c], dl
rep stosd dword es:[edi], eax
mov ecx, 0x400
lea edi, [esp + 0x54d]
rep stosd dword es:[edi], eax
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
test eax, eax
je 0x41f5ae
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x54c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov cx, word [ebx + 2]
mov word [esp + 0x3a], cx
mov edx, dword [esp + 0x3a]
push edx
call dword [sym.imp.WS2_32.dll_ntohs]
and eax, 0xffff
lea ecx, [esp + 0x2554]
push eax
lea eax, [esp + 0x550]
push eax
push str.BIND__s:_d
push ecx
call fcn.00457c43
lea edi, [esp + 0x2564]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x1550]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x1550]
push eax
call fcn.00430470
add esp, 4
xor edi, edi
mov byte [ebx], 0
push 1
push edi
push edi
push edi
push 1
push 2
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov ecx, dword [esi + 4]
push eax
push ebp
add ecx, 0x27600
call fcn.00442570
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x41f67a
mov ecx, dword [esp + 0x14]
push 0xa
push ebx
push ecx
mov ecx, esi
mov byte [ebx + 1], 0x5b
call fcn.0041c1d0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov eax, dword [ebp + 8]
lea edx, [esp + 0x20]
push 0x10
push edx
push eax
mov word [esp + 0x2e], di
mov word [esp + 0x2c], 2
mov dword [esp + 0x30], edi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jne 0x41f87e
mov ecx, dword [ebp + 8]
push 5
push ecx
call dword [sym.imp.WS2_32.dll_listen]
mov ecx, dword [ebp + 8]
lea edx, [esp + 0x18]
lea eax, [esp + 0x20]
push edx
push eax
push ecx
mov dword [esp + 0x24], 0x10
call dword [sym.imp.WS2_32.dll_getsockname]
mov edx, dword [esi + 4]
mov cx, word [esp + 0x22]
mov edi, dword [esp + 0x14]
push 8
mov eax, dword [edx + 0xa98c]
mov word [ebx + 2], cx
push ebx
push edi
mov ecx, esi
mov dword [esp + 0x30], eax
mov byte [ebx + 1], 0x5a
mov dword [ebx + 4], eax
call fcn.0041c1d0
test eax, eax
je 0x41f87e
xor eax, eax
mov dword [esp + 0x30], 1
mov dword [esp + 0x34], eax
mov dword [esp + 0x10], eax
cmp dword [ebp + 0x1c], 2
jne 0x41f87e
mov eax, dword [esi + 8]
test eax, eax
je 0x41f87e
mov edx, dword [ebp + 8]
mov dword [esp + 0x48], 1
mov dword [esp + 0x4c], edx
xor eax, eax
lea ecx, [esp + 0x4c]
cmp dword [ecx], edi
je 0x41f748
inc eax
add ecx, 4
cmp eax, 1
jb 0x41f73b
cmp eax, 1
jne 0x41f759
mov dword [esp + 0x50], edi
mov dword [esp + 0x48], 2
lea eax, [esp + 0x30]
lea ecx, [esp + 0x48]
push eax
push 0
push 0
push ecx
push 0x40
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jne 0x41f794
mov edx, dword [esi + 4]
mov eax, dword [edx + 0xa9b8]
cmp eax, 0xffffffff
je 0x41f7cc
mov ecx, dword [esp + 0x10]
inc ecx
cmp ecx, eax
mov dword [esp + 0x10], ecx
jg 0x41f87e
jmp 0x41f7cc
test eax, eax
mov dword [esp + 0x10], 0
jl 0x41f87e
mov ecx, dword [ebp + 8]
lea eax, [esp + 0x48]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x41f7e3
mov eax, dword [ebp + 4]
lea edx, [esp + 0x48]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x41f862
cmp dword [ebp + 0x1c], 2
je 0x41f71b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov edx, dword [ebp + 8]
lea ecx, [esp + 0x38]
push ecx
push edx
mov ecx, esi
mov dword [esp + 0x20], 0x10
call fcn.0041c850
mov edi, eax
test edi, edi
je 0x41f87e
mov ax, word [esp + 0x3a]
mov ecx, dword [esp + 0x3c]
mov byte [ebx], 0
mov byte [ebx + 1], 0x5a
mov word [ebx + 2], ax
mov dword [ebx + 4], ecx
mov edx, dword [ebp + 4]
push 8
push ebx
push edx
mov ecx, esi
call fcn.0041c1d0
test eax, eax
jne 0x41f83e
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov eax, dword [esp + 0x14]
push 0
push eax
push edi
push ebp
mov ecx, esi
call fcn.00423a00
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x18]
push 0
push ecx
push ebx
push ebp
push edx
mov ecx, esi
mov dword [esp + 0x2c], 0x1000
call fcn.0041c300
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3548
ret 8