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 


Recover existing Direct3D hook object?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
flarn2006
Advanced Cheater
Reputation: 1

Joined: 27 Nov 2012
Posts: 73

PostPosted: Mon Apr 21, 2014 6:43 am    Post subject: Recover existing Direct3D hook object? Reply with quote

I'm using a Direct3D hook to draw some text. Calling createD3DHook seems to work even if it's already been called on that process; it just returns the same value. But if Cheat Engine has been quit and relaunched since then, Cheat Engine just crashes. I'm aware only one can be created per process, but how can I make Cheat Engine reuse the hook it already created?

Basically, what I want is to be able to use the D3D hook to draw text even if Cheat Engine had previously been quit and relaunched, without having to also quit and relaunch the target process.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Apr 21, 2014 7:09 am    Post subject: Reply with quote

CE6.3 was not designed for that.
createD3DHook is meant to be called only once.

It may change in CE6.4

_________________
Back to top
View user's profile Send private message MSN Messenger
flarn2006
Advanced Cheater
Reputation: 1

Joined: 27 Nov 2012
Posts: 73

PostPosted: Mon Apr 21, 2014 7:26 am    Post subject: Reply with quote

Then is there any way to save the existing D3D hook object across CE sessions so creating a new one isn't necessary? I'm thinking about maybe saving it to a file with the PID, then next time it's activated, if the PID's don't match, create a new object.

Also do you have any info to believe that will likely change in CE 6.4 or are you just saying it's possible it will change in some later version?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Apr 21, 2014 7:35 am    Post subject: Reply with quote

You have to compile CheatEngine yourself (source code from SVN) and download DLL files from SVN
Of course, it will require many tests.


If you are interested, here are my builds:
https://drive.google.com/folderview?id=0BwMAnE6mjogMNXNjdHgxY1NqcEU



Here, r2435, r2436, r2439 and r2443
https://code.google.com/p/cheat-engine/source/list?path=/trunk/Cheat%20Engine/Direct%20x%20mess
Read commit logs (you have to click each entry to get longer version of "log")





I reported those: "DX version detection, textcontainer rendering in dx10 and 11, textcontainer alphablend in DX9 mode"

r2435 - fixed DX version detection in STALKER game
r2436 - textcontainer rendering in dx10 and 11, fix textcontainer alphablend in DX9 mode (not mentioned in commit log)



And I made my own workaround for "attaching the d3dhook to already hooked". It uses Lua code (many lines). But, after few days DB made this:

r2439 - support for attaching the d3dhook to a program that has already been hooked
r2443 - one extra check on dx9 and compile and commit the 64-bit binaries for d3dhook as well

_________________
Back to top
View user's profile Send private message MSN Messenger
flarn2006
Advanced Cheater
Reputation: 1

Joined: 27 Nov 2012
Posts: 73

PostPosted: Mon Apr 21, 2014 6:05 pm    Post subject: Reply with quote

Thanks, but I want people to be able to use it even if they don't have a specially-compiled version. But does this mean it will probably be in 6.4 like you said it might?

Is there a way to detect (in Lua) if the hook has already been applied so that it won't try to do it again, thereby crashing Cheat Engine? Again, it still works if I haven't quit Cheat Engine, but if I have, then I don't want to call it again. I'm thinking of doing a workaround involving saving the PID to a file, but I'm wondering if there's a better way.

Thanks again.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Apr 21, 2014 6:21 pm    Post subject: Reply with quote

"Thanks, but I want people to be able to use it even if they don't have a specially-compiled version"
Anyway, original CE6.3 has bugged d3d thing. (well, in some cases it works flawlessly)


"But does this mean it will probably be in 6.4 like you said it might?"
Probably it will be in CE6.4.

If you want to help test things, sing up to beta tester group.
http://forum.cheatengine.org/groupcp.php

_________________
Back to top
View user's profile Send private message MSN Messenger
flarn2006
Advanced Cheater
Reputation: 1

Joined: 27 Nov 2012
Posts: 73

PostPosted: Mon Apr 21, 2014 6:22 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
"Thanks, but I want people to be able to use it even if they don't have a specially-compiled version"
Anyway, original CE6.3 has bugged d3d thing. (well, in some cases it works flawlessly)


"But does this mean it will probably be in 6.4 like you said it might?"
Probably it will be in CE6.4.

If you want to help test things, sing up to beta tester group.
http://forum.cheatengine.org/groupcp.php


Okay thanks! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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