Help IM-RP autolitefoot.ahk not working help me guyz

Rydersmoke

New member
Joined
Jul 21, 2023
Messages
2
Reaction score
0
; Function to get the process ID of a specified process by its name
getPID(processName) {
Process, Exist, % processName ; Ensure the processName is passed correctly
return ErrorLevel ; Returns the process ID if found, 0 otherwise
}

; Function to check if the game is running via the IMRP Launcher
isLaunchedFromIMRPLauncher() {
; Check if the IMRP Launcher is running (look for 'imrp-launcher.exe')
Process, Exist, imrp-launcher.exe
if (ErrorLevel) {
MsgBox, IMRP Launcher is running.
return true
}
MsgBox, IMRP Launcher is not running.
return false
}

; Function to open a handle to the specified process
openProcess(pid) {
; Correcting the parameter for OpenProcess.
; Access rights are 0x1F0FFF, and we set the second parameter to 0.
return DllCall("OpenProcess", "UInt", 0x1F0FFF, "Int", 0, "UInt", pid, "Ptr")
}

; Function to clean up and close the process handle
closeProcess(hProcess) {
return DllCall("CloseHandle", "Ptr", hProcess)
}

; Main script initialization
if (isLaunchedFromIMRPLauncher()) {
; Proceed if IMRP Launcher is running
global newPID := getPID("GTA:SA:MP")
if (newPID) {
MsgBox, GTA:SA:MP process found.
global hGTA := openProcess(newPID)
} else {
MsgBox, IMRP GTA must be started through the IMRP Launcher
ExitApp
}

; Additional memory operations or cleanup if needed
freeMemory:
if (pMemory) {
virtualFreeEx(hGTA, pMemory, 0, 0x8000)
}
if (hGTA) {
closeProcess(hGTA)
}
ExitApp
} else {
MsgBox, IMRP GTA must be started through the IMRP Launcher.
ExitApp
}

; Allocate memory in the target process
virtualAllocEx(hProcess, size, allocationType, protect) {
return DllCall("VirtualAllocEx", "Ptr", hProcess, "Ptr", 0, "UInt", size, "UInt", allocationType, "UInt", protect, "Ptr")
}

; Free allocated memory in the target process
virtualFreeEx(hProcess, lpAddress, size, freeType) {
return DllCall("VirtualFreeEx", "Ptr", hProcess, "Ptr", lpAddress, "UInt", size, "UInt", freeType)
}
 

Attachments

  • Screenshot (109).png
    Screenshot (109).png
    3.2 KB · Views: 11
  • Screenshot (108).png
    Screenshot (108).png
    2.6 KB · Views: 11
Top