Joined: 09 May 2003 Posts: 25262 Location: The netherlands
Posted: Tue Apr 16, 2013 8:43 am Post subject:
it also works with dx10, dx10.1 and dx11 yes (not dx11.1 though, but who wants to use w8 for 3d gaming anyhow)
no opengl yet
Perhaps I should try making a default 3doverlay script generator based on the cheat table like I do with the trainer maker
Quote:
but I hear openGL hooking is alot trickier than DX
There's probably more to hook, but I don't see much problems (Besides not too many games that use it right now)
Of course, if you are hooking d3d by modifying the function table of the d3ddevice then it will be trickier yes. (and not to mention that windows vista and later royally screw that up if you hook more than just present/endscene)
-
Also, next ce version has simplified lua scripting a lot
Yes I modify the function table like this: Hooking either present or endscene seem to work equally effective so Im not sure which is better to use... maybe depends on the game...
And of course got to hook reset and properly release what you've created...
And yes that second lua code looks nicer! I should probably start learning it! it is quite useful if you know how to write it!
Dark Byte, there's no way to attach videos is there? I thought I saw someone do it, but might have been a mod...
Anyway I know you probably don't watch peoples videos but I whipped this up real quick after making a quick mod on my work in progress to show you how I'm able to dynamically load CT's and generate a direct X gui based on them! I think that's what you were talking about... (and thanks to Alice, they'll actually be able to enable and disable as well )
Since fraps doesn't coincide with my DX hook (or at least I haven't cared to make them coincide I had to use windowed mode to demonstrate...)
After loading a CT, it doesn't immediately dynamically create the new cheats list... so I had to alt + enter to enter + exit full screen mode to cause reset to be called so it would re-initialize my DXTrainerMenu object and everything else with it!
Any idea how it could be instant, without having to have reset to be called?
Thanks this project of mine is turning out to be a quite fun one to piece together!
OH and I almost forgot, see how some of the check boxes are randomly not being drawn? I can't seem to figure out what's causing that.... (I don't create a check box checked and check box unchecked texture for each 'DXHack' object, I just pass the created one from DXTrainerMenu as a pointer... I thought that is okay... Should I instead have the DXHack object create its own two checkbox textures instead? It would be more calls to D3DXCreateTextureFromFileInMemory but if that solves the problem I wouldn't mind it!
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
Posted: Tue Apr 16, 2013 10:44 am Post subject:
I find it the easiest to just create what you need when present is called and you're about to draw
Is the object you need still NULL? Then create and initialize it.
Sure, the first frame render after the hook will be slightly slower, but all subsequent frames will have a normal render speed
Then when reset is called free everything (that isn't NULL) and NULL the pointers so the next time the gui is rendered repeat it again
As for the checkboxes not being rendered not sure. This looks a lot of using uninitialized variables where every so often a variable in the stack is not 0 so a certain variable has a value that's not 0 either _________________
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
I find it the easiest to just create what you need when present is called and you're about to draw
Is the object you need still NULL? Then create and initialize it.
Sure, the first frame render after the hook will be slightly slower, but all subsequent frames will have a normal render speed
Then when reset is called free everything (that isn't NULL) and NULL the pointers so the next time the gui is rendered repeat it again
As for the checkboxes not being rendered not sure. This looks a lot of using uninitialized variables where every so often a variable in the stack is not 0 so a certain variable has a value that's not 0 either
OMG!!! THANKS DARK BYTE!!
I solved the checkbox problem!! Okay what I was doing wrong was trying to initialize after the call to reset! as well as at the start of present! Looking back that was silly of me, as it only needs to be initialized once! and the begginning of present or endscene is the best place to do it!
I was properly releasing / freeing / setting back to NULL though so that's why I wasn't crashing...
However I'm unsure if I should keep the IntializeTextures() function under the if of 'Show' Or just initialize them anyway even if not showing the gui yet? I suppose it doesn't matter since it wont initialize them unless they aren't initialized...
if(!DXTrainer)
{
DXTrainer = new DXTrainerMenu(pDevice);
DXTrainer->AddCheatsToMenu(Assembler->CT);
}
}
The AddCheatsToMenu method of DXTrainerMenu class is what dynamically creates the cheat list as I demonstrated in that video you saw Thanks for embedding it by the way
Well now that my check box issue is all cleared up, I can continue work on making it movable (which I've already done, just now have to make sure everything moves with it) making the checkboxes get checked, and calling Assembler->AutoAssemble(); on the clicked cheat!
I noticed something though, I think some scaling is going on because the sizes of my trainer window and other drawn images doesn't seem to reflect their actual image size... How can I accurately programmatically calculate these sizes of textures?
I've used: DXTrainerTexture->GetLevelDesc(0, &DXTrainerWindowDesc);
And the DXTrainerWindowDesc.Width + Height fields but they for example returned 512 x 512 and the image was actually 378w x 478h ? I'm thinking it's because power of two... but even manually forcing 378 and 478 as the dimensions it still was not the right size...
So I suppose the question is, regardless of how DX is scaling the image, how can I know it's true dimensions?
lol this is my last question I promise! But thanks for making me realize how to fix my checkbox problem! ONLY initialize your stuff in present/endscene... don't mess around trying to do that after reset!!
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
Posted: Tue Apr 16, 2013 11:34 am Post subject:
Two solutions:
1: When rendering get the real size of the texture and the wanted size of the picture and just render with a specified scale matrix.
2: use D3DXCreateTextureFromFileInMemoryEx instead and for Filter specify D3DX_FILTER_NONE so it will not scale and the pixels that don't make up the texture are made transparent (So in fact the texture when drawn as a sprite is the size of the original picture)
Two solutions:
1: When rendering get the real size of the texture and the wanted size of the picture and just render with a specified scale matrix.
2: use D3DXCreateTextureFromFileInMemoryEx instead and for Filter specify D3DX_FILTER_NONE so it will not scale and the pixels that don't make up the texture are made transparent (So in fact the texture when drawn as a sprite is the size of the original picture)
As you can see the image is in it's true size, there were a lot of extra parameters in that Ex call though, they weren't kidding about the Ex! lol Can for sure tell because the text is now going off the side!
So thanks for that! Now my gui looks much nicer and not distored a bit due to stretching!
I also tried the first method just to learn how to do it that way as well, in case maybe I did want to scale or perhaps rotate something... (so I switched back to the 'D3DXCreateTextureFromFileInMemory' call and tried this:
I tried this by putting it between pSprite->Begin() and pSprite->End() (in my present hook)
According to what I was thinking it should have applied that scale matrix so anything drawn after it would be scaled X + Y by 10.0 so it should've basically filled the whole screen! perhaps that isn't the right code... and if I set a transform don't I have to unset it? I don't see a call for unset transform... Or I know perhaps you just call settransform again with the original matrix... Also I was confused about D3DTS_TEXTURE0 it was some example code I found online, perhaps that's not right either...
I'll keep playing around maybe I'll have better luck with trying to rotate it
EDIT: I GOT IT! I wasn't applying the matrix to the world! only to whatever D3DTS_TEXTURE0 is!
Thanks to this way more informative page then where I got that example code from, I substituted it for: 'D3DTS_WORLD' instead and bingo! scaled by ten fold (http://www.directxtutorial.com/Lesson.aspx?lessonid=9-4-5)
Okay now I'm just having fun! It's back to work for me _________________
Ok!I've upload an example about loading CETack.dll from memory. It's a vs2012.C++ project.
But, I think it's too complicated to write a trainer with c++ for me. I prefer using pascal or CE's Lua. And it's very easy to make an ingame menu trainer with CE's lua engine.
Ok!I've upload an example about loading CETack.dll from memory. It's a vs2012.C++ project.
But, I think it's too complicated to write a trainer with c++ for me. I prefer using pascal or CE's Lua. And it's very easy to make an ingame menu trainer with CE's lua engine.
Well you don't have to write any C++ code! In order to have a C++ directx GUI trainer That's what my DX Trainer Kit does! It automatically creates it for you The code is already laid out!
/*
*
* CETack Static Library(Cheat Engine Auto Assembler module)
* Version: 1.0.1.21
* Author: Alice0725
*
* This is not an official library of Cheat Engine. But, placed in CE forum by Alice0725.
* The URL is http://forum.cheatengine.org/viewtopic.php?t=560099
*
*
* THIS SOFTWARE AND THE ACCOMPANYING FILES (IF ANY) ARE PROVIDED AS IS WITHOUT WARRANTY OF
* ANY KIND, EITHER EXPRESS OR IMPLIED.
*
* CETack is a standalone auto assembler module. So, rapidly and easily for you to
* make a trainer if you use it in your project. The whole CETack package has 3 parts:
*
* (1)CETackLCL:It's a visual component library for use in Lazarus.If you know a little pascal,
* using Lazarus to write a standalone trainer will be your best choice. The simple the best one,
* your best choice it's a table of Cheat Engine .
*
* (2)CETackDLL:It's a dynamic library. The easist way to load CETack in your project.
*
* (3)CETackLib:It's static library. For those who want to make a single file trainer.
*
*
* The original library is a dynamic library programmed in pascal(Yesh,that's the CETackDLL).
* So thanks for Joachim Bauch([email protected])'s Memory DLL loading code.We can have
* this static library. His website is http://www.joachim-bauch.de.
*
* Thanks Dark Byte, the author of Cheat Engine.Yeah, CETack is just a tack of cheat engine.
* Cheat engine can do more than this,no matter you're a trainer maker or professional programmer...
* Try it, you'll love it. Cheat Engine's Offical website: Http://www.CheatEngine.org
*
* Thanks Steve Andrew! Without his encouragement, this project would have never been finished.
*
*/
/*
@params:
(1)HANDLE processHandle;
(2)CHAR *symbolName. The symbol name can be a :
a. User defined symbol in aascript.
b. Symbol in a module of the process. You can use this to call the API.
c. CE's address expression. e.g.: "[[hero.exe+0987]+7FE8]+0B".
*/
UINT_PTR WINAPI GetAddress(HANDLE processHandle, CHAR *symbolName);
/*
@params:
(1)HANDLE processHandle
(2)CHAR *aascript. AutoAssembler script. See CE's help file for more help.
(3)BOOL bEnable. Since CE's aascript has tow sections, one is enable ,the other one is disable.
bEnable=true, execute the script in [enable] section.
bEnable=false,execute the script in [disable] section.
(4)DWORD dwFlag, This param is for showing message.
dwFlag=0, show nothing;
dwFlag=1, only popup errors;
dwFlag=2, popup messages and errors.
*/
BOOL WINAPI AutoAssemble(HANDLE processHandle, CHAR *aascript, BOOL bEnable, DWORD dwFlag);
/*
@param:
(1)CHAR *imageName: the image name of the process. e.g.:"hero.exe" .
@notes:
(1)If the imageName is not a pure ASCII str, use UTF-8 encoding.
(2)If there are 2 or more processes have the same imageName, will only return the 1st one.
*/
DWORD WINAPI GetProcessIdByName(CHAR *imageName);
/*
@params:
(1)CHAR *wndClass: The class name of the process window.(Use Spy++ or other tool to get it.)
(2)CHAR *wndName: The Window name of the process window.(Use spy++ or other tool to get it.)
@Notes:
(1)If the wndClass or wndName is not a pure ASCII str, use UTF-8 encoding.
(2)If there are 2 or more processes have the same class and Name, will only return the 1st one.
@Tip:
Window's system process: "explorer.exe" 's window caption is always the current folder.So, you
should always set the wndClass.
It's been 3 months since the last update, but just in case that this one is still maintained, i have a question:
So far, i simply downloaded the source files from the link and added them to my project.
Calling the AutoAssemble function with a little test code that creates a popup window works perfectly so far.
However, when i want to inject more complex code, i run into trouble. Mainly, the AutoAssemble has problems with expressions like "msvcr80.strcat", telling me he could not compile that line. If i replace it by "strcat", it compiles; however, the process i'm currently injecting the code into seems to have two different c libraries loaded, and "strcat" is resolved to "ntdll.strcat"; and calling this one crashes the process.
The same problem occurs with any address which is built through the Modulename.functionname syntax (user32.MessageBoxA). When i inject the very same code through cheat engine itself, if works fine. The GetAddress function returns 0 when given such an expression, so i can not use it to get around that problem either.
So, does anybody have an idea what i am doing wrong before i end up enumerating the modules myself and replacing them manually?
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
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