Function at 0x407720
Capabilities:
Set tcp connection state

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xcc
mov eax, dword [0x5c7004]
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 0x407999
mov eax, dword [ebp + 0x10]
lea esi, [edi + 5]
mov edx, dword [ecx + edi*4]
cmp dword [edx], 0x11
jne 0x40798c
cmp dword [edx + 0x34], 5
jne 0x40798c
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 0x4077c0
test eax, eax
je 0x407985
cmp eax, 0x13d
mov byte [esp + 0x11], 0
cmove eax, esi
cmp byte [esp + 0x12], 0
jne 0x407964
test eax, eax
jle 0x4077f2
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.00401700
test al, al
je 0x407964
cmp byte [esp + 0x13], 0
je 0x40795d
mov ecx, dword [0x5d0188]
mov edi, edi
test ecx, ecx
jne 0x407837
mov esi, 0xc0000037
push esi
lfence
call sym.ProcessHacker.exe_PhGetNtMessage
jmp 0x4078f1
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 0x4078af
mov esi, eax
mov ecx, esi
cmp eax, 0xc0000022
je 0x4078cf
cmp eax, 0xc0000005
je 0x4078cf
mov eax, ecx
and eax, 0xfff0000
cmp eax, 0x70000
jne 0x4078dd
movzx eax, cx
jmp 0x4078d9
mov esi, dword [esp + 0x4c]
mov eax, esi
test esi, esi
js 0x40788c
mov byte ds:[esp + 0x11], 1
call sym.ProcessHacker.exe__PhUiDisconnectFromPhSvc_0
mov esi, 5
jmp 0x407985
push eax
lfence
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
test eax, eax
jne 0x4078e8
push esi
lfence
call sym.ProcessHacker.exe_PhGetNtMessage
jmp 0x4078f1
push eax
lfence
call sym.ProcessHacker.exe_PhGetWin32Message
mov esi, eax
test esi, esi
je 0x40793c
lfence
lfence
push dword [esi + 4]
push 0x5634d8
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 0x407951
lfence
call fcn.004c1f60
call sym.ProcessHacker.exe__PhUiDisconnectFromPhSvc_0
mov esi, 5
jmp 0x407985
push str.Unable_to_close_the_TCP_connection
push 0x5981b0
push 0x10
push ebx
call sym.ProcessHacker.exe_PhShowMessage
add esp, 0x10
call sym.ProcessHacker.exe__PhUiDisconnectFromPhSvc_0
mov esi, 5
jmp 0x407985
mov byte [esp + 0x12], 1
jmp 0x407985
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 0x407995
mov ecx, dword [esp + 0x14]
mov eax, dword [ebp + 0x10]
inc edi
cmp edi, eax
jb 0x407763
mov al, byte [esp + 0x11]
mov ecx, dword [esp + 0xd4]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00534c91
mov esp, ebp
pop ebp
ret 0xc