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

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
indirivacua

[SA|CLEO] Lock your CLEO scripts

Recommended Posts

indirivacua

Many people been asking this (not really), so I made this tutorial of """how to encrypt/lock your cleo mods""", so nobody will can decompile it and read your super powerfull incredible piece of code! ;) (We going to call it SPIPOC since now).

 

This is a military grade encryption algorithm called XOR Crypt, and THE ONLY WAY to lock mods, nobody will can decrypt them, even if they read this topic will be impossible, you're safe 😤👌

 

First, compile your SPIPOC in SB with 'Add extra info to SCM' flag unchecked.

For example, I made this SPIPOC:

 

{$CLEO}
{$NOSOURCE} // wait, waht?

0AD1: show_formatted_text_highpriority "This is %.4X opcode" time 2000 0x0AD1
0A93: end_custom_thread

 

Then with some hex editor open your compiled .cs file and copy all the content of the file:

D1 0A 0E 13 54 68 69 73 20 69 73 20 25 2E 34 58 20 6F 70 63 6F 64 65 05 D0 07 05 D1 0A 00 93 0A

 

Then use this algorithm to get your code F U L L Y encrypted:

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define XORKEY 7 // This is your encryption key

int main()
{
	uint8_t arr[] = {0xD1, 0x0A, 0x0E, 0x13, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x25, 0x2E, 0x34, 0x58, 0x20, 0x6F, 0x70, 0x63, 0x6F, 0x64, 0x65, 0x05, 0xD0, 0x07, 0x05, 0xD1, 0x0A, 0x00, 0x93, 0x0A}; // Here should be the bytes of your code
	int length = sizeof(arr)/sizeof(uint8_t);
	printf("Lenght: %d\n", length);
	printf("Encrypted: \n");
	for (int i = 0; i < length; i++)
	{
		arr[i] = arr[i] ^ XORKEY;
		printf("%02X ",arr[i]);
	}
	return 0;
}

/* 	
	Output:
	
	Lenght: 32
	Encrypted:
	D6 0D 09 14 53 6F 6E 74 27 6E 74 27 22 29 33 5F 27 68 77 64 68 63 62 02 D7 00 02 D6 0D 07 94 0D
*/

 

Then copy the thing of the thing you got from the thing above and paste it into the hex dump:

{$CLEO}
{$NOSOURCE} // Again? :(

const
    key = 2@
end

key = 7 // Your key, big boy

0AC6: 0@ = label @label offset
for 3@ = 0x00 to 0x1F // 32-1 = 31, yei, we know maths, btw, 1F=31, and yeah, you can use decimal system, but c'mon, hex makes you look cool, right? right???
    0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0
    0B12: 1@ = 1@ XOR key
    0A8C: write_memory 0@ size 1 value 1@ virtual_protect 0
    0@++
end

:label
hex
//HEEEEEERE
D6 0D 09 14 53 6F 6E 74 27 6E 74 27 22 29 33 5F 27 68 77 64 68 63 62 02 D7 00 02 D6 0D 07 94 0D
end

 

DONE, now you're a professional... hacker? whatever :yee:.

 

FAQ:

Are you being serious?

Nope :p

 

psst, read this boi

 

Everything has an history, right? I was sorting my bookmarks and one of them was a thread on this forum of "how to lock a cleo". I'm almost sure that I added it in 2015/2016, I was a non-open-source guy at that time, shame me. Three years ago I started university and most important, I started to learn why is better 'open sourcing'. So that's why I made this useful-unuseful funny tutorial :)

 

Andddd, in case you still don't get it, you can decrypt the script 'encrypted' by this method as the same way you encrypted it. With SB decompile it, copy all the content from the thread memory (hex...end) and paste into the array from the C code, you'll get the decrypted hex values, put them into a simply code like this one:

 

{$CLEO}

hex
//Here
end

And compile it without the 'Add extra info to SCM' flag checked. Voilà.

 

Btw, you need to understand you're not 'locking' anything, you're just confusing the decompiler. 

 

Maybe I'll update this topic with other ways to 'lock' (and unlock it, obviously) scripts in the future.

Edited by indirivacua
Huge grammatical errors. And some info about unlocking it.

Share this post


Link to post
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
Sign in to follow this  

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

×

Important Information

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