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 


[C++] Question

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

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Wed Dec 23, 2009 1:53 pm    Post subject: [C++] Question Reply with quote

Hello,

I perfectly read off static addresses in my memory scanner, however when I use the GetModuleFileName() api to get the module name I get the full path, which is a good thing but how do I just get the name of the module, for example iPromise.dll.

The only thing that is only holding my back from fully finishing my memory scanner is Static addresses, after this i'm finished.
Back to top
View user's profile Send private message MSN Messenger
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Wed Dec 23, 2009 2:27 pm    Post subject: Reply with quote

Code:
ExtractFileName( path );
It might only work in borland though =[
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Dec 23, 2009 3:05 pm    Post subject: Reply with quote

PathStripPath()
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Wed Dec 23, 2009 3:24 pm    Post subject: Reply with quote

@Slugs Thanks man
@...Henley Thanks, after research I got this:

Code:

   std::string ExtractFileName(const std::string& full)
   {
      string::size_type idx = full.find_last_of("\\");
      if (idx != std::string::npos)
      {
         return full.substr(idx+1);
      }
      else
      {
         return "";
      }
   }
Back to top
View user's profile Send private message MSN Messenger
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