Function at 0x4992c0
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, 0x10
push ebx
mov dword [ebp - 4], eax
mov dword [ebp - 8], eax
lea eax, [ebp - 0x1c]
push esi
push edi
mov dword [ebp - 0xc], eax
mov esi, dword [ebp + 8]
mov edi, dword [ebp - 0xc]
mov eax, dword [esi]
mov ebx, dword [esi + 4]
test eax, 0xfffe
jne 0x499331
cmp al, 1
je 0x49930a
mov al, 6
mov dword [edi + 4], ebx
xor ebx, ebx
mov ecx, dword [esi + 8]
mov bh, byte [esi + 0xc]
mov dword [edi], eax
mov bl, byte [esi + 0xd]
mov dword [edi + 8], ecx
mov dword [edi + 0xc], ebx
jmp 0x499331
mov al, byte [esi + 3]
mov bl, byte [esi + 5]
mov bh, byte [esi + 4]
mov ah, byte [esi + 2]
shl eax, 0x10
xor ecx, ecx
shl ebx, 0x10
mov al, 2
mov bl, byte [esi + 7]
mov dword [edi + 8], ecx
mov bh, byte [esi + 6]
mov dword [edi + 0xc], ecx
mov dword [edi + 4], ebx
mov dword [edi], eax
mov edi, dword [ebp + 8]
xor ecx, ecx
xor edx, edx
mov dword [ebp - 0x2c], ecx
mov dx, word [edi]
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
push 0x48
mov ax, word [edx*2 + 0x4c18f8]
mov dword [ebp - 0x20], ecx
mov word [ebp - 0x2c], ax
call fcn.0048b010
mov ecx, dword [str.SOCK]
mov esi, eax
xor eax, eax
add esp, 4
mov dword [esi], ecx
mov ax, word [edi]
xor ecx, ecx
mov edx, dword [eax*4 + 0x4c18fc]
mov cx, word [eax*2 + 0x4c18f8]
push edx
push 1
push ecx
call sub.WSOCK32.dll_socket
mov dword [esi + 8], eax
call fcn.0049a220
mov eax, dword [esi + 8]
cmp eax, 0xffffffff
je 0x49948a
lea edx, [ebp - 0x2c]
push 0x10
push edx
push eax
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
je 0x49948a
mov eax, dword [0x4f6010]
mov ecx, dword [esi + 8]
push 0x13
push 0x401
push eax
push ecx
call sub.WSOCK32.dll_WSAAsyncSelect
test eax, eax
jne 0x49948a
mov eax, dword [esi + 8]
lea edx, [ebp - 0x1c]
push 0x10
push edx
push eax
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x4993f1
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x49948a
xor ecx, ecx
mov cx, word [edi]
mov edx, dword [ecx*4 + 0x4d29c8]
mov ebx, dword [edx + 0xc]
call fcn.0048db40
mov edi, eax
add edi, ebx
xor ebx, ebx
cmp word [0x4fa064], 0x440
je 0x499431
call fcn.0048db40
mov ebx, eax
cmp ebx, edi
jae 0x499480
call fcn.0048de10
cmp word [0x4fa064], 0x440
jne 0x499416
cmp ebx, edi
jae 0x499480
cmp word [0x4f5fc8], 0
sete al
test al, al
je 0x49948a
mov edx, dword [esi + 8]
lea eax, [ebp - 4]
lea ecx, [ebp - 0x1c]
push eax
push ecx
push edx
call sub.WSOCK32.dll_getpeername
mov ax, word [ebp - 0x1c]
cmp ax, 2
jne 0x4994c7
mov word [esi + 0x2e], 1
mov eax, dword [ebp - 0x1a]
push eax
call sub.WSOCK32.dll_ntohs
mov word [esi + 0x30], ax
mov ecx, dword [ebp - 0x18]
push ecx
call sub.WSOCK32.dll_ntohl
mov dword [esi + 0x32], eax
jmp 0x4994f7
push 0x274c
call sub.WSOCK32.dll_WSASetLastError
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x4994a0
push 0x274c
call sub.WSOCK32.dll_WSASetLastError
call sub.WSOCK32.dll_WSAGetLastError
mov edi, eax
xor edx, edx
mov ecx, 0x4d2a1c
cmp dword [ecx], edi
je 0x49959f
add ecx, 0xc
inc edx
cmp ecx, 0x4d2b90
jl 0x4994ae
jmp 0x4995cf
cmp ax, 6
jne 0x4994f7
mov word [esi + 0x2e], 0
mov edx, dword [ebp - 0x10]
push edx
call sub.WSOCK32.dll_ntohs
mov word [esi + 0x3a], ax
mov ecx, dword [ebp - 0x1a]
lea eax, [esi + 0x30]
mov dword [esi + 0x30], ecx
mov edx, dword [ebp - 0x16]
mov dword [eax + 4], edx
mov cx, word [ebp - 0x12]
mov word [eax + 8], cx
mov ecx, dword [esi + 8]
lea edx, [ebp - 8]
lea eax, [ebp - 0x2c]
push edx
push eax
push ecx
call sub.WSOCK32.dll_getsockname
mov ax, word [ebp - 0x1c]
cmp ax, 2
jne 0x499533
mov word [esi + 0x20], 1
mov edx, dword [ebp - 0x1a]
push edx
call sub.WSOCK32.dll_ntohs
mov word [esi + 0x22], ax
mov eax, dword [ebp - 0x18]
push eax
call sub.WSOCK32.dll_ntohl
mov dword [esi + 0x24], eax
jmp 0x499563
cmp ax, 6
jne 0x499563
mov word [esi + 0x20], 0
mov ecx, dword [ebp - 0x10]
push ecx
call sub.WSOCK32.dll_ntohs
mov word [esi + 0x2c], ax
mov eax, dword [ebp - 0x1a]
lea edx, [esi + 0x22]
mov dword [esi + 0x22], eax
mov ecx, dword [ebp - 0x16]
mov dword [edx + 4], ecx
mov ax, word [ebp - 0x12]
mov word [edx + 8], ax
mov edx, dword [esi + 8]
mov byte [esi + 0xc], 3
mov dword [esi + 0x3c], 0x226
mov eax, dword [0x4d29d4]
test eax, eax
mov ecx, 0x4d29d0
je 0x49958d
cmp dword [eax + 8], edx
jae 0x49958d
mov ecx, eax
mov eax, dword [ecx + 4]
test eax, eax
jne 0x49957f
mov edx, dword [ecx + 4]
mov eax, esi
mov dword [esi + 4], edx
mov dword [ecx + 4], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [edx + edx*2]
xor eax, eax
shl ecx, 2
mov al, byte [ecx + 0x4d2a19]
mov dword [0x4fa06c], eax
mov eax, dword [ecx + 0x4d2a20]
mov dword [0x4fa068], eax
mov al, byte [ecx + 0x4d2a18]
test al, al
je 0x4995cf
test esi, esi
je 0x4995cf
mov byte [esi + 0xd], 1
cmp edx, 0x1f
jne 0x4995fb
push edi
push str.Unknown_Error__u
push 0x4f5fcc
call fcn.004b57c2
add esp, 0xc
mov dword [0x4fa06c], 1
mov dword [0x4fa068], 0x4f5fcc
mov eax, dword [esi + 8]
test eax, eax
je 0x499608
push eax
call sub.WSOCK32.dll_closesocket
push esi
call fcn.0048b120
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret