Function at 0x4a7e80
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, 0x3c8
mov eax, dword [0x4ce724]
xor eax, esp
mov dword [esp + 0x3c4], eax
push ebp
mov ebp, dword [esp + 0x3d0]
push edi
mov edi, dword [esp + 0x3e4]
push ebp
lea eax, [esp + 0x1d0]
push 0x100
push eax
mov dword [esp + 0x20], edi
call fcn.0046a4fd
push str.www.avanquest.com
lea ecx, [esp + 0x2dc]
push 0x100
push ecx
call fcn.0046a4fd
add esp, 0x18
lea edx, [esp + 0x3c]
push edx
push 0x102
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x4a7f08
test edi, edi
je 0x4a7eef
mov dword [edi], eax
pop edi
xor al, al
pop ebp
mov ecx, dword [esp + 0x3c4]
xor ecx, esp
call fcn.00467d4f
add esp, 0x3c8
ret
push ebx
push 0
push 0
push 0
push 1
push 3
push 2
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov ebx, eax
mov dword [esp + 0x14], ebx
cmp ebx, 0xffffffff
jne 0x4a7f52
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test edi, edi
je 0x4a7f32
mov dword [edi], eax
call dword [sym.imp.WS2_32.dll_WSACleanup]
pop ebx
pop edi
xor al, al
pop ebp
mov ecx, dword [esp + 0x3c4]
xor ecx, esp
call fcn.00467d4f
add esp, 0x3c8
ret
cmp dword [esp + 0x3e0], 1
jge 0x4a7f67
mov dword [esp + 0x3e0], 0x3e8
push esi
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea eax, [esp + 0x3e8]
push eax
push 0x1006
push 0xffff
push ebx
call esi
cmp eax, 0xffffffff
jne 0x4a7f92
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x4a7fe5
push 4
lea ecx, [esp + 0x3e8]
push ecx
push 0x1005
push 0xffff
push ebx
call esi
cmp eax, 0xffffffff
jne 0x4a7fb6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x4a7fe5
xor eax, eax
push eax
push eax
lea edx, [esp + 0x2c]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
push edx
lea eax, [esp + 0x34]
push eax
push ebp
call fcn.004a7d80
add esp, 0x14
mov dword [esp + 0x14], eax
test eax, eax
je 0x4a7fff
test edi, edi
je 0x4a7feb
mov dword [edi], eax
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x4a81f4
mov edi, dword [esp + 0x3e0]
cmp edi, 1
jge 0x4a8010
mov edi, 0x20
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x400
push 8
add edi, 8
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call ebx
mov esi, eax
test esi, esi
jne 0x4a8057
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4a803f
mov dword [eax], 8
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x4a81f4
push 0x400
push 0
push esi
call fcn.00467d60
push edi
mov eax, esi
call fcn.004a7cd0
add esp, 0x10
push 0x400
push 8
call ebp
push eax
call ebx
mov ebx, eax
test ebx, ebx
jne 0x4a80b2
push esi
push eax
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4a809a
mov dword [eax], 8
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor al, al
jmp 0x4a81f4
mov dword [esp + 0x20], 0x10
mov byte [esp + 0x13], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [esp + 0x3e8], 0
jge 0x4a80da
mov dword [esp + 0x3e8], 4
xor ebp, ebp
cmp dword [esp + 0x3e8], ebp
jl 0x4a81af
lea esp, [esp]
xor eax, eax
mov word [esi + 2], ax
mov eax, edi
mov ecx, esi
mov word [esi + 6], bp
call fcn.004a7d10
mov edx, dword [esp + 0x18]
push 0x10
lea ecx, [esp + 0x28]
push ecx
push 0
push edi
push esi
push edx
mov word [esi + 2], ax
call dword [sym.imp.WS2_32.dll_sendto]
cmp eax, 0xffffffff
je 0x4a8144
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x38]
push ecx
push 0
push 0x400
push ebx
push edx
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp eax, 0xffffffff
jne 0x4a817b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x14], eax
cmp eax, 0x274c
jne 0x4a81af
push 0x1f4
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_Sleep]
inc ebp
movzx eax, bp
cmp eax, dword [esp + 0x3e8]
jle 0x4a80f0
jmp 0x4a81af
mov edi, dword [ebx]
and edi, 0xf
add edi, edi
add edi, edi
lea ecx, [edi + 8]
cmp eax, ecx
jae 0x4a8192
mov byte [esp + 0x13], 0
jmp 0x4a81af
cmp byte [edi + ebx], 0
je 0x4a819f
mov byte [esp + 0x13], 0
jmp 0x4a81af
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp word [edi + ebx + 4], ax
sete byte [esp + 0x13]
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
push ebx
push 0
call edi
push eax
call esi
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4a81df
mov edx, dword [esp + 0x14]
mov dword [eax], edx
mov eax, dword [esp + 0x18]
push eax
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 + 0x3d4]
pop esi
pop ebx
pop edi
pop ebp
xor ecx, esp
call fcn.00467d4f
add esp, 0x3c8
ret