Function at 0x415690
Capabilities:
Get local ipv4 addresses
Get socket information
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x374
mov eax, dword [0x456d10]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [0x45af88]
push esi
push edi
push str.Enter_GetViewSessionSocket_n
push 2
mov esi, edx
mov dword [ebp - 0x360], ebx
mov dword [ebp - 0x358], 0
mov dword [ebp - 0x120], 1
mov dword [ebp - 0x118], 0
call fcn.0041a380
add esp, 8
mov dword [ebp - 0x128], 0xa
mov dword [ebp - 0x124], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x110]
push str.TelnetDViewSession_d
push eax
call fcn.00404cf0
mov eax, dword [0x47bb30]
add esp, 0xc
test eax, eax
jne 0x415762
lea eax, [ebp - 0x110]
push eax
push 0x14
push 0
push 4
push 0
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [0x47bb30], eax
test eax, eax
jne 0x415762
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d_n
push 0
call fcn.0041a380
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004265fb
mov esp, ebp
pop ebp
ret
cmp dword [0x47bab0], 0
jne 0x4157c5
push 0
push 0
push 0
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x47bab0], eax
test eax, eax
jne 0x4157c5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Not_able_to_create_MapView__rc___d_n
push 0
call fcn.0041a380
add esp, 0xc
push dword [0x47bb30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x47bb30], 0
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004265fb
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x415847
push 0
push 9
push 0x457ea4
push esi
call fcn.004045f0
add esp, 0x10
cmp eax, 0xffffffff
je 0x415847
push eax
push str.View_Session_select_returned__d_n
push 2
call fcn.0041a380
mov ecx, dword [0x47bab0]
add esp, 0xc
mov eax, dword [ebp - 0x364]
mov dword [ebp - 0x368], 0xfffffff3
movdqu xmm0, xmmword [ebp - 0x374]
push ebx
movdqu xmmword [ecx], xmm0
mov dword [ecx + 0x10], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push dword [0x47bb30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [0x47bab0]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004265fb
mov esp, ebp
pop ebp
ret
mov eax, dword [0x47bb20]
xorps xmm0, xmm0
xor ebx, ebx
mov dword [ebp - 0x354], 0
movdqu xmmword [ebp - 0x148], xmm0
mov dword [ebp - 0x144], ebx
mov dword [ebp - 0x140], 1
mov dword [ebp - 0x148], 1
movdqu xmmword [ebp - 0x138], xmm0
test eax, eax
jne 0x415895
xor ecx, ecx
call fcn.00412560
mov dword [0x47bb20], eax
lea ecx, [ebp - 0x354]
push ecx
lea ecx, [ebp - 0x148]
push ecx
push 0x451054
push 0
call eax
mov esi, eax
push esi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
test esi, esi
je 0x4158d2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004265fb
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x354]
xor edx, edx
mov dword [ebp - 0x35c], edx
mov dword [ebp - 0x250], edx
test edi, edi
je 0x415a7f
mov ecx, dword [sym.imp.WS2_32.dll_ntohs]
cmp edx, 0x40
je 0x415a79
test bx, bx
je 0x415919
mov eax, dword [edi + 4]
cmp eax, 0x17
je 0x41590f
cmp eax, 2
jne 0x415919
mov esi, dword [edi + 0x18]
push ebx
call ecx
mov word [esi + 2], ax
mov eax, dword [edi + 4]
cmp eax, 2
je 0x41592a
cmp eax, 0x17
jne 0x415a5b
push dword [edi + 0xc]
push dword [edi + 8]
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x415a5b
push 4
lea eax, [ebp - 0x120]
push eax
push 4
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea eax, [ebp - 0x114]
mov dword [ebp - 0x114], 0x50001
push eax
push 0x80
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
push dword [edi + 0x10]
push dword [edi + 0x18]
push esi
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x4159c8
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push str.Socket_bind_failed_for_viewsession.
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 1
push 1
push 0xe0000003
push str.TelnetServer
call fcn.00419930
add esp, 0x18
push dword [0x45a964]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
jmp 0x415a5b
test bx, bx
jne 0x415a0e
lea eax, [ebp - 0x118]
mov dword [ebp - 0x118], 0x80
push eax
lea eax, [ebp - 0x2d0]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, 0xffffffff
jne 0x4159fe
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push str.getsockname_failed_for_viewsession.
jmp 0x41599a
push dword [ebp - 0x2ce]
mov eax, dword [sym.imp.WS2_32.dll_ntohs]
call eax
movzx ebx, ax
push 5
push esi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x415a2b
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push str.Socket_listen_failed_for_viewsession.
jmp 0x41599a
mov ecx, dword [ebp - 0x250]
xor eax, eax
test ecx, ecx
je 0x415a45
cmp dword [ebp + eax*4 - 0x24c], esi
je 0x415a45
inc eax
cmp eax, ecx
jb 0x415a37
cmp eax, ecx
jne 0x415a5b
cmp ecx, 0x40
jae 0x415a5b
mov dword [ebp + eax*4 - 0x24c], esi
inc dword [ebp - 0x250]
mov edx, dword [ebp - 0x35c]
mov edi, dword [edi + 0x1c]
inc edx
mov ecx, dword [sym.imp.WS2_32.dll_ntohs]
mov dword [ebp - 0x35c], edx
test edi, edi
jne 0x4158f4
mov edi, dword [ebp - 0x354]
mov eax, dword [0x47bb18]
test eax, eax
jne 0x415a95
lea ecx, [eax + 2]
call fcn.00412560
mov dword [0x47bb18], eax
push edi
call eax
mov ecx, dword [0x47bab0]
push dword [ebp - 0x360]
movzx eax, bx
mov dword [ebp - 0x368], eax
movdqu xmm0, xmmword [ebp - 0x374]
mov eax, dword [ebp - 0x364]
movdqu xmmword [ecx], xmm0
mov dword [ecx + 0x10], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
lea eax, [ebp - 0x128]
push eax
push 0
push 0
lea eax, [ebp - 0x250]
push eax
push dword [ebp - 0x250]
call dword [sym.imp.WS2_32.dll_select]
xor esi, esi
cmp dword [ebp - 0x250], esi
jle 0x415ba5
mov ebx, dword [sym.imp.WS2_32.dll_closesocket]
lea ebx, [ebx]
cmp dword [ebp - 0x358], 0
mov edi, dword [ebp + esi*4 - 0x24c]
jne 0x415b95
lea eax, [ebp - 0x250]
push eax
push edi
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x415b95
lea eax, [ebp - 0x11c]
mov dword [ebp - 0x11c], 0x80
push eax
lea eax, [ebp - 0x350]
push eax
push edi
call dword [sym.imp.WS2_32.dll_accept]
mov dword [ebp - 0x358], eax
cmp eax, 0xffffffff
jne 0x415b95
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Socket_accept_failed_for_viewsession.__d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 1
push 1
push 0xe0000003
push str.TelnetServer
call fcn.00419930
add esp, 0x1c
push dword [0x45a964]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
mov dword [ebp - 0x358], 0
push edi
call ebx
inc esi
cmp esi, dword [ebp - 0x250]
jl 0x415b00
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x358]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004265fb
mov esp, ebp
pop ebp
ret