stevemk14ebr / VS2013-Compile-Time-XOR

Compile time string XOR for visual studio 2010-2013
10 stars 6 forks source link

VS2013-Compile-Time-XOR

Compile time string XOR for visual studio 2010-2013.

Out of date

Use the replacement: https://github.com/stevemk14ebr/CompileTime-String-Encryption


To setup:

1) Compile this project to .dll

2) Rename the compiled dll to a.dll

3) Navigate to Visual Studio Install Directory -> VC -> bin, locate c1xx.dll

4) Patch c1xx.dll to load a.dll

5) Place a.dll in the VC -> bin directory next to c1xx.dll

To use:

1) Open the project you want to have CT XOR

2) Place xor.h in your project

3) Build Project

Notes:

Necessary directions to patch c1xx.dll and xor.h header can be found here:

http://www.unknowncheats.me/forum/c-and-c-/131623-compile-time-string-encryption-visual-studio-2010-2012-a.html

Example of usage scenario:

You have code such as

#define SuperSecretKey "ImAKey"
if(input==SuperSecretKey)
    printf("You are a valid user!");

This would turn into

//The XOR macro is expanded at compile time by a.dll
#define SuperSecretKey XOR("ImAKey")
if(input==SuperSecretKey)
    printf("You are a valid user!");

Code-wise this is very simple, but in the decompiled binary your string would lose all xrefs (due to how this uses templates, ida isn't good at following thousands of unique instances of expanded function templates), and would appear similar to 'x33/x33/x33/x33' instead of "ImAKey"