Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
Old July 13th, 2008   #1 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Mudlord's Game Trainer Framework (or How to Hack Games)

Here's some code I have been meaning to make public.

Here is a simple game trainer framework, that should work with most games out there. Some systems, like Starforce, Blizzard Warden (used in WoW), Valve VAC and GameGuard, might blacklist this.

This trainer shows the basics in how to access process memory and write to it directly. It also contains wrapper functions in how to easily access specific processes, as well as how to skin a application, as well as embed music in a executable. It also shows a real example in training, which is the freeware game "Frog Hunt", by Johan Peitz/Free Lunch Design.

It is written in pure Win32 C/C++, with the aim of zero bloat. Which involves using PNG graphics and XM music by Dubmood/Razor1911.

Enjoy.
Attached Files
File Type: rar TrainerFramework.rar (67.5 KB, 92 views)
mudlord is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old July 13th, 2008   #2 (permalink)
T-5000 Modenator
 
Xtreme2damax's Avatar
 
Join Date: Aug 2005
Location: Here, there, everywhere, even in your couch cushions..
Posts: 3,139
Thanks, I've been looking for a way to do a decent trainer. Just using T-search and Trainer Maker kit doesn't cut it as I wanted to learn to make something a bit more advanced.
__________________

| Xtemulation Forums | Dolphin SVN Builds |
| XTemulation Wiki | PCSX2 SVN Builds |

Download the free Xtemulation Toolbar
If you like Xtemulation, please Digg Us
Xtreme2damax is online now   Reply With Quote
Old July 13th, 2008   #3 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Yeah, most release groups these days code thier own trainers.

Least the code I posted, should be a start if you want to make really good trainers. Like how Team Brewers made a awesome one for TimeShift.
mudlord is offline   Reply With Quote
Old July 13th, 2008   #4 (permalink)
Regular User ;)
 
Phil's Avatar
 
Join Date: Oct 2007
Location: Naples Florida
Posts: 9,965
Thanks mud.

now when do you optimize pcsx2 to run on 4 cores?
__________________

A Mac is like an escort, you pay a ton and get nothing.
A PC is like a hooker, it's a lot cheaper and gives you what you're after.. and if unlucky some diseases as well, that's why you gotta use protection. -CC
Phil is offline   Reply With Quote
Old July 13th, 2008   #5 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Quote:
now when do you optimize pcsx2 to run on 4 cores?
I'm not going to touch PS2 emulation. So, thats not happening. Maybe when PCSX2 gets more mature, ref and co might work together to add more optimized code and threading....
mudlord is offline   Reply With Quote
Old July 28th, 2008   #6 (permalink)
And the science gets done
 
Hard core Rikki's Avatar
 
Join Date: May 2004
Location: Perpetual Pompei
Posts: 7,215
Quite the productive one you are, mudlord ;P
Zero bloat certainly does sound nice.
__________________

Quote:
May the fleas of 1000 camels infest the crotches of BIOS swappers! And may their arms be too short to scratch!
My deviantART | My Blog | VBA-M | @ES | PCSX2 | GeneralEmu | XTemu | Webcomics
Hard core Rikki is offline   Reply With Quote
Old September 12th, 2008   #7 (permalink)
Registered User
 
Join Date: Jul 2006
Location: USA
Posts: 50
can i build a x64 binary out of this?

nevermind...it won't build even for win32:

Error 1 error C2664: 'GetDlgItemTextW' : cannot convert parameter 3 from 'char [128]' to 'LPWSTR' d:\projects\generic\trainerframework\include\dlg_c olors.h 88
Error 2 error C2664: 'DrawTextW' : cannot convert parameter 2 from 'char [128]' to 'LPCWSTR' d:\projects\generic\trainerframework\include\dlg_c olors.h 91
Error 3 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR' d:\projects\generic\trainerframework\source\main.c pp 91
Error 4 error C2440: '=' : cannot convert from 'const char [24]' to 'LPCWSTR' d:\projects\generic\trainerframework\source\main.c pp 139
Error 5 error C2440: '=' : cannot convert from 'char [260]' to 'LPWSTR' d:\projects\generic\trainerframework\source\main.c pp 140
Error 6 error C2440: '=' : cannot convert from 'const char [4]' to 'LPCWSTR' d:\projects\generic\trainerframework\source\main.c pp 143
Error 7 error C2664: 'CreateProcessW' : cannot convert parameter 2 from 'char [260]' to 'LPWSTR' d:\projects\generic\trainerframework\source\main.c pp 151
Error 8 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'LPCSTR' to 'LPCWSTR' d:\projects\generic\trainerframework\source\main.c pp 165
Error 9 error C2664: 'strcmp' : cannot convert parameter 2 from 'WCHAR [260]' to 'const char *' d:\projects\generic\trainerframework\source\main.c pp 226

oh, well.

Last edited by kidaware; September 12th, 2008 at 23:08..
kidaware is offline   Reply With Quote
Old September 13th, 2008   #8 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
It does compile here...

Tried messing with the options in the project file????
mudlord is offline   Reply With Quote
Old September 13th, 2008   #9 (permalink)
Registered User
 
Join Date: Jul 2006
Location: USA
Posts: 50
looks like it was because of wide character support.

i only got one error left:

Error 1 error C2664: 'strcmp' : cannot convert parameter 2 from 'WCHAR [260]' to 'const char *' d:\projects\generic\trainerframework\source\main.c pp 230

but don't know what to do.
kidaware is offline   Reply With Quote
Old September 13th, 2008   #10 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Compiled with MSVC6 fine here....
mudlord is offline   Reply With Quote
Old September 13th, 2008   #11 (permalink)
Registered User
 
Join Date: Jul 2006
Location: USA
Posts: 50
ok, i fixed it. i changed 'strcmp' to 'wcscmp.'

now i have linker error:

Error 3 error LNK2019: unresolved external symbol _uFMOD_PlaySong@12 referenced in function _WinMain@16 main.obj
Error 4 fatal error LNK1120: 1 unresolved externals D:\Projects\Generic\TrainerFramework\Debug\Trainer Framework.exe

i'm using vs c++ .net 2008 sp1.
kidaware is offline   Reply With Quote
Old September 13th, 2008   #12 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Quote:
Error 4 fatal error LNK1120: 1 unresolved externals D:\Projects\Generic\TrainerFramework\Debug\Trainer Framework.exe
There's your problem. As a developer, I thought you would know how to fix that.....
mudlord is offline   Reply With Quote
Old September 13th, 2008   #13 (permalink)
Registered User
 
Join Date: Jul 2006
Location: USA
Posts: 50
i fixed it by commenting out the following everywhere in main.cpp:

#include "ufmod.h"
uFMOD_StopSong()
uFMOD_PlaySong(MAKEINTRESOURCE(IDR_MUSIC), 0, XM_RESOURCE);

it runs now! it shows window with mario characters! now i try to make it x64! but no sound.

x64 no good:

Error 1 error C2664: 'DialogBoxParamW' : cannot convert parameter 4 from 'BOOL (__cdecl *)(HWND,UINT,WPARAM,LPARAM)' to 'DLGPROC' d:\Projects\Generic\TrainerFramework\source\main.c pp 113

i give up.

i changed my mind. i fixed it! i changed this:

BOOL CALLBACK DialogProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

to this:

static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

and remove every place that has png lib (png lib 32-bits only?) in main. it runs as x64 binary but no mario picture or sound.

oh, well. thanks for excellent framework, mudlord!

Last edited by kidaware; September 13th, 2008 at 02:58..
kidaware is offline   Reply With Quote
Old October 14th, 2009   #14 (permalink)
Registered User
 
Join Date: Oct 2009
Location: Spain
Posts: 1
Talking

Thx man....is very good.
StrongCod3r is offline   Reply With Quote
Old October 14th, 2009   #15 (permalink)
Heating up ma SPRITE!
 
Mdkcheatz's Avatar
 
Join Date: Mar 2009
Location: Under your bed! Ngemu.wikidgamer.com Reputations: +11
Posts: 403
Quote:
Originally Posted by mudlord View Post
There's your problem. As a developer, I thought you would know how to fix that.....
Haha, I hate errors, but coding is extremely sensitive to formatting and typos. At least the error messages are very informative to where the compiler had an issue rather than the issue itself; more often than not, you can easy pinpoint the issue
__________________
[adult swim]

Mdkcheatz is offline   Reply With Quote
Old October 15th, 2009   #16 (permalink)
Knowledge is the solution
 
Proto's Avatar
 
Join Date: Dec 2002
Location: Milwaukee, US. Previously in Mexico City
Posts: 6,558
Back to the future, mdk?
__________________
Proto is online now   Reply With Quote
Old October 15th, 2009   #17 (permalink)
Heating up ma SPRITE!
 
Mdkcheatz's Avatar
 
Join Date: Mar 2009
Location: Under your bed! Ngemu.wikidgamer.com Reputations: +11
Posts: 403
Quote:
Originally Posted by Proto View Post
Back to the future, mdk?
Not quite yet, I'm still exploring ancient history...
__________________
[adult swim]

Mdkcheatz is offline   Reply With Quote
Old October 15th, 2009   #18 (permalink)
More than you pay for~
 
DinJerr's Avatar
 
Join Date: Aug 2001
Location: Kuala Lumpur
Posts: 222
It's like that movie where one person is writing letters to someone 2 years in the past.

Exciting!
__________________
When you

you're signing your death warrant.

ASUSnoir : Xeon E3110 @ 3.0 Ghz | ASUS P5QL Pro | 4GB DDR2 1066 | ASUS EN9800GT 512 DD3 | Seagate 500GB 7200rpm 32MB
Tabby-chan: Dothan 1.6 Ghz | Intel Centrino | 1.5GB DDR 333 | Maxtor 150GB 7200rpm
DangerPC : Athlon XP 1800+ | ASUS A7S333 | 1GB DDR 266 | ATI X1050 | Seagate 80GB 7200rpm 8MB - R.I.P. May '09
DinJerr is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 18:35.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5