Function at 0x40a6ae
Capabilities:
Accept command line arguments
Connect socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe0
mov dword [ebp - 0x14], 0x10
cmp dword [ebp + 0xc], 3
pushfd
push edx
ror edx, 2
pop edx
pushal
call sub.KERNEL32.DLL_GetCurrentProcess
popal
popfd
punpckhdq mm0, mm1
pushal
pushfd
call sub.KERNEL32.DLL_GetLastError
popfd
popal
jg 0x40a9e5
cmp dword [ebp + 0xc], 3
jne 0x40a719
pushfd
push ecx
rcr ecx, 0x18
pop ecx
pushal
call sub.KERNEL32.DLL_GetCommandLineA
popal
popfd
push esi
call fcn.0040aadb
pop esi
jmp 0x40a712
mov ebx, 2
jmp 0x40a74b
pushfd
push esi
rol esi, 0x13
pop esi
pushal
call sub.KERNEL32.DLL_GetCurrentProcess
popal
popfd
push esi
call fcn.0040aadb
pop esi
jmp 0x40a746
mov ebx, 1
pushfd
push esi
btc esi, 0x19
pop esi
pushal
call sub.KERNEL32.DLL_GetCommandLineA
popal
popfd
fnclex
pushal
pushfd
call sub.KERNEL32.DLL_GetCurrentProcess
popfd
popal
push 6
push ebx
push 2
call sub.wsock32.dll_socket
mov dword [ebp - 0x18], eax
inc eax
test eax, eax
je 0x40a9e5
push 6
push ebx
push 2
call sub.wsock32.dll_socket
mov dword [ebp - 0x1c], eax
inc eax
pushfd
push ecx
btc ecx, 7
pop ecx
pushal
call sub.KERNEL32.DLL_GetLastError
popal
popfd
push esi
call fcn.0040aadb
pop esi
jmp 0x40a7b7
test eax, eax
je 0x40a9e5
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
cmp dword [ebp + 0xc], 1
je 0x40a7d9
cmp dword [ebp + 0xc], 3
jne 0x40a835
mov word [ebp - 0x10], 2
mov eax, dword [ebp + 0x1c]
mov word [ebp - 0xe], ax
pushfd
push edx
bt edx, 4
pop edx
pushal
call sub.KERNEL32.DLL_GetCommandLineA
popal
popfd
push dword [ebp + 0x18]
pop dword [ebp - 0xc]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x1c]
call sub.wsock32.dll_connect
test eax, eax
pushfd
push esi
bts esi, 0xb
pop esi
pushal
call sub.KERNEL32.DLL_GetCurrentThreadId
popal
popfd
pushfd
push ebx
setle bl
pop ebx
pushal
call sub.KERNEL32.DLL_GetCommandLineA
popal
popfd
jne 0x40a9e5
jmp 0x40a8d1
cmp dword [ebp + 0xc], 2
je 0x40a845
cmp dword [ebp + 0xc], 3
jne 0x40a8d1
mov word [ebp - 0x10], 2
mov word [ebp - 0xe], 0
mov dword [ebp - 0xc], 0
pushfd
push ebx
btc ebx, 0x1d
pop ebx
pushal
call sub.KERNEL32.DLL_GetCurrentThread
popal
popfd
pavgw mm0, mm1
pushal
pushfd
call sub.KERNEL32.DLL_GetLastError
popfd
popal
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x18]
call sub.wsock32.dll_bind
pushfd
push eax
ror eax, 0xf
pop eax
pushal
call sub.KERNEL32.DLL_GetCommandLineA
popal
popfd
pushfd
push ebx
setbe bl
pop ebx
pushal
call sub.KERNEL32.DLL_GetCurrentProcess
popal
popfd
test eax, eax
jne 0x40a9e5
cmp dword [ebp + 0xc], 2
jne 0x40a8d1
pushfd
push esi
rcl esi, 9
pop esi
pushal
call sub.KERNEL32.DLL_GetCurrentProcessId
popal
popfd
psllw mm0, mm1
pushal
pushfd
call sub.KERNEL32.DLL_GetCurrentProcess
popfd
popal
push 1
push dword [ebp - 0x18]
call sub.wsock32.dll_listen
cmp dword [ebp + 0xc], 1
jne 0x40a8ff
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x1c]
call sub.wsock32.dll_getpeername
mov eax, dword [ebp - 0xc]
movzx ecx, word [ebp - 0xe]
push ecx
push eax
push 0
push dword [ebp + 8]
call fcn.0040ebfb
jmp 0x40a99d
pushfd
push ecx
rol ecx, 5
pop ecx
pushal
call sub.KERNEL32.DLL_GetCurrentThread
popal
popfd
push ebx
push eax
pushfd
cmovle ebx, eax
popfd
pop eax
pop ebx
pushal
pushfd
call sub.KERNEL32.DLL_GetCommandLineA
popfd
popal
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x18]
call sub.wsock32.dll_getsockname
movzx eax, word [ebp - 0xe]
push eax
pushfd
push esi
rcl esi, 0x19
pop esi
pushal
call sub.KERNEL32.DLL_GetTickCount
popal
popfd
push esi
call fcn.0040aadb
pop esi
jmp 0x40a961
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 8]
call sub.wsock32.dll_getsockname
mov eax, dword [ebp - 0xc]
pushfd
push ebx
shl ebx, 0x1b
pop ebx
pushal
call sub.KERNEL32.DLL_GetCurrentThreadId
popal
popfd
pushfd
push ebx
setne bl
pop ebx
pushal
call sub.KERNEL32.DLL_GetCurrentThread
popal
popfd
pop ecx
push ecx
push eax
push 0
push dword [ebp + 8]
call fcn.0040ebfb
mov eax, dword [ebp + 0x20]
push dword [ebp - 0x18]
pushfd
push eax
shl eax, 0x12
pop eax
pushal
call sub.KERNEL32.DLL_GetTickCount
popal
popfd
movq mm0, mm1
pushal
pushfd
call sub.KERNEL32.DLL_GetCommandLineA
popfd
popal
pop dword [eax]
push dword [ebp - 0x1c]
pop dword [eax - 4]
xor eax, eax
inc eax
pushfd
push ecx
rcr ecx, 7
pop ecx
pushal
call sub.KERNEL32.DLL_GetCurrentProcess
popal
popfd
fprem
pushal
pushfd
call sub.KERNEL32.DLL_GetCurrentProcess
popfd
popal
leave
ret 0x1c
mov word [ebp - 0x20], 1
mov word [ebp - 0x1e], 0
pushfd
push esi
rcl esi, 0x13
pop esi
pushal
call sub.KERNEL32.DLL_GetLastError
popal
popfd
push esi
call fcn.0040aadb
pop esi
jmp 0x40aa1e
push 4
lea eax, [ebp - 0x20]
push eax
push 0x80
push 0xffff
push dword [ebp - 0x18]
call sub.wsock32.dll_setsockopt
push 4
lea eax, [ebp - 0x20]
push eax
push 0x80
push 0xffff
push dword [ebp - 0x1c]
call sub.wsock32.dll_setsockopt
push 2
push dword [ebp - 0x18]
call sub.wsock32.dll_shutdown
push 2
push dword [ebp - 0x1c]
call sub.wsock32.dll_shutdown
pushfd
push edx
rcr edx, 0xc
pop edx
pushal
call sub.KERNEL32.DLL_GetLastError
popal
popfd
push esi
call fcn.0040aadb
pop esi
jmp 0x40aa90
push dword [ebp - 0x18]
call sub.wsock32.dll_closesocket
pushfd
push edx
shl edx, 0xc
pop edx
pushal
call sub.KERNEL32.DLL_GetCurrentThreadId
popal
popfd
paddusb mm0, mm1
pushal
pushfd
call sub.KERNEL32.DLL_GetCurrentThreadId
popfd
popal
push dword [ebp - 0x1c]
call sub.wsock32.dll_closesocket
pushfd
push eax
btc eax, 0xc
pop eax
pushal
call sub.KERNEL32.DLL_GetCurrentProcessId
popal
popfd
pmulhw mm0, mm1
pushal
pushfd
call sub.KERNEL32.DLL_GetCurrentThreadId
popfd
popal
xor eax, eax
leave
ret 0x1c