Function at 0x4a9b60
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration
Terminate process

Disassembly:
sub esp, 0x38
mov eax, dword [0x6009e4]
xor eax, esp
mov dword [esp + 0x34], eax
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x50]
mov ebp, ecx
mov dword [esp + 0x1c], 1
mov dword [esp + 0x18], 0
mov dword [esp + 0x20], 0x1c
cmp word [edi], 1
je 0x4a9c3e
lea eax, [esp + 0x14]
mov edx, 4
push eax
lea eax, [esp + 0x14]
push eax
lea ecx, [edx + 0x58]
call fcn.004ae770
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
push 0x28
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], str.ILibAsyncServerSocket
mov dword [esi], 0x4a96d0
mov dword [esi + 4], 0x4a9740
mov dword [esi + 8], 0x4a9920
mov dword [esi + 0xc], ebp
mov dword [esi + 0x38], 0x489200
mov dword [esi + 0x3c], 0x4896b0
mov dword [esi + 0x40], fcn.00403e30
mov dword [esi + 0x44], 0x489760
mov dword [esi + 0x34], 0x4896f0
mov dword [esi + 0x18], 0xa
call fcn.0058d200
add esp, 0xc
mov dword [esi + 0x1c], eax
test eax, eax
jne 0x4a9c53
push esi
call fcn.0058bf82
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xfd
push 0x287
mov edx, 0x61b8d4
xor ecx, ecx
call fcn.004b47e0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.00584a28
add esp, 0x38
ret
cmp word [edi], 1
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
jne 0x4a9c9c
push 0
push 1
push 1
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 0x24], eax
cmp eax, 0xffffffff
jne 0x4a9ce1
push dword [esi + 0x1c]
call fcn.0058bf82
add esp, 4
push esi
call fcn.0058bf82
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.00584a28
add esp, 0x38
ret
movzx eax, word [edi + 2]
push eax
call ebx
push 6
mov word [esi + 0x28], ax
mov word [esi + 0x2a], ax
movzx eax, word [edi]
push 1
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 0x24], eax
cmp eax, 0xffffffff
je 0x4a9c73
cmp word [edi], 0x17
jne 0x4a9ce1
push 4
lea ecx, [esp + 0x1c]
push ecx
push 0x1b
push 0x29
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jne 0x4a9e12
push 4
lea eax, [esp + 0x20]
push eax
push 0xfffffffffffffffb
push 0xffff
push dword [esi + 0x24]
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jne 0x4a9e39
cmp word [edi], 0x17
mov ecx, 0x1c
mov eax, 0x10
cmove eax, ecx
push eax
push edi
push dword [esi + 0x24]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x4a9d52
push dword [esi + 0x24]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [esi + 0x1c]
call fcn.0058bf82
add esp, 4
push esi
call fcn.0058bf82
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.00584a28
add esp, 0x38
ret
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x2c]
push eax
push dword [esi + 0x24]
call dword [sym.imp.WS2_32.dll_getsockname]
cmp word [edi], 1
je 0x4a9d75
push dword [esp + 0x2a]
call ebx
mov word [esi + 0x28], ax
xor edi, edi
nop word [eax + eax]
push 4
push 0x4a9a50
push 0x4a9a00
push 0x4a99c0
push 0x4a9950
mov edx, 0x1000
mov ecx, ebp
call fcn.004a9f90
mov ecx, dword [esi + 0x1c]
add esp, 0x14
mov dword [edi + ecx], eax
mov eax, dword [esi + 0x1c]
mov eax, dword [edi + eax]
test eax, eax
je 0x4a9dbf
mov dword [eax + 0x1cc], 0x4a9a70
add edi, 4
cmp edi, 0x28
jl 0x4a9d80
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 1
push eax
push 0x8004667e
push dword [esi + 0x24]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 4
push dword [esi + 0x24]
mov dword [esi + 0x2c], 1
call dword [sym.imp.WS2_32.dll_listen]
mov edx, esi
mov ecx, ebp
call fcn.004aee00
mov ecx, dword [esp + 0x44]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00584a28
add esp, 0x38
ret
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x296
mov edx, 0x61b8fc
xor ecx, ecx
call fcn.004b47e0
add esp, 0xc
push 0xfd
call fcn.00587d2d
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x2a1
mov edx, str...microstackILibAsyncServerSocket.c
xor ecx, ecx
call fcn.004b47e0
add esp, 0xc
push 0xfd
call fcn.00587d2d
int3