| View previous topic :: View next topic |
| Author |
Message |
agoox How do I cheat?
Reputation: 0
Joined: 04 May 2009 Posts: 7
|
Posted: Sat Jun 06, 2009 1:14 am Post subject: can I save register's values into a text file? |
|
|
Hi, can you tell me if is possible to save into a text file the values of a register. I can read the value manually the value but in my game this register is changing every second I for my statistics i should save the values into a text file. And if I can save those values in real time will be very good.
Thanks a lot for your time.
King regards, John.
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sat Jun 06, 2009 3:48 am Post subject: |
|
|
This function is NOT thread safe: | Code: | void HookFunction()
{
static FILE *f = NULL;
static close = 0;
unsigned int value = 0;
if( !f ) {
f = fopen("myfile.txt", 'w');
if( !f )
return;
}
__asm mov value, eax; // I can't recall if it's [value] or value, because this is inline asm.
fprintf(f, %d\n, value);
if( close )
if( !fclose(f) )
f = NULL;
} | Iono if it works, let's say it's pseudo code for yourself to implement :D
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Jun 06, 2009 8:07 am Post subject: |
|
|
| TempNick wrote: | This function is NOT thread safe: | Code: | void HookFunction()
{
static FILE *f = NULL;
static close = 0;
unsigned int value = 0;
if( !f ) {
f = fopen("myfile.txt", 'w');
if( !f )
return;
}
__asm mov value, eax; // I can't recall if it's [value] or value, because this is inline asm.
fprintf(f, %d\n, value);
if( close )
if( !fclose(f) )
f = NULL;
} | Iono if it works, let's say it's pseudo code for yourself to implement  |
They both work. well... at least for delphi. If its a variable, it will automatically add the brackets to it.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sat Jun 06, 2009 8:48 am Post subject: |
|
|
getthreadcontext and then doing it in a function with pushad/popad is the best way but why would you want to save them constantly.. ?! there is a context change nearly every instruction..
@TempNick : thread-safe is very easy, just stick that code in a critical section or protect it with a semaphore/lock
still.. not quite sure what OP wants..
|
|
| Back to top |
|
 |
agoox How do I cheat?
Reputation: 0
Joined: 04 May 2009 Posts: 7
|
Posted: Sat Jun 06, 2009 10:05 am Post subject: |
|
|
I make a statistics for a friend and I have a "label" in a flash witch is loaded every 10 second with a random number and I should to display some graphics in real time after I perform those numbers. create graphics and work with those number it's not complicated because I work in C# but the problem was to read the number. thanks to you I think I will finish the job.
I don't want to change the context of flash, I need only to read this number and I sow that is a static register witch contain this number always even if I close and reopen the flash.
Thanks a lot.
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sat Jun 06, 2009 3:09 pm Post subject: Re: can I save register's values into a text file? |
|
|
| agoox wrote: | Hi, can you tell me if is possible to save into a text file the values of a register. I can read the value manually the value but in my game this register is changing every second I for my statistics i should save the values into a text file. And if I can save those values in real time will be very good.
Thanks a lot for your time.
King regards, John. |
you know the value? you know how to write (to) files? What's the issue really?
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
Guy Expert Cheater
Reputation: 0
Joined: 30 May 2009 Posts: 187
|
Posted: Sat Jun 06, 2009 5:20 pm Post subject: Re: can I save register's values into a text file? |
|
|
| Den Söta Kaninen wrote: | | agoox wrote: | Hi, can you tell me if is possible to save into a text file the values of a register. I can read the value manually the value but in my game this register is changing every second I for my statistics i should save the values into a text file. And if I can save those values in real time will be very good.
Thanks a lot for your time.
King regards, John. |
you know the value? you know how to write (to) files? What's the issue really? |
The issue is likely the OP's infamilarity with ASM and WinAPI functions for file I/O.
|
|
| Back to top |
|
 |
agoox How do I cheat?
Reputation: 0
Joined: 04 May 2009 Posts: 7
|
Posted: Mon Jun 29, 2009 4:47 am Post subject: |
|
|
I don't know almost anything about ASM and I know so much about C++ so I have some difficulties to do this. I
first I found the register with I need, after this I pressed the Memory View button -> Tools-> script engine and I copy the script below:
| Code: | void HookFunction()
{
static FILE *f = NULL; //this is a parse error. Cannot find 'FILE'
static close = 0;
unsigned int value = 0;
if( !f ) {
f = fopen("D:\\test.txt", 'w'); //
if( !f )
return;
}
__asm mov value, eax; // I can't recall if it's [value] or value, because this is inline asm.
fprintf(f, %d\n, value);
if( close )
if( !fclose(f) )
f = NULL;
} |
should I use some reference for 'FILE' or I don't insert the script where must be inserted?
king regards, John.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25821 Location: The netherlands
|
Posted: Mon Jun 29, 2009 5:19 am Post subject: |
|
|
hasn't anyone noticed that this script is pretty much useless ?
Let's just say that fopen already destroys the original value of EAX, and the other code in front might just as well do the same
anyhow, in your code injection, the first thing you do, save EAX to a static address (mov [staticaddress],eax ), and if you then want you can jump to some c code that saves that static address to a file (or you could just do the saving using assembler as well)
_________________
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 |
|
 |
agoox How do I cheat?
Reputation: 0
Joined: 04 May 2009 Posts: 7
|
Posted: Mon Jun 29, 2009 6:25 am Post subject: |
|
|
| Quote: | (or you could just do the saving using assembler as well)
|
how this is possible?
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Mon Jun 29, 2009 6:50 am Post subject: |
|
|
| Dark Byte wrote: | | Let's just say that fopen already destroys the original value of EAX, and the other code in front might just as well do the same | Oops, my bad :P | Code: | // v2.0
void HookFunction()
{
static FILE *f = NULL;
static close = 0;
static unsigned int value = 0;
__asm mov value, eax; // I can't recall if it's [value] or value, because this is inline asm.
if( !f ) {
f = fopen("myfile.txt", 'w');
if( !f )
return;
}
fprintf(f, "%d\n", value);
if( close )
if( !fclose(f) )
f = NULL;
} | Fix'd? I left out __declspec(naked) on purpose, earlier too.. Also it seems I missed some quotation marks..
|
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Mon Jun 29, 2009 9:03 am Post subject: |
|
|
by the way, you can write either mov value ,eax or mov [value], eax
the compiler translates it anyway into:
| Code: |
MOV DWORD PTR [VALUE], eax
|
|
|
| Back to top |
|
 |
agoox How do I cheat?
Reputation: 0
Joined: 04 May 2009 Posts: 7
|
Posted: Mon Jun 29, 2009 9:40 am Post subject: |
|
|
now this is a stupid question, but I don't understand something. where should I insert the script? to insert the script I follow this steps:
find register -> click Memory View button -> Tools -> Script Engine
and in this window I insert your function but on execution I receive an error(Error interpreting script: parse error Cannot find 'FILE'). I thick this error is because my script is not parse with C debugger and this is a problem. can you help me with this pl?
also I tired with 'ofstream' instead of 'FILE' and I receive the same error.
please see the attached picture
| Description: |
|
| Filesize: |
102.8 KB |
| Viewed: |
12792 Time(s) |

|
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Mon Jun 29, 2009 9:53 am Post subject: |
|
|
This thread made me lol'd. Jani posted a C script not an AA script
|
|
| Back to top |
|
 |
agoox How do I cheat?
Reputation: 0
Joined: 04 May 2009 Posts: 7
|
Posted: Mon Jun 29, 2009 10:32 am Post subject: |
|
|
I've done all tutorials and read a lot of topics but I didn't find anything where I can understand where should I insert C script, and I didn't find anything about AA script or how should I convert C scripts in AA scripts, anybody can tell me about this ? or give me a link to read about inserting script in Cheat engine.
Thanks a lot.
|
|
| Back to top |
|
 |
|