README
¶
Process Management CLI Tool - Documentation
Overview
This tool provides a comprehensive set of commands to manage and interact with processes on a Windows system using golang. Below is a detailed description of each available function, including usage examples, arguments, return values, and exceptions.
Functions
0. help
Description
Print the help message
Usage
ProcHandle.exe help
Arguments
- None
Returns
- A list of the args
Exceptions
- None (i hope)
1. list
Description
Lists all the running processes on the system.
Usage
ProcHandle.exe list
Arguments
- None
Returns
- A list of running processes, including their PID (Process ID) and process name.
Exceptions
- PermissionDenied: If the tool doesn't have sufficient permissions to access the list of processes.
- SnapshotFailed: If there is an error creating the snapshot of processes.
2. info
Description
Retrieves detailed information about a specific process by its PID.
Usage
ProcHandle.exe info <proc_name>
Arguments
<process_name>
(string): The Process name that you want to query.
Returns
- Process details, including memory usage, executable path, start time, and priority class.
Exceptions
- InvalidPID: If the provided PID does not exist or is not accessible.
- PermissionDenied: If the tool lacks the permissions to access the process details.
3. terminate
Description
Terminates a process given its PID.
Usage
ProcHandle.exe terminate <proc_name>
Arguments
<proc_name>
(string): The Process name that you want to terminate.
Returns
- Confirmation message indicating if the process was terminated successfully.
Exceptions
- PermissionDenied: If the tool does not have permissions to terminate the process.
- InvalidPID: If the provided PID does not exist.
- AccessDenied: If the process cannot be terminated (e.g., a critical system process).
4. set-priority
Description
Sets the priority class for a given process.
Usage
ProcHandle.exe set-priority <proc_name> <priority>
Arguments
<Proc_name>
(string): The Process name whose priority you want to change.<priority>
(string): The priority class. Possible values are:low
,normal
,high
,realtime
.
Returns
- Confirmation message indicating if the priority was successfully changed.
Exceptions
- InvalidPID: If the provided PID does not exist.
- InvalidPriority: If the specified priority class is not valid.
- PermissionDenied: If the tool lacks the permissions to modify the priority of the process.
5. suspend
Description
Suspends all threads of a given process.
Usage
ProcHandle.exe suspend <proc_name>
Arguments
<proc_name>
(string): The Process name that u want to suspend.
Returns
- Confirmation message indicating if the process was successfully suspended.
Exceptions
- InvalidPID: If the provided PID does not exist.
- PermissionDenied: If the tool does not have permissions to suspend the process.
6. resume
Description
Resumes a suspended process.
Usage
ProcHandle.exe resume <proc_name>
Arguments
<Proc_name>
(string): The Process name that you want to resume.
Returns
- Confirmation message indicating if the process was successfully resumed.
Exceptions
- InvalidPID: If the provided PID does not exist.
- ProcessNotSuspended: If the specified process is not in a suspended state.
7. read-memory
Description
Reads a specific memory address of a given process.
Usage
ProcHandle.exe read-memory <proc_name> <address> <size>
Arguments
<proc_name>
(string): The Process name of the target process.<address>
(hexadecimal): The memory address to read.<size>
(integer): The number of bytes to read.
Returns
- The content of the memory at the specified address.
Exceptions
- InvalidPID: If the provided PID does not exist.
- InvalidAddress: If the provided address is not valid.
- PermissionDenied: If the tool lacks permissions to read the memory of the process.
8. write-memory
Description
Writes data to a specific memory address of a process.
Usage
ProcHandle.exe write-memory <proc_name> <address> <data>
Arguments
<proc_name>
(string): The process name of the target process.<address>
(hexadecimal): The memory address to write to.<data>
(string): The data to write at the specified address.
Returns
- Confirmation message indicating if the data was successfully written.
Exceptions
- InvalidPID: If the provided PID does not exist.
- InvalidAddress: If the provided address is not valid.
- PermissionDenied: If the tool lacks permissions to write to the memory of the process.
9. protect
Description
Protect address of the specified process with a specific permission
Usage
protect <process_name> <lpAddress> <dwSize> <flNewProtect>
Arguments
<process_name>
(string): The name of the target process whose memory permissions you want to modify.<lpAddress>
(hexadecimal): The memory address of the region that will be protected.<dwSize>
(int): The size (in bytes) of the memory region that you want to protect.<flNewProtect>
(string or integer): The new protection level for the specified memory region. This parameter should be provided as a valid memory protection constant, such asPAGE_READONLY
,PAGE_READWRITE
,PAGE_EXECUTE
, etc.
Returns
- A confirmation message indicating if the memory protection was successfully changed. If successful, it shows that the specified address was modified with the new permissions.
Exceptions
- InvalidPID: Raised when the process ID for the given process name does not exist.
- InvalidAddress: Raised when the provided address is not valid within the memory space of the process.
- PermissionDenied: Raised if the tool lacks permissions to modify the memory of the target process. This usually occurs if the script is not run with sufficient privileges (e.g., administrator rights).
9. connection
Description
Show the connection on ur local machine
Arguments
None
Returns
- The list of current connection
Exceptions
- PermissionDenied: Raised if the tool lacks permissions to show the connection. This usually occurs if the script is not run with sufficient privileges (e.g., administrator rights).
Example Usage
Here are some examples of how to use the tool:
-
List all running processes:
ProcHandle.exe list
-
Get information about a specific process:
ProcHandle.exe info code
-
Terminate a process:
ProcHandle.exe terminate code
-
Change the priority of a process:
ProcHandle.exe set-priority code high
-
Suspend a process:
ProcHandle.exe suspend code
-
Resume a suspended process:
ProcHandle.exe resume code
-
Read memory from a process:
ProcHandle.exe read-memory code 0x00400000 256
-
Write data to a process's memory:
ProcHandle.exe write-memory code 0x00400000 "Hello World"
-
Protect an address region:
ProcHandle.exe protect code 0x7ffdf000 4096 PAGE_READWRITE
-
Show the conncetion:
connection
FINALLY
This tool is a powerful command-line utility for managing processes in a Windows environment. It is essential to run it with appropriate permissions to access or modify processes successfully. Use the help
command to see all available commands and their descriptions.
Documentation
¶
There is no documentation for this package.