GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Sun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Thu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Thu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Thu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Sat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Fri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Fri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Tue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Mon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail, и я добавлю его в список. Приветствуются скрипты, которые не встречаются на других сайтах ... Спасибо. ))))


----- English -----

If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))

Log in

I forgot my password



December 2016
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar


You are not connected. Please login or register

Sub-Memory Routines

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Sub-Memory Routines on Wed Mar 04, 2009 7:47 am

Description


I wanted to post a topic, giving examples on sub-memory routines.
There is many ways in San Andreas, what is the most common? Perhaps it's the via arrays sub-memory routine. Thus, we have three ways to handle the game memory. (For more information of the others, read this topic by Seemann). Wink
Well, now, this is for San Andreas v1.0 US, and may-be the German version. If you find something un-working, then consider changing your EXE version, original v1.0 US, would therefore be beneficial.


SA arrays routine


Using the SA arrays to get an access to any addresses in range of 0..FFFFFFFF. The array indexes can contain 32-bit integer values that gives us an access to ANY in-game address in ranges 0x00000000..0xFFFFFFFF. This way all game addresses are accessible, some of addresses still may not be rewritable, (because of AccessViolation Error), which Sanny will give.

Code:


// 0@ -address
// 2@ -new value
// 3@ -length (in bytes)
//--write specified number of bytes into memory

:MemoryWrite 
0085: 5@ = 0@
0@ /= 4
0@ *= 4          // memory address
0062: 5@ -= 0@    // offset (0, 1, 2, 3) 
:_GetInitValue      // if you specify mem offset in 5@, you're able to gosub here
gosub @MemoryRead // get initial value
3@ *= 8 // bytes -> bits
5@ *= 8
dec(3@)
for 6@ = 0 to 3@
  if
    08B6: test 2@ bit 6@
  then
    08BF: set 1@ bit 5@    // 1
  else
    08C5: clear 1@ bit 5@  // 0
  end
  inc(5@) // next memory bit
end   
008A: &0(0@,1i) = 1@  // write new value
return


//--write 32-bit value into memory-----------

:MemoryWrite32bit
0@ -= 0xA49960
0@ /= 4
008A: &0(0@,1i) = 1@ 
return

//--read 32-bit value from memory-----------

:MemoryRead
0@ -= 0xA49960
0@ /= 4
008B: 1@ = &0(0@,1i)
return



Examples



Here are some examples using that, code above:

This will remove the message "To stop Carl;(bla...bla)" when the player first
kicked someone out of his car.

Code:

0@ = 0xC0BC15 //  ADDRESS
2@ = 0x1      //  VALUE
3@ = 0x1      //  LENGTH (Byte)
gosub @MemoryWrite





Here are some helpful topics:

Seemann's San Andreas Memory Handling Topic
Changing hard-coded interface
Cheats

View user profile http://gtamodding.com

2 Re: Sub-Memory Routines on Wed Mar 04, 2009 8:17 am

Nice post! BTW, you know the HUD color address, after 362041 is there any more?

View user profile

3 Re: Sub-Memory Routines on Wed Mar 04, 2009 8:22 am

Alexander wrote:Nice post! BTW, you know the HUD color address, after 362041 is there any more?

Code:

362041..49  - unknown

I guess you could try them if you wanna, I have seen no effect in anything, so it's unknown, AFAIK. Tounge 2
362037 is also unknown.

View user profile http://gtamodding.com

4 Re: Sub-Memory Routines Today at 7:54 pm

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum