Yet another open world game where you can destroy everything you want… The perfect game for a boring sunday…
First up, you can remove the Island limitation easily with your favorite hex editor ( If you don’t have one, get Hex Workshop ), just open the JustCause2.exe with it and
Goto 03F206D
Change 75 to EB
Oh and you can disable the time limit… Still haven’t found a way for it in the exe… but… Cheat Engine to the rescue
- Load up The Game, Play a little bit, Press F1 to open the PDA and remember the time
- Alt+Tab into windows and start cheat engine, Select the game from process list
- Choose ‘Unknown initial value’ from the ‘Scan type‘ drop-down list, ’4 Bytes’, and hit the ‘First Scan’ button.
- Go in-game again, un-pause and let some time go by.
- Open the PDA, and check how many seconds have gone by.
- Alt-tab back to CheatEngine and search for a new value, this time a ‘Value increased by…’ , and enter the the time in seconds that passed. Then Hit ‘Next Scan’.
- Repeat, until you find your culprit.
- Double Click the value to add it in the list below and freeze it.
Click on Read More, for a quick script that does both and includes an inf. ammo trigger…
Well.. The script is now worthless… Since Steam updated the Demo. Click here for the newest patch (Time limit + map patch + health + ammo + multi rope)
;;================================================================================
;; Includes
;;================================================================================
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin
#NoTrayIcon
;;================================================================================
;; Globals
;;================================================================================
SetPrivilege("SeDebugPrivilege", 1)
Global $ProcessID = ProcessExists("JustCause2.exe")
If $ProcessID = 0 Then
MsgBox(4096, "Error", "No process found.")
Exit 1
EndIf
Global $MAPPATCH = 0
Global $TIMEPATCH = 1
Global $AMMOPATCH = 2
;;================================================================================
;; GUI
;;================================================================================
GUICreate("BOLOPatch", 149, 66, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER))
GUICtrlCreateLabel("Status:", 0, 0, 37, 17, $SS_CENTER)
GUICtrlCreateLabel("Coding by G&H Productions", 0, 48, 148, 17, BitOR($SS_CENTER,$SS_NOPREFIX), $WS_EX_CLIENTEDGE)
$status = GUICtrlCreateLabel("", 40, 0, 107, 17, $SS_CENTER, $WS_EX_CLIENTEDGE)
$time_box = GUICtrlCreateCheckbox("Inf. Time", 0, 24, 65, 17, -1, $WS_EX_CLIENTEDGE)
$ammo_box = GUICtrlCreateCheckbox("Inf. Ammo", 72, 24, 73, 17, -1, $WS_EX_CLIENTEDGE)
GUISetState()
;;================================================================================
;; Main
;;================================================================================
Patch($MAPPATCH)
CheckPatchStatus()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $time_box
If GUICtrlRead($time_box) = $GUI_CHECKED Then
Patch($TIMEPATCH)
Else
Patch($TIMEPATCH, 0)
EndIf
Case $ammo_box
If GUICtrlRead($ammo_box) = $GUI_CHECKED Then
Patch($AMMOPATCH)
Else
Patch($AMMOPATCH, 0)
EndIf
EndSwitch
WEnd
;;================================================================================
;; Patch
;;================================================================================
Func Patch($FLAG, $to_patch = 1)
$DLL = _MemoryOpen($ProcessID)
If @Error Then
MsgBox(4096, "Error", "Failed to open memory for process:" & $ProcessID)
Exit 1
EndIf
Switch $FLAG
Case $MAPPATCH
If _MemoryRead(0x007F2C95, $DLL, "byte") == 0x90 Then
GUICtrlSetData($status, "Map already patched!")
Else
_MemoryWrite(0x007F2C95, $DLL, 0x90, "byte");;;
_MemoryWrite(0x007F2C96, $DLL, 0x90, "byte");;;
_MemoryWrite(0x007F2C97, $DLL, 0x90, "byte");;; MAP LIMIT DISABLE
_MemoryWrite(0x007F2C98, $DLL, 0x90, "byte");;;
_MemoryWrite(0x007F2C99, $DLL, 0x90, "byte");;;
GUICtrlSetData($status, "Map limit patched.")
EndIf
Case $TIMEPATCH
Switch $to_patch
Case 1
_MemoryWrite(0x004FE17D, $DLL, 0x29, "byte");;; PATCH TIME
GUICtrlSetData($status, "Time patched.")
Case 0
_MemoryWrite(0x004FE17D, $DLL, 0x01, "byte");;; UNPATCH TIME
GUICtrlSetData($status, "Time unpatched.")
EndSwitch
Case $AMMOPATCH
Switch $to_patch
Case 1
_MemoryWrite(0x0053E831, $DLL, 0x00, "byte");;; PATCH AMMO
GUICtrlSetData($status, "Ammo patched.")
Case 0
_MemoryWrite(0x0053E831, $DLL, 0xff, "byte");;; UNPATCH AMMO
GUICtrlSetData($status, "Ammo unpatched.")
EndSwitch
EndSwitch
_MemoryClose($DLL)
EndFunc
;;================================================================================
;; CheckPatchStatus
;;================================================================================
Func CheckPatchStatus()
$DLL = _MemoryOpen($ProcessID)
If @Error Then
MsgBox(4096, "Error", "Failed to open memory for process:" & $ProcessID)
Exit 1
EndIf
If _MemoryRead(0x004FE17D, $DLL, "byte") == 0x29 Then
GUICtrlSetState($time_box, $GUI_CHECKED)
EndIf
If _MemoryRead(0x0053E831, $DLL, "byte") == 0x00 Then
GUICtrlSetState($ammo_box, $GUI_CHECKED)
EndIf
_MemoryClose($DLL)
EndFunc
;;================================================================================
;; NOMADMEMORY
;;================================================================================
Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)
If Not ProcessExists($iv_Pid) Then
SetError(1)
Return 0
EndIf
Local $ah_Handle[2] = [DllOpen('kernel32.dll')]
If @Error Then
SetError(2)
Return 0
EndIf
Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid)
If @Error Then
DllClose($ah_Handle[0])
SetError(3)
Return 0
EndIf
$ah_Handle[1] = $av_OpenProcess[0]
Return $ah_Handle
EndFunc
Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
Local $v_Buffer = DllStructCreate($sv_Type)
If @Error Then
SetError(@Error + 1)
Return 0
EndIf
DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
If Not @Error Then
Local $v_Value = DllStructGetData($v_Buffer, 1)
Return $v_Value
Else
SetError(6)
Return 0
EndIf
EndFunc
Func _MemoryWrite($iv_Address, $ah_Handle, $v_Data, $sv_Type = 'dword')
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
Local $v_Buffer = DllStructCreate($sv_Type)
If @Error Then
SetError(@Error + 1)
Return 0
Else
DllStructSetData($v_Buffer, 1, $v_Data)
If @Error Then
SetError(6)
Return 0
EndIf
EndIf
DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
If Not @Error Then
Return 1
Else
SetError(7)
Return 0
EndIf
EndFunc
Func _MemoryClose($ah_Handle)
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1])
If Not @Error Then
DllClose($ah_Handle[0])
Return 1
Else
DllClose($ah_Handle[0])
SetError(2)
Return 0
EndIf
EndFunc
Func SetPrivilege( $privilege, $bEnable )
Const $MY_TOKEN_ADJUST_PRIVILEGES = 0x0020
Const $MY_TOKEN_QUERY = 0x0008
Const $MY_SE_PRIVILEGE_ENABLED = 0x0002
Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv
$nTokens = 1
$LUID = DLLStructCreate("dword;int")
If IsArray($privilege) Then $nTokens = UBound($privilege)
$TOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
$NEWTOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
$hCurrProcess = DLLCall("kernel32.dll","hwnd","GetCurrentProcess")
$SP_auxret = DLLCall("advapi32.dll","int","OpenProcessToken","hwnd",$hCurrProcess[0], _
"int",BitOR($MY_TOKEN_ADJUST_PRIVILEGES,$MY_TOKEN_QUERY),"int*",0)
If $SP_auxret[0] Then
$hToken = $SP_auxret[3]
DLLStructSetData($TOKEN_PRIVILEGES,1,1)
$nTokenIndex = 1
While $nTokenIndex <= $nTokens
If IsArray($privilege) Then
$priv = $privilege[$nTokenIndex-1]
Else
$priv = $privilege
EndIf
$ret = DLLCall("advapi32.dll","int","LookupPrivilegeValue","str","","str",$priv, _
"ptr",DLLStructGetPtr($LUID))
If $ret[0] Then
If $bEnable Then
DLLStructSetData($TOKEN_PRIVILEGES,2,$MY_SE_PRIVILEGE_ENABLED,(3 * $nTokenIndex))
Else
DLLStructSetData($TOKEN_PRIVILEGES,2,0,(3 * $nTokenIndex))
EndIf
DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,1),(3 * ($nTokenIndex-1)) + 1)
DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,2),(3 * ($nTokenIndex-1)) + 2)
DLLStructSetData($LUID,1,0)
DLLStructSetData($LUID,2,0)
EndIf
$nTokenIndex += 1
WEnd
$ret = DLLCall("advapi32.dll","int","AdjustTokenPrivileges","hwnd",$hToken,"int",0, _
"ptr",DllStructGetPtr($TOKEN_PRIVILEGES),"int",DllStructGetSize($NEWTOKEN_PRIVILEGES), _
"ptr",DllStructGetPtr($NEWTOKEN_PRIVILEGES),"int*",0)
$f = DLLCall("kernel32.dll","int","GetLastError")
EndIf
$NEWTOKEN_PRIVILEGES=0
$TOKEN_PRIVILEGES=0
$LUID=0
If $SP_auxret[0] = 0 Then Return 0
$SP_auxret = DLLCall("kernel32.dll","int","CloseHandle","hwnd",$hToken)
If Not $ret[0] And Not $SP_auxret[0] Then Return 0
return $ret[0]
EndFunc
Via Facebunch Forums
Just Download AutoIT Paste it there and Compile it ; )
Bolo updated his patch, latest vers here (inf. Ammo, Health, Time)
hey thanks a lot!
Thank you kind Sir, for now I can enjoy the Demo to the Max !