[C] Real Time Datachanger [29/1/11] - Boop - 01-22-2011
The release is here! Hoorayyyyy...
Download >>here<<.
Don't know how to use it? Check >>here<<.
BlowFly and I are working on a real time data changer. It will allow you
edit data while lf2 is running. Since we are frequently updating the source code it'd be pointless to keep uploading rars and stuff. Instead we created a google code project here:
http://code.google.com/p/lf2-realtime-dcer/
Everyone is free to download it and compile it as they wish if you know how to ~ blow_fly98. As soon as we have a release which lets you overwrite lf2 frames we'll release a compiled release :P.
Teaser screenshot FTW:
![[Image: pzHfL.png]](http://i.imgur.com/pzHfL.png)
So today I started working on a real time datachanger. Basically a datachanger which lets you change data in an already loaded game. My motivation quickly died after I saw that it is quite feasible but would require lots of planning and lots of tedious work and code :(.
So here is what I have so far.
C-Code:
#include <stdio.h>
#include <windows.h>
struct sOpoint
{
int x;
int y;
int action;
int dvx;
int dvy;
int dvz;
int oid;
int facing;
};
struct sFrame
{
int exists;
int pic;
int state;
int wait;
int next;
int dvx;
int dvy;
int dvz;
int unknown1;
int hit_a;
int hit_d;
int hit_j;
int hit_Fa;
int hit_Ua;
int hit_Da;
int hit_Fj;
int hit_Uj;
int hit_Dj;
int hit_ja;
int mp;
int centerx;
int centery;
int opoint_exists;
struct sOpoint opoint;
int unknown2;
int unknown3;
};
main()
{
HWND hWnd;
HANDLE hGame;
DWORD dwProcessId;
DWORD temp;
struct sFrame frame1;
int frameNum;
hWnd = FindWindow(0, "Little Fighter 2");
if (!hWnd)
{
printf("cant find window\n");
return;
}
GetWindowThreadProcessId(hWnd, &dwProcessId); // Get Process id
hGame = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, dwProcessId); // Open Process with id
if (!hGame)
{
printf("cant open process\n");
return;
}
// Reading Example
frameNum = 0;
ReadProcessMemory(hGame, (LPVOID) 0x458C9C, &temp, sizeof(temp), NULL); //loading character used by player 3
temp += 0x368;
ReadProcessMemory(hGame, (LPVOID) temp, &temp, sizeof(temp), NULL);
temp += 0x7A4 + (frameNum * 0x178);
ReadProcessMemory(hGame, (LPVOID) temp, &frame1, sizeof(frame1), NULL);
//should be one long printf statement but to much hassle for simple testing
//printf("name: %s ",frame1.fname);
printf("pic: %d ",frame1.pic);
printf("state: %d ",frame1.state);
printf("wait: %d ",frame1.wait);
printf("next: %d ",frame1.next);
printf("dvx: %d ",frame1.dvx);
printf("dvy: %d ",frame1.dvy);
printf("dvz: %d ",frame1.dvz);
printf("centerx: %d ",frame1.centerx);
printf("centery: %d ",frame1.centery);
printf("hit_a: %d ",frame1.hit_a);
printf("hit_d: %d ",frame1.hit_d);
printf("hit_j: %d ",frame1.hit_j);
printf("hit_Fa: %d ",frame1.hit_Fa);
printf("hit_Ua: %d ",frame1.hit_Ua);
printf("hit_Da: %d ",frame1.hit_Da);
printf("hit_Fj: %d ",frame1.hit_Fj);
printf("hit_Uj: %d ",frame1.hit_Uj);
printf("hit_Dj: %d ",frame1.hit_Dj);
printf("hit_ja: %d ",frame1.hit_ja);
printf("mp: %d ",frame1.mp);
//Writing a frame example
struct sFrame myFrame;
myFrame.exists = 1;
myFrame.pic = 5;
myFrame.wait = 3;
myFrame.next = 2;
myFrame.centerx = 38;
myFrame.centery = 179;
frameNum = 6;
ReadProcessMemory(hGame, (LPVOID) 0x458C9C, &temp, sizeof(temp), NULL);
temp += 0x368;
ReadProcessMemory(hGame, (LPVOID) temp, &temp, sizeof(temp), NULL);
temp += 0x7A4 + (frameNum * 0x178);
WriteProcessMemory(hGame, (LPVOID) temp, &frame1, sizeof(frame1), NULL);
}
|
It's mostly hacked together, but that means it should be easy to understand :p. Basically there is a struct, and it is read into memory :).
The struct is based on this: https://spreadsheets.google.com/ccc?key=r5Xp6WYfcmlxDTUlwfdZHYQ&pli=1#gid=2
I got lazy so I didn't finish implementing the struct. That spreadsheet becomes useless when it comes to bdys' and itr's since you can have multiple ones per frame, and it's all very weird. If anyone decides to continue this project, I'll help with that bit :).
Basically I'm just putting it out there incase someone is trying to learn C and wants a "fun" project to do with win32 api's. I can see it becoming super annoying though and the code would need to be re-structured and stuff...
Enjoy :). If you have any questions post here, or PM me.
I've attached my "project" :p. It uses MinGW to compile so yeah, you'll need that install if you are going to use my way of compiling it. It includes a compiled version if you like running things without understanding what they do :D.
RE: [C]Real Time Datachanger - The Lost Global Mod - 01-22-2011
Dude, Silva is asking here for help or rather he wants somebody to continue it as he found himself running against a brick wall, his own lazyness to be exact. Its not certain if he will continue it or not. He just wanted to share his code and knowledge.
So if you don't have questions about his code or can provide some results yourself, or maybe you declare yourself as volunteer to finish this, then don't post in here.
RE: [C] Real Time Datachanger [27/1/11] - Boop - 01-27-2011
First super early pre-alpha-0.000001 release that shows that we can write to frames... yay 
instructions:
http://code.google.com/p/lf2-realtime-dcer/wiki/ReadMe
Known issues/Things not finished:- Unless you explicitly set something to 0, the old value will just remain
- Changing the data file to edit does nothing atm
- path to data.txt file is hardcoded to exe_path\data\data.txt(this is probably unlikely to change because im lazy)
- There is a memory leak which will eventually probably cause the lf2 process to start using a lot of ram if you keep messing about with itr's/bdy's

I'm pretty sure we are missing some tags and stuff as well but who cares 
and a screen shot because everyone loves screen shots 
RE: [C] Real Time Datachanger [27/1/11] - The Lost Global Mod - 01-28-2011
here is the actual beta release fresh from silva's working oven
click me
[C] Real Time Datachanger [29/1/11] - blow_fly98 - 01-29-2011
Release Candidate 1 is here!
Enjoy.
Download >>here<<.
RE: [C] Real Time Datachanger [29/1/11] - Silverthorn - 01-29-2011
Alright, just did some quick tests.
@everybody that hasn't grasped it yet: THIS PROGRAM WILL NOT EDIT THE DAT-FILES BUT ONLY THE MEMORY-INTERNAL STUFF! COPYPASTE YOUR CHANGES INTO THE FILES TO MAKE YOUR CHANGES PERMANENT!!
Now, after that has been said... only stuff that I'd like to see is syntax-highlighting, save-options, possibility to alter backgrounds, and, of course, SYNTAX HIGHLIGHTING xD
Plus, a little more intuitive way of starting it 
Keep it up, guys! 
Something tells me that I used way too many caps in this post
RE: [C] Real Time Datachanger [29/1/11] - Boop - 01-29-2011
Ok, with the help of YinYin the majority of the bugs have been ironed out .
RE: [C] Real Time Datachanger [29/1/11] - YinYin - 01-29-2011
(01-29-2011, 01:31 PM)Blue Phoenix Wrote: Now, after that has been said... only stuff that I'd like to see is syntax-highlighting, save-options, possibility to alter backgrounds, and, of course, SYNTAX HIGHLIGHTING xD
Plus, a little more intuitive way of starting it 
the current selfmade injector is super intuitive already - only gotta rename it to "real time dcer" and combine it with the dll
then you run it as soon as your lf2 is loaded ...
yes background and stage editing would be awesome too
and if blowfly will include this as a feature to his flite2 all your other requests would be dealt with aswell (there the feature should only be included as two menu items: load from running lf2/inject into running lf2)
(01-29-2011, 07:34 PM)Lord Silva Wrote: Ok, with the help of YinYin the majority of the bugs have been ironed out .
and the minority is next in line
RE: [C] Real Time Datachanger [29/1/11] - Drahcir - 02-02-2011
Question: What happens if you try this in a network game?
RE: [C] Real Time Datachanger [29/1/11] - Boop - 02-02-2011
Synchronization checking is only done by comparing HP values (and there is a check upon loading which compares some checksums or something), so as long as you both apply the same patches, it'll work. Or if you apply changes to an unrelated character and don't use him it'll work .
You can actually have a completely unsynchornized game and as long as no one loses hp on either one of them, lf2 will continue to run .
|