| View previous topic :: View next topic |
| Author |
Message |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Dec 23, 2009 1:53 pm Post subject: [C++] Question |
|
|
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 |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Wed Dec 23, 2009 2:27 pm Post subject: |
|
|
| Code: | | ExtractFileName( path ); | It might only work in borland though =[
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed Dec 23, 2009 3:05 pm Post subject: |
|
|
| PathStripPath()
|
|
| Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Dec 23, 2009 3:24 pm Post subject: |
|
|
@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 |
|
 |
|