Quantcast

Jump to content

» «
Photo

[CLEO] Full Nitro Control

10 replies to this topic
Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown

#1

Posted 31 December 2011 - 02:01 PM Edited by Wesser, 22 January 2012 - 12:09 PM.

Full Nitro Control
A cleo modification for GTA San Andreas

1. What does this mod do?
This cleo modification allows to control the nitro consuming as you like. By default, you must use the whole nitro gas and wait until it is empty before filling up completely. That's too much research and time spending, don't you think? turn.gif

2. What bugs were found?
No bugs has been found till now. Feel free to notify them.

3. How can I decompile the script?
You can't decompile it because it is coded mostly in ASM, so the decompiler won't recognize unexisting opcodes. Anyway, it is open source.

4. Can I use it in my mod?
I'd be glad to see this making part of your mod. Do not forget to ask for permission, though.

5. Where are the screenshots, please?
They're included in the archive.

6. Where's the download link?
The mod is available here to download. Readme included.

If you have comments, opinions or evaluation you are welcome. For further information, look at the readme.
  • Adrian28 likes this

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#2

Posted 31 December 2011 - 02:30 PM

I remember seeing parts of this code some time ago, and it MUST be cool. Good work icon14.gif

It would be nice to see an ASI version of it though.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#3

Posted 31 December 2011 - 02:34 PM

user posted image

It works, but seemingly you forgot to remove centered number at the bottom.
I wouldn`t prefer doing like this:
CODE
0@ += 0x34
0AB1: call_scm_func @setMemOffset 3 memory 0@ pointing_to 0x53FF90 virtual_protect 0 // CPad__firePressed
0@ += 0x10

To set pointers, but rather:
CODE
:readCheatStrings_push_EmptyStringAddress
hex
00 00 00 00

E8              // call     _chdirProgramDir
end

:readCheatStrings_call_chdirProgramDirAddress
hex
00 00 00 00

68              // push     offset "rb"  
end

:readCheatStrings_push_offset_rb_mode_offset
hex
00 00 00 00

// stack: -0x14

FF 74 24    50  // push     [esp+50]  ; push [filepath]

E8
end


And:
CODE
0AB1: call_scm_func @asm_PutOnLabelAbsoluteAddressToLabel 3 script_content 1@ source_label @readCheatStrings_push_EmptyStringAddress destination @EmptyString

0AB1: call_scm_func @GetAddress_chdirProgramDir 0 store_address_to 2@
0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToAddress 4 script_content 1@ source_label @readCheatStrings_call_chdirProgramDirAddress source_size 4 destination 2@

0AB1: call_scm_func @asm_PutOnLabelAbsoluteAddressToLabel 3 script_content 1@ source_label @readCheatStrings_push_offset_rb_mode_offset destination @RB_mode

0AB1: call_scm_func @GetAddress_CFileMgr__Open 0 store_address_to 2@
0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToAddress 4 script_content 1@ source_label @readCheatStrings_call_CFileMgr__OpenAddress source_size 4 destination 2@

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown

#4

Posted 31 December 2011 - 03:22 PM

Silent, thanks for your feedback. I posted the source code at GTAG and I was unsure whether to release it or not. By the way, I'm still using VC2003 because of school (no more right now), by which I'm not able to call internal .exe functions for unknown reasons. The game always crash. confused.gif

fastman, thank you too. I forgot to remove a little debugging code. I updated the first post. However, I didn't understand what you're saying. You have to be more clear. wink.gif

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#5

Posted 31 December 2011 - 03:36 PM Edited by fastman92, 31 December 2011 - 03:39 PM.

There is 0@ to store position and you wrote code to add movement to it as many bytes as number of bytes to next relative offset.
I wouldn`t prefer adding it manually, but rather split places where offsets should be placed into label chunks:
CODE
:readCheatStrings
// void __cdecl readCheatStrings(char* filename, void * _cheatStringHashes)

{
Stack:
-38h -   int cheatID
-34h -   char * cheatString [34]
0h  -   void * return_address
4h  -   char * filename
8h  -   void * _cheatStringHashes
}
hex
// stack: +0x0

83 EC   38      // sub      esp, 38h
51              // push     ecx
53              // push     ebx
56              // push     esi

68              // push     EmptyString
end

:readCheatStrings_push_EmptyStringAddress
hex
00 00 00 00

E8              // call     _chdirProgramDir
end

:readCheatStrings_call_chdirProgramDirAddress
hex
00 00 00 00

68              // push     offset "rb"  
end

:readCheatStrings_push_offset_rb_mode_offset
hex
00 00 00 00

// stack: -0x14

FF 74 24    50  // push     [esp+50]  ; push [filepath]

E8
end

:readCheatStrings_call_CFileMgr__OpenAddress
hex
00 00 00 00

83 C4   0C      // add      esp, 0Ch

8B F0           // mov      esi, eax        ( eax = FILE* )

85 F6           // test     esi, esi      ; is file correctly opened

0F 84           // jz       @@return
end


To put offset on particular label i`m using my functions:
CODE
0AB1: call_scm_func @Get_EXE_version_ID 0 get_version_number_to 0@
0AB1: call_scm_func @getScriptContentPointer 0 store_script_content 1@

0AB1: call_scm_func @asm_PutOnLabelAbsoluteAddressToLabel 3 script_content 1@ source_label @readCheatStrings_push_EmptyStringAddress destination @EmptyString

0AB1: call_scm_func @GetAddress_chdirProgramDir 0 store_address_to 2@
0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToAddress 4 script_content 1@ source_label @readCheatStrings_call_chdirProgramDirAddress source_size 4 destination 2@

0AB1: call_scm_func @asm_PutOnLabelAbsoluteAddressToLabel 3 script_content 1@ source_label @readCheatStrings_push_offset_rb_mode_offset destination @RB_mode

0AB1: call_scm_func @GetAddress_CFileMgr__Open 0 store_address_to 2@
0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToAddress 4 script_content 1@ source_label @readCheatStrings_call_CFileMgr__OpenAddress source_size 4 destination 2@

0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToLabel 4 script_content 1@ source_label @readCheatStrings_jz_returnAddress source_size 4 destination @readCheatStrings_return

That`s how i avoid manual calculation of pointer to relative address.

My functions from asm_handling.txt
CODE
:asm_PutOnAddressRelativeAddressToAddress
{
Description:
   Writes at the specified address a relative adress to second adress.
Type: SET
 
Parameters:
  Passed:
    0@ - source adress
    1@ - size of written adress (1, 2, 4)
    2@ - source virtual protect
    3@ - destination adress
   

Example:
 0AB1: call_scm_func @asm_PutOnAddressRelativeAddressToAddress 4 source_adress 2@ source_size 4 source_virtual_protect true destination 0x004912DC    
}
0062: 3@ -= 0@  // (int)
0062: 3@ -= 1@  // (int)
0A8C: write_memory 0@ size 1@ value 3@ virtual_protect 2@
0AB2: ret 0

:asm_PutOnAddressRelativeAddressToLabel
{
Description:
   Writes at the specified adress a relative adress to second adress.
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)
    1@ - source adress
    2@ - size of written adress (1, 2, 4)
    3@ - source virtual protect
    4@ - destination label
   

Example:
 0AB1: call_scm_func @asm_PutOnAddressRelativeAddressToLabel 5 script_content 1@ source_adress 2@ source_size 4 source_virtual_protect true destination @label    
}
0062: 0@ -= 4@  // (int)    // destination: label adress
0062: 0@ -= 1@  // (int)

0062: 0@ -= 2@  // (int)
                                   
0A8C: write_memory 1@ size 2@ value 0@ virtual_protect 3@
0AB2: ret 0

:asm_PutOnLabelRelativeAddressToAddress
{
Description:
   Writes at the specified label a relative adress to second adress.
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)  
    1@ - source label
    2@ - size of written adress (1, 2, 4)
    3@ - destination adress    

Example:
 0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToAddress 4 script_content 0@ source_label @function_adress source_size 4 destination 0x004912DC    
}
0062: 0@ -= 1@  // (int)
0062: 3@ -= 0@  // (int)
0062: 3@ -= 2@  // (int)
0A8C: write_memory 0@ size 2@ value 3@ virtual_protect false
0AB2: ret 0

:asm_PutOnLabelRelativeAddressToLabel
{
Description:
   Writes at the specified label a relative adress to second label.
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)  
    1@ - source label
    2@ - size of written adress (1, 2, 4)
    3@ - destination label    

Example:
 0AB1: call_scm_func @asm_PutOnLabelRelativeAddressToLabel 4 script_content 0@ source_label @function_source source_size 4 destination @function_destination    
}
0062: 0@ -= 1@  // (int)    // source adress
0062: 1@ -= 3@  // (int)    // difference
0062: 1@ -= 2@  // (int)    // -= size

0A8C: write_memory 0@ size 2@ value 1@ virtual_protect false
0AB2: ret 0

:asm_PutOnAddressAbsoluteAddressToAddress
:asm_PutOnAddressAnyValue
{
Description:
   Writes at the specified adress any adress/value
Type: SET
 
Parameters:
  Passed:
    0@ - source adress
    1@ - size of written adress (1, 2, 4)
    2@ - source virtual protect
    3@ - destination adress
   

Example:
 0AB1: call_scm_func @asm_PutOnAddressAbsoluteAddressToAddress 4 source_adress 2@ source_size 4 source_virtual_protect true destination 0x004912DC    
}
0A8C: write_memory 0@ size 1@ value 3@ virtual_protect 2@
0AB2: ret 0

:asm_PutOnAddressAbsoluteAddressToLabel
{
Description:
   Writes at the specified adress an absolute adress to label.
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)  
    1@ - source adress
    2@ - source virtual protect
    3@ - destination label    

Example:
 0AB1: call_scm_func @asm_PutOnAddressAbsoluteAddressToLabel 4 script_content 0@ source_adress 0x466D44 source_virtual_protect true destination @function_destination    
}
0062: 0@ -= 3@  // (int)    // destination adress
0A8C: write_memory 1@ size 4 value 0@ virtual_protect 2@
0AB2: ret 0

:asm_PutOnLabelAbsoluteAddressToLabel
{
Description:
   Writes at the specified label an absolute adress to label.
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)  
    1@ - source label
    2@ - destination label    

Example:
 0AB1: call_scm_func @asm_PutOnLabelAbsoluteAddressToLabel 3 script_content 0@ source_label @function_source destination @function_destination    
}
0A8F: 2@ = 0@ - 2@ // int   // destination adress
0062: 0@ -= 1@  // (int)    // source adress
0A8C: write_memory 0@ size 4 value 2@ virtual_protect false
0AB2: ret 0

:asm_PutOnLabelAbsoluteAddressToAddress
:asm_PutOnLabelAnyValue
{
Description:
   Writes at the specified label an absolute adress to second adress.
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)  
    1@ - source label
    2@ - size of written adress (1, 2, 4)
    3@ - destination adress    

Example:
 0AB1: call_scm_func @asm_PutOnLabelAbsoluteAddressToAddress 4 script_content 0@ source_label @function_source source_size 4 destination 0x400000    
}
0062: 0@ -= 1@  // (int)    // source adress
0A8C: write_memory 0@ size 2@ value 3@ virtual_protect false
0AB2: ret 0

:asm_GetStructOffsetLabeltoLabel
{
Description:
   Calculates offset between first and second lable
Type: SET
 
Parameters:
  Passed:
    0@ - first label
    1@ - second label

Example:
 0AB1: call_scm_func @asm_GetStructOffsetLabeltoLabel 2 base_label @vehicles second_label @vehicles_properties store_offset 5@
}
0062: 0@ -= 1@  // (int)  
0AB2: ret 1 0@

:asm_PutOnAddressJmpFarToLabel
{
Description:
   Writes at the specified label ASM jmp far with relative address to label (0xE9 + relative address)
Type: SET
 
Parameters:
  Passed:
    0@ - adress of script content (current_thread_pointer + 0x10)  
    1@ - source address
    2@ - source virtual protect
    3@ - destination label    

Example:
 0AB1: call_scm_func @asm_PutOnAddressJmpFarToLabel 4 script_content 0@ source_address 2@ source_virtual_protect true destination @function_destination    
}
0062: 0@ -= 3@  // (int)    // destination adress
0A8C: write_memory 1@ size 1 value 0xE9 virtual_protect 2@
1@ += 1
0062: 0@ -= 1@  // (int)    // difference
0@ -= 4
0A8C: write_memory 1@ size 4 value 0@ virtual_protect 2@
0AB2: ret 0


BTW. My nickname is fastman92, not fastman

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown

#6

Posted 31 December 2011 - 04:51 PM

Ok, now I realized the meaning of your last post. I wouldn't prefer such structure because it'll break the code understanding.
QUOTE (fastman92 @ Saturday, Dec 31 2011, 16:36)
BTW. My nickname is fastman92, not fastman.

I know, but someone call me Wes, so... tounge2.gif

Anyways, this is the Mod Showroom section. You had to pm me instead. confused.gif

P.S. Why the profile says your birth year is '95? You said you were a lot older.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#7

Posted 31 December 2011 - 04:54 PM

QUOTE (Wesser @ Saturday, Dec 31 2011, 17:51)
P.S. Why the profile says your birth year is '95? You said you were a lot older.

When i said that?
Number 92 in nickname doesn`t determine how old i am.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#8

Posted 31 December 2011 - 05:12 PM

QUOTE (fastman92 @ Saturday, Dec 31 2011, 18:54)
QUOTE (Wesser @ Saturday, Dec 31 2011, 17:51)
P.S. Why the profile says your birth year is '95? You said you were a lot older.

When i said that?
Number 92 in nickname doesn`t determine how old i am.

Agreed with that one. Some people think I'm born in '98 due to having 8 in my nick sometimes... sigh.gif


But, great mod, no bugs, no crashes, Wesser's quality. I like it! icon14.gif

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#9

Posted 31 December 2011 - 05:38 PM

Sadly it doesn't work with Compact EXE, but it does work in VCS PC smile.gif

user posted image

I think it's actually one of few CLEOs not made by me that will stay in my SA installation. Awesome icon14.gif

Edit:
Thanks to this thing, I think I'll actually make camera shake like hell with nitro on (VCS has cam shake instead of blur). Nitro will be absent in VCS PC, but screw it. I want it.

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown

#10

Posted 31 December 2011 - 06:24 PM

oksa8, thank you aswell. Your posts are always constructive. icon14.gif

Silent, this time I preferred to follow R*'s style. It can be seen has a feature that R* hided before realising the game.

QUOTE (fastman92 @ Saturday, Dec 31 2011, 17:54)
QUOTE (Wesser @ Saturday, Dec 31 2011, 17:51)
P.S. Why the profile says your birth year is '95? You said you were a lot older.

When i said that? Number 92 in nickname doesn`t determine how old I am.

In fact I said "a lot older". I remember something you said in chat. Maybe I'm confusing you with someone else. It isn't important, though. wink.gif

hanslukaas
  • hanslukaas

    Player Hater

  • Members
  • Joined: 12 Jul 2013

#11

Posted 15 July 2013 - 07:28 AM

A BIG THANK YOU FOR THIS AWESOME CLEO MOD icon14.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users