Function at 0x40ebd0
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x4cf2a0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc
push ebx
push esi
mov esi, ecx
push edi
xor bl, bl
push esi
mov byte [esp + 0x13], 0
mov byte [esp + 0x12], bl
mov dword [esp + 0x18], esi
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
movzx eax, byte [esi + 0x90]
mov edi, dword [esi + 0x24]
mov dword [esp + 0x10], eax
sub eax, 0
mov dword [esp + 0x20], 0
je 0x40eccc
dec eax
jne 0x40ece0
test byte [esi + 0x91], 2
jne 0x40ec54
push 0
mov byte [esp + 0x12], 1
call fcn.004bf808
mov dword [esi + 0x8c], eax
mov al, byte [esi + 0x91]
add esp, 4
or al, 2
jmp 0x40ecda
cmp dword [esi + 0x28], 0xffffffff
jne 0x40ece0
mov eax, dword [esi + 0x70]
test eax, eax
jne 0x40ece0
mov eax, dword [esi + 0x74]
test eax, eax
jne 0x40ece0
mov eax, dword [esi + 0x78]
test eax, eax
jne 0x40ece0
mov ecx, esi
call fcn.0040e470
mov eax, dword [esi + 0x30]
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
mov ecx, dword [esi + 0x28]
mov edx, dword [esi + 0x24]
push ecx
push eax
push edx
push esi
push str.SP:0x_p_DP:0x_p_IP:_15s_SOCKET:0x_p_Eliminate_Session
push 0x83
push 0x4d63f8
push str.CSession::Process
push 3
push 0x50f190
call fcn.00408780
add esp, 0x28
push esi
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [esp + 0xc]
mov dword fs:[0], ecx
add esp, 0x18
ret
mov al, byte [esi + 0x91]
test al, 1
jne 0x40ece0
mov bl, 1
or al, bl
mov byte [esi + 0x91], al
mov edx, dword [esi + 0x78]
push ebp
inc edx
push esi
mov dword [esi + 0x78], edx
mov dword [esp + 0x28], 0xffffffff
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
test bl, bl
mov ebp, dword [sym.imp.WS2_32.dll_inet_ntoa]
je 0x40ed4b
mov eax, dword [esi + 0x30]
push eax
call ebp
mov ecx, dword [esi + 0x28]
mov edx, dword [esi + 0x24]
push ecx
push eax
push edx
push esi
push str.SP:0x_p_DP:0x_p_IP:_15s_SOCKET:0x_p_Connection_Open___Process_connected
push 0x94
push 0x4d63f8
push str.CSession::Process
push 3
push 0x50f190
call fcn.00408780
mov eax, dword [edi]
add esp, 0x28
mov ecx, edi
call dword [eax + 0xc]
push 0
call fcn.004bf808
add esp, 4
mov dword [esi + 0x88], eax
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x40ed95
mov edx, dword [edi]
mov ecx, edi
call dword [edx + 8]
test al, al
jne 0x40ed95
mov eax, dword [esi + 0x30]
push eax
call ebp
mov ecx, dword [esi + 0x28]
mov edx, dword [esi + 0x24]
push ecx
push eax
push edx
push esi
push str.SP:0x_p_DP:0x_p_IP:_15s_SOCKET:0x_p_CloseSocket___Failed_Dispatch
push 0x9f
push 0x4d63f8
push str.CSession::Process
push 3
push 0x50f190
call fcn.00408780
add esp, 0x28
mov bl, 1
jmp 0x40ed99
mov bl, byte [esp + 0x13]
mov al, byte [esp + 0x12]
test al, al
je 0x40eddb
mov eax, dword [esi + 0x30]
push eax
call ebp
mov ecx, dword [esi + 0x28]
mov edx, dword [esi + 0x24]
push ecx
push eax
push edx
push esi
push str.SP:0x_p_DP:0x_p_IP:_15s_SOCKET:0x_p__Connection_Closed___Process_disconnect
push 0xa8
push 0x4d63f8
push str.CSession::Process
push 3
push 0x50f190
call fcn.00408780
mov eax, dword [edi]
add esp, 0x28
mov ecx, edi
call dword [eax + 0x10]
push esi
mov dword [esp + 0x1c], esi
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x74]
test eax, eax
mov dword [esp + 0x24], 1
pop ebp
jne 0x40ee18
lea ecx, [esi + 0x58]
call fcn.0040e160
test eax, eax
je 0x40ee18
mov ecx, dword [eax + 0x28]
test ecx, ecx
push eax
mov ecx, esi
jne 0x40ee13
call fcn.0040e7d0
jmp 0x40ee18
call fcn.0040e900
test byte [esi + 0x91], 4
je 0x40ee44
mov eax, dword [esi + 0x64]
test eax, eax
jne 0x40ee44
mov eax, dword [esi + 0x28]
cmp eax, 0xffffffff
je 0x40ee44
push 1
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
test eax, eax
je 0x40ee44
or byte [esi + 0x91], 8
mov ecx, dword [esi + 0x78]
dec ecx
test bl, bl
mov dword [esi + 0x78], ecx
je 0x40ee56
mov ecx, esi
call fcn.0040e470
push esi
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x18]
pop edi
pop esi
mov al, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x18
ret