-
SerialKey Substitute
This is an idea I was having about something other than using the serial key function built into gunz.
Just some code I threw together in about 20 minutes or so.
Hope you all like it, feel free to comment on what you think.
Code:
//this took me about 20 minutes to make and 10 to test
//feel free to edit this any way you choose and beef up the algorithm
//Ryan M. Coble
#include <Windows.h> //include Windows API
#include <stdlib.h> //include standard library
#include <iostream> //if you don't know what this is may god help you. :P
using std::string; //allow us to use the string class
//function that uses an algorithm to create a key used to check if using right launcher
//simple algorithm found on google but you can use any that you see fit.
//credits to John Shao for algorithm.
string XOR(string value,string key)
{
string val(value);
short unsigned int klen=key.length();
short unsigned int vlen=value.length();
short unsigned int k = 0;
short unsigned int v = 0;
for(v; v<vlen; v++)
{
val[v] = value[v]^key[k];
k = (++k<klen?k:0);
}
return val;
}
//will start the Gunz.exe with command line argument key
bool StartGunzWithParam(char* GunzName)
{
char* Command = 0;
string ParamKey = XOR("WINNAR", "FAILHARD");
if(sprintf(Command, "%s %s", GunzName, ParamKey.c_str()) == 0)
{
if(system(Command) == 0)
{
return true;
}
}
return false;
}
//function that checks if the key used matches algorith used
bool CheckParamKey()
{
char* Path = 0;
char* ParamKey = 0;
char* CommandLine = GetCommandLineA();
if(sscanf(CommandLine, "%s %s", Path, ParamKey) == 0)
{
if(ParamKey == XOR("WINNAR", "FAILHARD").c_str())
{
return true;
}
}
}
//entry point
extern "C" bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
switch(fdwReason)
{
//case where DLL is attached to process
case DLL_PROCESS_ATTACH:
//if it matches let it go, if not exit.
if(CheckParamKey())
{
}
else
{
ExitProcess(0);
}
break;
//case where DLL is attached to thread
case DLL_THREAD_ATTACH:
break;
//case where DLL is detached from thread
case DLL_THREAD_DETACH:
break;
//case where DLL is detached from process
case DLL_PROCESS_DETACH:
break;
//should never happen
default:
break;
}
return true;
}
-
Re: SerialKey Substitute
if(CheckParamKey())
{
}
else
{
ExitProcess(0);
}
there are easyer ways
if(!CheckParamKey())
{
ExitProcess(0);
}
but other then that looks nice i did something simular
-
Re: SerialKey Substitute
Same difference, I mean it was written in less than a half hour and I was high as fuck...
-
Re: SerialKey Substitute
high is the way i love weed yay
-
Re: SerialKey Substitute