Click here to Skip to main content
15,884,537 members
Articles / Programming Languages / C++

Tamper Aware and Self Healing Code

Rate me:
Please Sign up or sign in to vote.
4.89/5 (44 votes)
15 Nov 2007CPOL25 min read 203.5K   7.9K   183  
Dynamically Detect Code Alterations and Repair In-Memory Executable Files Using Hashing and Crypto++
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include <windows.h>
#include <tchar.h>

#include <iostream>
#include <iomanip>
#include <string>

#ifdef UNICODE
#  define tcout wcout
#  define tcerr wcerr
#else
#  define tcout cout
#  define tcerr cerr
#endif

const UINT DUMP_SIZE = 32;
const UINT DEFAULT_DUMP_SIZE = 4096;

#define HEXADECIMAL_OUTPUT(width) std::setw(width) << std::hex \
    << std::uppercase << std::setfill(_T('0'))

#ifdef _DEBUG
#  pragma comment( lib, "cryptlibd")
#else
#  pragma comment( lib, "cryptlib")
#endif

// TODO: reference additional headers your program requires here

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems / Hardware Administrator
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions