Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -----------------------------------------
- * Game hacking QTS ( Quickie Tip Series )
- * no. 1 - How to append a file name onto a file location
- -----------------------------------------
- * Author: SEGnosis - GHAnon.net
- * Thanks to:
- * bitterbanana - No known site
- * Drunken Cheetah - No known site
- * fatboy88 - No known site
- * Geek4Ever - No known site
- * learn_more - www.uc-forum.com
- * Novocaine - http://ilsken.net/blog/?page_id=64
- * Philly0494 - No known site
- * Roverturbo - www.uc-forum.com
- * SilentKarma - www.halocoders.com - offline
- * Strife - www.uc-forum.com
- * Wieter20 - No known site
- */
- //------------------------------------//
- #include <iostream>
- int main()
- {
- char* szFileLocation = "C:\\Foo\\Faa\\Fee.exe"; // Example file location string.
- char* dwLetterAddress = strrchr( szFileLocation, '\\' ); // strrchr returns the address of the first instance of the backslash character inside of the szFileLocation string starting from the right side.
- *( dwLetterAddress + 1 ) = 0; // De-Referencing the address returned plus the 1 to effect the first letter after the backslash. Setting it to zero ends the string.
- strcat( szFileLocation, "MyFileName.txt" ); // Since the string now does not contain the original file name. We can use strcat to append the string we want onto the file location.
- return 0;
- }
- //------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement