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 


Getting Directory of a process

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sun Aug 10, 2008 3:06 pm    Post subject: Getting Directory of a process Reply with quote

Is it possible to get the directory of a process?

Or even better, the directory of where the DLL was before it was injected?

Thanks.
Back to top
View user's profile Send private message Send e-mail
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Aug 10, 2008 3:43 pm    Post subject: Reply with quote

Since your injector is usually with your DLL, GetCurrentDirectory
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Aug 10, 2008 3:44 pm    Post subject: Reply with quote

Are you talking about getting the path of a loaded dll in the current exe?

If so, then you can just loop through the modules (CreateToolhelp32Snapshot() + Module32First()/Next()) and find yours, then get the szExePath param, I think.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sun Aug 10, 2008 3:46 pm    Post subject: Reply with quote

GetModuleFileName/Ex.
_________________
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sun Aug 10, 2008 4:47 pm    Post subject: Reply with quote

samuri25404 wrote:
Are you talking about getting the path of a loaded dll in the current exe?

If so, then you can just loop through the modules (CreateToolhelp32Snapshot() + Module32First()/Next()) and find yours, then get the szExePath param, I think.


Eh, that only returns the exe name. =(

I think.

Edit: Opps, I made a mistake. I was thinking of Process32Next.

Thanks!


Last edited by kitterz on Sun Aug 10, 2008 5:56 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Aug 10, 2008 5:50 pm    Post subject: Reply with quote

slovach wrote:
Since your injector is usually with your DLL, GetCurrentDirectory


GetCurrentDirectory can be changed during runtime, so it doesn't make for a feasible solution in an application that reads data from various locations. (If it uses this and SetCurrentDirectory to flip flop between things.)

I would go with what sponge suggested as it would be static.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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