I've been learning c++ for a little while on my own so far and i plan to learn in college and have a future in programming. I am new still and being that i have never really had anything or person to teach me i tend to do things "how ever i can get it to compile" as for they turn out sketchy. In this program i have a group of online friends that use it. Its a mod for an old game we like to use vs each other and considering that this game is still somewhat active (at least to those making these programs) I've recently heard of my program which is a dll being hexed with other peoples names on my work as well as getting around my cheesy authentication. So my question is how could i make it so that a specific string is not shown so simple and as is in the dll for hex editors. i know this is not a reliable way and any one with even my knowledge could get around it but most of that i know that could get a hold of this don't. so here is my code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
BOOL Authentication()
{
if (V_Authentication == TRUE)
{
char *ListName = "Name"; // the string i want to hide
if ((!_stricmp(Me->pPlayerData->szName, ListName) == TRUE))
{
Print(0, 4, "ÿc5Authentication:ÿc3 ---User: ÿc5Name---");
}
elseif ((!_stricmp(Me->pPlayerData->szName, ListName) == FALSE))
{
Print(0, 4, "ÿc5Authentication:ÿc3 ---Failed---");
ExitGame();
}
}
return TRUE;
}
it works great but if you open a hex editor all you have to do is change the name i will take any answer preferably simple since i spent the last 2 days trying to implement blowfish which was successful but couldn't figure out how to encrypt the dll contents
Alternatives would be to hardcode the string into the .exe, then only someone that can disassemble it would be able to change it. Aside from that, even if you encrypt the .dll, your program still needs updated, so what's the purpose of encrypting the .dll instead of just moving the string you don't want edited to something a little more secure?
What does your .dll even do then??? If you can modify a .dll that's created for another program, there is no way that I know of, to prevent other's from stealing your code, or just changing your name.
What is the goal of this DLL? What is it supposed to do? Why did you make it? Why would others want to remove your name and put theirs?
its a mod for an old pc game that injects directly into it using just the dll and my configuration
it i made it to learn and compete with other mods people create.
Without understanding the language, you're not understanding what's happening. The dll is a specially formatted file type that your program can read. But since you didn't write the program, you're limited to what the program actually reads from the .dll. You can add all of the authentication you want to your DLL, but anyone that can modify it to begin with, will also be able to modify the authentication out of it. Are you understanding my point now? There really is no "safe" way to hide content of a DLL if you didn't originally design it or the program that uses it.
yea i think so only problem is that even if i had an exe to use the dll couldn't people just continue to skip the exe and inject the dll like it should normally? how would i go about encrypting the contents of the dll so if opened by a hex editor it would all be encrypted
i tried blowfish but couldn't figure out just how to encrypt inside the dll specifically
Since you're modifying the .dll that is used by the game, you have no alternative. Period. I'm not sure if you could rewrite the .dll so that the game could still understand it, but a hex editor would display garbage. Especially since it's not your code. I know there were some DLL uncompilers floating around on the net long ago when DLLs were really popular, but I'm not sure that'll help you, but more than likely make it easier for other's to modify your .dll.
Why is it such a big deal if they change your name? If you did it for yourself and others, just share it with others and keep your copy. Hand it out when someone wants it. There is no other way that I know of to do anything similar to what you want without modifying the program code, which more than likely, you'll never be able to do, and it'll be even harder to convince everyone else to download your copy of the game too.
...so you are telling me its impossible to encrypt the output of your source when it compiles. i have spent a lot of time on this and i will continue to learn. not to mention my specific mod isnt released to public like the rest which makes others want it since a pub mod is considered embarrassing :S
ill continue to search for answers because im not just going to give up and ive seen dlls like mine for a mod for the game encrypted... just trying to learn myself
I hope you find something, but from what I know about DLLs and C++, what you're trying to do isn't going to be easy, if it's even possible. Keep searching, and maybe you'll stumble across something. I'd suggest trying googling "Encrypt DLL C++", you might get better results than this. But something I just thought about was creating a bunch of different variables, hidden all over the DLL with random, unique names, and slowly piecing them together. I'm not sure that's exactly what you're looking for, but it might be worth a shot?