Function at 0x405620
Capabilities:
Set tcp connection state

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xcc
mov eax, dword [0x5ac004]
xor eax, esp
mov dword [esp + 0xc8], eax
mov ecx, dword [ebp + 0xc]
mov al, 1
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
xor edi, edi
mov dword [esp + 0x14], ecx
mov byte [esp + 0x11], al
mov byte [esp + 0x12], 0
cmp dword [ebp + 0x10], edi
je 0x405899
mov eax, dword [ebp + 0x10]
lea esi, [edi + 5]
mov edx, dword [ecx + edi*4]
cmp dword [edx], 0x11
jne 0x40588c
cmp dword [edx + 0x34], 5
jne 0x40588c
mov dword [esp + 0x1c], 0xc
mov eax, dword [edx + 8]
mov dword [esp + 0x20], eax
movzx eax, word [edx + 0x18]
mov ch, al
mov cl, ah
movzx eax, cx
mov dword [esp + 0x24], eax
mov eax, dword [edx + 0x20]
mov dword [esp + 0x28], eax
movzx eax, word [edx + 0x30]
mov ch, al
mov cl, ah
movzx eax, cx
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.IPHLPAPI.DLL_SetTcpEntry]
jmp 0x4056c0
test eax, eax
je 0x405885
cmp eax, 0x13d
mov byte [esp + 0x11], 0
cmove eax, esi
cmp byte [esp + 0x12], 0
jne 0x405864
test eax, eax
jle 0x4056f2
movzx eax, ax
or eax, 0xc0070000
lea ecx, ds:[esp + 0x13]
mov edx, str.Unable_to_close_the_TCP_connection
push ecx
push eax
mov ecx, ebx
call fcn.00401680
test al, al
je 0x405864
cmp byte [esp + 0x13], 0
je 0x40585d
mov ecx, dword [0x5b4940]
mov edi, edi
test ecx, ecx
jne 0x405737
mov esi, 0xc0000037
push esi
lfence
call sym.ProcessHacker.exe_PhGetNtMessage
jmp 0x4057f1
mov eax, dword ds:[esp + 0x1c]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x60], eax
lea eax, [esp + 0x30]
push eax
push eax
push ecx
mov dword [esp + 0x54], 9
mov dword [esp + 0x3c], 0xa00088
mov dword [esp + 0x40], 0
call dword [sym.imp.ntdll.dll_NtRequestWaitReplyPort]
test eax, eax
jns 0x4057af
mov esi, eax
mov ecx, esi
cmp eax, 0xc0000022
je 0x4057cf
cmp eax, 0xc0000005
je 0x4057cf
mov eax, ecx
and eax, 0xfff0000
cmp eax, 0x70000
jne 0x4057dd
movzx eax, cx
jmp 0x4057d9
mov esi, dword [esp + 0x4c]
mov eax, esi
test esi, esi
js 0x40578c
mov byte ds:[esp + 0x11], 1
call sym.ProcessHacker.exe__PhUiDisconnectFromPhSvc_0
mov esi, 5
jmp 0x405885
push eax
lfence
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
test eax, eax
jne 0x4057e8
push esi
lfence
call sym.ProcessHacker.exe_PhGetNtMessage
jmp 0x4057f1
push eax
lfence
call sym.ProcessHacker.exe_PhGetWin32Message
mov esi, eax
test esi, esi
je 0x40583c
lfence
lfence
push dword [esi + 4]
push 0x54ace8
push str.Unable_to_close_the_TCP_connection
push 0xfffe
push 0x20
push ebx
call sym.ProcessHacker.exe_PhShowMessage2
add esp, 0x18
lea ecx, [esi - 8]
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
dec eax
jne 0x405851
lfence
call fcn.004b3960
call sym.ProcessHacker.exe__PhUiDisconnectFromPhSvc_0
mov esi, 5
jmp 0x405885
push str.Unable_to_close_the_TCP_connection
push 0x57e1d4
push 0x10
push ebx
call sym.ProcessHacker.exe_PhShowMessage
add esp, 0x10
call sym.ProcessHacker.exe__PhUiDisconnectFromPhSvc_0
mov esi, 5
jmp 0x405885
mov byte [esp + 0x12], 1
jmp 0x405885
push str.Make_sure_Process_Hacker_is_running_with_administrative_privileges.
push str.Unable_to_close_the_TCP_connection.
push 0xfffe
push 1
push ebx
call sym.ProcessHacker.exe_PhShowMessage2
add esp, 0x14
cmp eax, 1
jne 0x405895
mov ecx, dword [esp + 0x14]
mov eax, dword [ebp + 0x10]
inc edi
cmp edi, eax
jb 0x405663
mov al, byte [esp + 0x11]
mov ecx, dword [esp + 0xd4]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc