Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Step 9 Code C-script translation

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25865
Location: The netherlands

PostPosted: Sat Jan 05, 2008 9:29 pm    Post subject: Reply with quote

just replace addresstochange with the address you want to change
e.g 0x00123456

you could also use #define addresstochange 0x00123456 so the script knows addresstochange is that value (saves some time editing and makes the code look 'neater')

---------------
for a more detailed:
Code:
#include <time.h>

Include the time.h file (basicly see it like replacing that line with all the contents of time.h which is then executed/parsed)

Code:
struct tm *timep;

Create a pointer (4 byte value representing an address) that represents a tm struct. The tm structi s defined in time.h

Code:
time_t c;

basicly create a variable of type time_t. It's actually just a normal int but whatever, makes it look nicer to use names like that.

Code:
c=time(0);

Get the current time and place it in the 'c' variable

Code:
timep=localtime(&c);

parses the time so it can be read out using a simple struct (the tm struct)

Code:
if (timep->tm_sec>=30)

check if the tm_sec element of timep is bigger than or equal to 30

Code:
*(int *)addresstochange=1000;

change the integer value at address (addresstochange) to 1000

Code:
else

no idea

Code:
*(int *)addresstochange=2000;

change the integer value at address (addresstochange) to 2000
-------------------------

of course, the chance of needing exactly this script is small, but if you know c and hardly any assembler you can do some neat tricks with it

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites