Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[ANDROID] CLEO ANDROID


Alexander Blade
 Share

Recommended Posts

Alexander Blade

CLEO ANDROID


Version: 2.0.1
Date: Apr 2021


Description
CLEO ANDROID (further forward C/A) is a mobile version of the top-most popular GTA PC version add-on - CLEO library, which enhances game's script engine with ability to load custom scripts. Use cheats, spawn cars and use lots of cool features, especially considering how many content was written for C/A since the initial release back in late 2013! To be precise this is already more than a mobile version, since now C/A covers all RW based GTA games, including PSP versions of LCS and VCS via PPSSPP, which runs on many platforms.

 

Changes in 2.0.1
- support for Android 7 to 11
- support for III v1.8, VC v1.09, SA v2.00
- works with LCS now too, supports v2.2 and v2.4
- the library has been ported to PSP, supports both LCS and VCS
- added touch based gui for menu
- added file swap feature
- added support for plugins
- scripts are loaded from %sdcard%/cleo/%game% folder now


How to report an issue
- Make sure you looked into the Requirements section below first
- Don't quote this post, just put your message in the topic
- Describe when an issue is appearing, is this at start or already after loading screens
- Provide your Android OS version
- Provide your game version
- Provide %sdcard%/cleo/cleo.log contents

Requirements
- Android 4.1 to 11
- Android game series require root access (su installed, magisk/supersu) for the app to function properly
- PSP game series require PPSSPP 1.11.2 or higher (any platform), on Android root is not required (yet)


Supported game versions
- Android game series
  III v1.4 to v1.8
  VC v1.03 to v1.09
  SA v1.00 to v2.00
  LCS v2.2 and v2.4
- PSP game series
  LCS ULES00151/ULES00182/ULUS10041 (all builds, meaning v1.05 to v3.00)
  VCS ULES00502/ULES00503/ULUS10160 (all builds, meaning v1.02 to v1.03)
 
Installation
- make sure your device software is meeting the requirements above
- download and install the apk
- if apk doesn't get installed then enable installation from unknown sources in Android settings
- launch the app, give root and storage access if requests are promted
- select an appropriate page for the game you want to get CLEO installed into
- if the app can detect the game you will see normal [Install] button, if not then the button will be crossed out
- press [Install] in order to install the library, you will see the message with installation result shortly
- if library installation succeed then you can [Install scripts] and deal with installed using [Manage scripts]
- after rebooting your device you might need to install the library again, not the scripts
- the game has to have storage access permission in Android settings, otherwise the only working thing will be the menu
* CLEO for PPSSPP notes
- instead of the game the app will try to find main folder of the emulator, usually this is %sdcard%/PSP
- device reboot can't affect the library installation state
- you can install C/A and the scripts manualy without using the app


Scripts
C/A is using *.csa and *.csi script extensions, *.csa scripts start just after the game loads and *.csi ones only when you directly invoke them via ingame script menu. To open the menu perform a slide from screen top to bottom thru center, arrow popup at start should give a tip, this one is related to the mobile game series only. In order to open the menu on PSP press [start] and instead of showing standard game pause screen you will see cleo menu, pause screen still can be accessed if you hold [start] for a few seconds.

In order to install scripts manually you have to copy them in %sdcard%/cleo/%game%, where %sdcard% is your Android system's external storage, and the %game% is "iii", "vc", "sa" or "lcs". If you don't know where exactly this path is located then install some script using the app and look for "cleo" folder on your device. If you want to manually install scripts for the emu version of the game then the folder to put scripts is %sdcard%/PSP/PLUGINS/cleo/%game% where the %game% is either "lcs" or "vcs".


Plugins
C/A supports custom plugins (*.so, *.prx), if you just want to install C/A plugin then copy the thing in the same folder you would put *.csa/csi script (%game% folder). See developers section if you want to know more about this.


File swap
This feature is available only for Android game series. Allows to replace files without the need of cache/package repacking. The base folder for your files is %game%, just as with scripts. E.g. if you want to replace data/handling.cfg then you have to extract original file and then place the file into %game% folder as %game%/data/handling.cfg maintaining the same directory structure.

Download
http://www.dev-c.com/misc/cleo-android/


Developers

Scripts
A lot of PC CLEO *.cs scripts must be manually rewritten before they can be used with C/A since *.cs scripts use PC opcodes and PC oriented controls. C/A is using *.csa and *.csi script extensions, which internally are the same as PC *.cs scripts, while *.csa scripts start when the game loads and *.csi when user directly invokes a script using the menu.


The name which appears in the menu is a decorated version of an original script file name - game prefix gets cleaned out (e.g. "gtasa."), extension is removed too (".csi"), dots and underlines get replaced with spaces. For instance "gtasa.car_spawner.csi" will appear in the menu as "car spawner".


You can compile and decompile C/A scripts with Sanny Builder, in order to do so add the list of C/A opcode declarations in the corresponding SCM.INI file:
; CLEO ANDROID
0DD0=2,%1d% = get_label_addr %2p%
0DD1=2,%1d% = get_func_addr_by_cstr_name %2d%
0DD2=1,context_call_func %1d% ; deprecated, use 0DDE instead
0DD3=2,context_set_reg %1d% value %2d% ; deprecated, use 0DDE instead
0DD4=2,%1d% = context_get_reg %2d% ; deprecated, use 0DDE instead
0DD5=1,%1d% = get_platform
0DD6=1,%1d% = get_game_version
0DD7=1,%1d% = get_image_base
0DD8=4,%1d% = read_mem_addr %2d% size %3d% add_ib %4d%
0DD9=5,write_mem_addr %1d% value %2d% size %3d% add_ib %4d% protect %5d%
0DDA=3,%1d% = get_pattern_addr_cstr %2d% index %3d%
0DDB=3,get_game_ver_ex name_hash %1d% ver_hash %2d% ver_code %3d%
0DDC=2,set_mutex_var %1d% to %2d%
0DDD=2,%1d% = get_mutex_var %2d%
0DDE=-1, call_func %1d% add_ib %2d%
0DE0=3,%1d% = get_touch_point_state %2d% mintime %3d%
0DE1=5,%1d% = get_touch_slide_state from %2d% to %3d% mintime %4d% maxtime %5d%
0DE2=1,%1d% = get_menu_button_state
0DE3=2,%1d% = get_menu_button_pressed mintime %2d%
0DE4=2,%1d% = psp_get_control_state %2d%
0DE5=3,%1d% = psp_get_control_pressed %2d% mintime %3d%
0DF2=2,create_menu %1d% items %2d%
0DF3=0,delete_menu
0DF4=2,%1d% = get_menu_touched_item_index maxtime %2d%
0DF5=1,set_menu_active_item_index %1d%
0DF6=1,%1d% = get_menu_active_item_index
1000=-1, opcode_func


Example scripts compilation for LCS/VCS requires basic keyword definitions, if your current version of SB doesn't have these already defined then you have to define and add keywords.txt files manually:
- Open SB/data/modes.xml
- Find the mode with id="sa" and see how <keywords> are defined there
- Now find the mode with id="lcs"
- Define the keywords as <keywords>@sb:\data\lcs\keywords.txt</keywords>
- Do the same for id="vcs_psp" using <keywords>@sb:\data\vcs\keywords.txt</keywords>
- Create required keywords.txt files and put the respective definitions there


; keywords.txt for lcs
0001=wait
0002=goto
0002=jump
004d=jf
004e=end_thread
0050=gosub
0051=return
00db=if
03a9=thread


; keywords.txt for vcs
0001=wait
0002=goto
0002=jump
0022=jf
0023=end_thread
0025=gosub
0026=return
0078=if
0238=thread


Opcodes explained
>> 0DD0=2,%1d% = get_label_addr %2p%
>> 0DD1=2,%1d% = get_func_addr_by_cstr_name %2d%
These two are usually used together, first one gets real address of the target label where string or anything else is written and the second gets exported symbol name in the game's main library by C-style string name. It was done in the way like this (not using long strings) in order for opcode to be universal and also work with games which do not support long string type. When used with PSP game series 0DD1 will return 0.


>> 0DD2=1,context_call_func %1d%
>> 0DD3=2,context_set_reg %1d% value %2d%
>> 0DD4=2,%1d% = context_get_reg %2d%
Deprecated, use 0DDE instead.


>> 0DD5=1,%1d% = get_platform
Returns current platform: Android = 1, PSP = 2, primiraly used for LCS scripts.


>> 0DD6=1,%1d% = get_game_version
Returns internal game version, see sdk -> cleo.h -> eGameVerInternal for the details.


>> 0DD7=1,%1d% = get_image_base
Returns image base of the main game library.


>> 0DD8=4,%1d% = read_mem_addr %2d% size %3d% add_ib %4d%
>> 0DD9=5,write_mem_addr %1d% value %2d% size %3d% add_ib %4d% protect %5d%
Reads and writes memory, add_ib should be set only when raw address specified and it needs to be added to the imagebase in order to access needed memory location.


>> 0DDA=3,%1d% = get_pattern_addr_cstr %2d% index %3d%
Searches for the specified byte pattern in main library, if there are few addresses which match this pattern the index is used, see example scripts for the details. Works on both Android and PSP, the search if performed within all executable sections. Max length for the pattern is 32 bytes. Returns 0 if no pattern was found. The thing to keep in mind while using this on PSP - if you are searching for a function start bytes you have to mark first 4 as ?? since PPSSPP can override this for JIT purporses.


>> 0DDB=3,get_game_ver_ex name_hash %1d% ver_hash %2d% ver_code %3d%
Returns current game version:
* name_hash is a jenkins hash of an Android package name, on PSP not a hash while an integer part of a title id
* ver_hash is always a jenkins hash of version string, both platforms have this thing
* ver_code is a package version code on Android, on PSP this is a WORD where lower byte is a minor version and higher is a major version of a title.


>> 0DDC=2,set_mutex_var %1d% to %2d%
>> 0DDD=2,%1d% = get_mutex_var %2d%
Mutex vars are being used as global variables between scripts, mutex id can be any integer value, for example all scripts that use GUI use mutex variable with id 0 which indicates the state of anything being onscreen, if it's value is 0 then script can show GUI, if script is about to show GUI then it sets this var to 1. If mutex variable isn't set then 0 is returned.


>> 0DDE=-1, call_func %1d% add_ib %2d%
Calls a game function using specified address, if add_ib is set to 1 then adds an imagebase. Pairs of ['type', value] follow and indicate with which result type and params this function must be called. Specifying result is optional, just as specifing params if function has none.
Type can be one of these:
'i' - integer param
'f' - float param
'ref' - passes a reference to a variable as param
'resi' - result of integer type
'resf' - result of float type

Let's look how this one works on a simple example:
0DDE: call_func [email protected] add_ib 0 __result 'resi' [email protected] __pad_index 'i' 0
Here we are performing a call to a function which absolute address is stored in [email protected], this is why we don't need to add an imagebase here, so add_ib is set to 0, this function returns integer which get's stored in [email protected] and takes one integer param which is set to 0, can be a variable instead if required.


>> 0DE0=3,%1d% = get_touch_point_state %2d% mintime %3d%
>> 0DE1=5,%1d% = get_touch_slide_state from %2d% to %3d% mintime %4d% maxtime %5d%
Returns result of the requested touch action check, can be 0 or 1. On PSP always returns 0. Touch points is the C/A engine implemented touch detection system which divides touchscreen into 9 parts called touch points, they can be used to detect timed slides and touches.
Touch point ids: https://funkyimg.com/i/EC3B.jpg
 

>> 0DE2=1,%1d% = get_menu_button_state
>> 0DE3=2,%1d% = get_menu_button_pressed mintime %2d%
Returns state of the Android hardware menu button, can be 0 or 1, a lot of devices have no button like this. On PSP always returns 0.


>> 0DE4=2,%1d% = psp_get_control_state %2d%
>> 0DE5=3,%1d% = psp_get_control_pressed %2d% mintime %3d%
Returns state of the PSP control, can be 0 or 1. On Android always returns 0.
enum ePspControl {
    SELECT = 0, UP, RIGHT, DOWN, LEFT, LTRIGGER, RTRIGGER,
    TRIANGLE, CIRCLE, CROSS, SQUARE, HOLD,
    STICK_UP, STICK_DOWN, STICK_RIGHT, STICK_LEFT
}


>> 0DF2=2,create_menu %1d% items %2d%
Creates the menu gui which handles most of the things like drawing and input automatically. With first param being a label like @menu_desc where you describe the menu and second param indicating menu item count, can be set to a higher value than actual items if the menu has last item described as 00 byte. On Android the menu is touch based while on PSP uses controls. To get the point see the example scripts.
Menu flags go as following:
enum eMenuFlags {
    // item names are considered being gxt/fxt entries, if no such entry exists then
    // item name is the name which will be displayed in the menu
    USE_GXT     = 1 << 0,    
    
    // if gxt/fxt entry won't fit the menu bounds then text will be end-trimmed,
    // sizes: III, VC, SA = 20, LCS = 18, VCS = 19
    TRIM_GXT = 1 << 1
}


>> 0DF3=0,delete_menu
Removes active menu.


>> 0DF4=2,%1d% = get_menu_touched_item_index maxtime %2d%
Returns 0-based menu touched item index if condition is met, on PSP returns selected item index which is the same, if no item was touched or selected then the result is -1, if menu has to be closed then the result is -2.


>> 0DF5=1,set_menu_active_item_index %1d%
>> 0DF6=1,%1d% = get_menu_active_item_index
Gets and sets active menu index with scrolling menu pages if necessary, on Android this involves only menu pages while on PSP also sets last active item on the corresponding page. Mostly used in order to pass menu states between different launches of the same *.csi script which uses a menu.


>> 1000=-1, opcode_func
Opcode function, see plugins section for the details.


Plugins
C/A provides an ability to load custom library plugins (*.so, *.prx) and implements the API which allows to add new opcodes for all games at once, i.e. using single code base. Additionally the API provides basic necessary abilities to simplify an access to the game internals, e.g. allows to perform arm/thumb/mips function hooking.

Plugins allow to add new opcodes just as to add opcode functions, which pretty much are name-based opcodes. In order to be called opcode functions are using single script opcode 1000. Name param which is the first param of the opcode is a long string for III/VC/SA, in LCS/VCS name is represented as a set of 8byte strings with trailing parentheses, the rest of the params rely on opcode function implementation. See plugin example for the details. In order to compile the example you have to use Android NDK, compilation for PSP requires the use of devkitPSP which is based on an opensource version of pspsdk (see devkitPSP_r16-1-win32).

 

Edited by Alexander Blade
Link to comment
Share on other sites

kostyanchik2009

In mobile GTA 3 - Cleo opcodes with the PC version work?

 

(В мобильной гта 3 - клео опкоды с ПК версии работают?)

Link to comment
Share on other sites

Alexander Blade

In mobile GTA 3 - Cleo opcodes with the PC version work?

 

(В мобильной гта 3 - клео опкоды с ПК версии работают?)

No , I wrote this in the first post .

Link to comment
Share on other sites

I just bought my tablet, and as far as i know, after getting root access i will lose the warranty, is there absolutely no way to install cleo without root? Btw, ability to load asi/cleo/so available with this?

Link to comment
Share on other sites

Alexander Blade

I just bought my tablet, and as far as i know, after getting root access i will lose the warranty, is there absolutely no way to install cleo without root? Btw, ability to load asi/cleo/so available with this?

I can make it load libraries , installing w/o root requires apk rebuilidng with patching libR1/libGTAVC and adding libcleo , I can send you the patched files .

Link to comment
Share on other sites

Well, would be great to have it as an option. I have it installed already:

b862afc39ad166e2fb86cf110b76a08d.jpg

Seems like health regeneration is working. I tried to activate car spawner, but unfortunately it doesn't work for me.

Link to comment
Share on other sites

Please without root :) I have a tablet too but there are no tutorials for rooting and I will lose my warranty :)

Link to comment
Share on other sites

Alexander Blade

Well, would be great to have it as an option. I have it installed already:

b862afc39ad166e2fb86cf110b76a08d.jpg

Seems like health regeneration is working. I tried to activate car spawner, but unfortunately it doesn't work for me.

 

It should , try to keep a touch for center-bottom and center-top atleast for 5 seconds .

Link to comment
Share on other sites

Alexander Blade

probably sensitivity related

Link to comment
Share on other sites

All PC cleo scripts must be manually checked for compatibility before using with Android version !

Any way to do it from the CLEO script itself? Like, script checking itself.

 

Also, probably pretty stupid question, but is it the same project Alien's been working on since a while? :p

Edited by SilentPL
Link to comment
Share on other sites

Alexander Blade

Nope , no autocheck is possible :)

Alien has nothing to do with any of my projects as much as I have nothing to do with his .

Link to comment
Share on other sites

Also a car mod installer for 3 will be cool because I use GTA 3 1.4 and there is obb format :)

Link to comment
Share on other sites

Alexander Blade

yup , I think that needed opcodes are:

- get game version

- get exported symbol addr

- r/w memory

Edited by Alexander Blade
Link to comment
Share on other sites

I'm moving my old gasoline mod for iOS to cleo, any idea how to create markers for gas stations?

I can't use

 

0570: $GAS_MARKER1 = create_icon_marker_and_sphere 33 at 61.6442 -1073.6099 9.9775 
because game can be saved in car, which will save those markers as well, and on another start script will create them again and it can't be good.

 

2936196e278cb9f7c7db05bef2ba8039.jpg

Edited by ThirteenAG
Link to comment
Share on other sites

Alexander Blade

will save those markers as well

Are you sure that marker will be saved , did you check ?

  • Like 1
Link to comment
Share on other sites

Yes, i checked twice, script removes them when player isn't in car, but when i exit while player in car, markers shown on the map even on foot after restart.

f298e912a1b66e4cd6a3aff0892d9966.jpg

Edited by ThirteenAG
Link to comment
Share on other sites

Alexander Blade

find some definitely unused global variables for

- one will indicate that markers are being shown

- marker handles

 

if first one is set when script starts then remove markers

Link to comment
Share on other sites

You win the internet with this one dude. Do you any plans on releasing this to XDA or the Play Store, too?

76561198000404928.png

Link to comment
Share on other sites

Alexander Blade

First we need SA , it will bring more users (and potential testers) here , I was planning on releasing this in playstore after . Regarding the XDA I don't really think that people need CLEO there .

Link to comment
Share on other sites

Alexander Blade

Awesome !! Is there going to be also an android version of Sanny Builder ?

Definitely not .

  • Like 2
Link to comment
Share on other sites

sharpie_eastern

Awesome !! Is there going to be also an android version of Sanny Builder ?

I thought Sanny Builder can already read mobile SCM's? Why would you want to use Sanny Builder on a phone?

Link to comment
Share on other sites

First we need SA , it will bring more users (and potential testers) here , I was planning on releasing this in playstore after . Regarding the XDA I don't really think that people need CLEO there .

Nah, they've been dabbling about modding the Android GTA releases in the forums ever since GTA3 was released.

 

Also, what about keyboard support, i.e. external ones or the Game Keyboard app?

76561198000404928.png

Link to comment
Share on other sites

 

Awesome !! Is there going to be also an android version of Sanny Builder ?

I thought Sanny Builder can already read mobile SCM's? Why would you want to use Sanny Builder on a phone?

 

While making scripts on a phone will be uncomfortable because of its size, some people might like to make scripts directly on their tablet.

Not me, because i have no good tablet that would support GTA games and i'd make a Sanny Builder for Android if I had one anyway.

 

A good example of IDE for Android is AIDE.

Edited by fastman92
Link to comment
Share on other sites

Well, besides patching the game to add CLEO support, do you have any plans to hack/bypass the texture resource limit in SA?

  • Like 1
76561198000404928.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.