Function at 0x496940
Capabilities:
Create raw socket
Create tcp socket
Create udp socket
Initialize winsock library
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0x1cc
mov eax, dword [0x4ce724]
xor eax, esp
mov dword [esp + 0x1c8], eax
push ebp
mov ebp, dword [esp + 0x1d4]
push edi
mov edi, dword [esp + 0x1e8]
lea edx, [esp + 0x40]
mov dword [esp + 0x10], edi
mov eax, ebp
sub edx, ebp
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x496970
xor eax, eax
lea esp, [esp]
mov cl, byte [eax + 0x4c62e4]
mov byte [esp + eax + 0x40], cl
inc eax
test cl, cl
jne 0x496980
lea eax, [esp + 0x40]
push eax
push 0x102
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x4969c2
test edi, edi
je 0x4969a9
mov dword [edi], eax
pop edi
xor al, al
pop ebp
mov ecx, dword [esp + 0x1c8]
xor ecx, esp
call fcn.00467d4f
add esp, 0x1cc
ret
push esi
push 0
push 0
push 0
push 1
push 3
push 2
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov esi, eax
mov dword [esp + 0x10], esi
cmp esi, 0xffffffff
jne 0x496a0c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test edi, edi
je 0x4969ec
mov dword [edi], eax
call dword [sym.imp.WS2_32.dll_WSACleanup]
pop esi
pop edi
xor al, al
pop ebp
mov ecx, dword [esp + 0x1c8]
xor ecx, esp
call fcn.00467d4f
add esp, 0x1cc
ret
cmp dword [esp + 0x1e4], 1
jge 0x496a21
mov dword [esp + 0x1e4], 0x3e8
push ebx
mov ebx, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea ecx, [esp + 0x1ec]
push ecx
push 0x1006
push 0xffff
push esi
call ebx
cmp eax, 0xffffffff
je 0x496a60
push 4
lea edx, [esp + 0x1ec]
push edx
push 0x1005
push 0xffff
push esi
call ebx
cmp eax, 0xffffffff
jne 0x496a80
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test edi, edi
je 0x496a6c
mov dword [edi], eax
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x496cb0
xor eax, eax
push eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x34]
push ecx
push ebp
call fcn.00496740
mov ebp, eax
add esp, 0x10
test ebp, ebp
je 0x496ac6
test edi, edi
je 0x496ab2
mov dword [edi], ebp
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x496cb0
mov edi, dword [esp + 0x1e4]
cmp edi, 1
jge 0x496ad7
mov edi, 0x20
push 0x400
push 8
add edi, 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call ebx
mov esi, eax
test esi, esi
jne 0x496b1c
mov eax, dword [esp + 0x18]
test eax, eax
je 0x496b04
mov dword [eax], 8
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x496cb0
push 0x400
push 0
push esi
call fcn.00467d60
push edi
push esi
call fcn.00496630
add esp, 0x14
push 0x400
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x496b80
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x496b68
mov dword [eax], 8
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x496cb0
mov dword [esp + 0x24], 0x10
mov byte [esp + 0x13], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [esp + 0x1ec], 0
jge 0x496ba8
mov dword [esp + 0x1ec], 4
cmp dword [esp + 0x1ec], 0
mov dword [esp + 0x20], 0
jl 0x496c6b
mov edi, edi
mov dx, word [esp + 0x20]
xor ecx, ecx
push edi
push esi
mov word [esi + 2], cx
mov word [esi + 6], dx
call fcn.00496670
mov ebx, dword [esp + 0x1c]
add esp, 8
push 0x10
mov word [esi + 2], ax
lea eax, [esp + 0x2c]
push eax
push 0
push edi
push esi
push ebx
call dword [sym.imp.WS2_32.dll_sendto]
cmp eax, 0xffffffff
je 0x496c1a
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x3c]
push edx
push 0
push 0x400
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp eax, 0xffffffff
jne 0x496c52
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x274c
jne 0x496c6f
push 0x1f4
xor ebp, ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x20]
inc eax
movzx ecx, ax
cmp ecx, dword [esp + 0x1ec]
mov dword [esp + 0x20], eax
jle 0x496bc0
jmp 0x496c6f
lea edx, [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0x24]
push eax
call fcn.00496700
add esp, 0xc
mov byte [esp + 0x13], al
jmp 0x496c6f
mov ebx, dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push esi
push 0
call edi
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call esi
mov ecx, dword [esp + 0x1c]
push ecx
push 0
call edi
push eax
call esi
mov eax, dword [esp + 0x18]
test eax, eax
je 0x496c9f
mov dword [eax], ebp
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov al, byte [esp + 0x13]
mov ecx, dword [esp + 0x1d8]
pop ebx
pop esi
pop edi
pop ebp
xor ecx, esp
call fcn.00467d4f
add esp, 0x1cc
ret