Skip to content

Instantly share code, notes, and snippets.

@jixunmoe
Last active September 1, 2015 17:50
Show Gist options
  • Save jixunmoe/e3003f95fd4ceff645b1 to your computer and use it in GitHub Desktop.
Save jixunmoe/e3003f95fd4ceff645b1 to your computer and use it in GitHub Desktop.
NT88 Fake Lib.
// FakeLib.cpp : Defines the exported functions for the DLL application.
//
 
#include <windows.h>
#include "FakeLib.h"
 
int __stdcall _NT3DESCBCDecrypt(char* vi, char* pDataBuffer, int length)
{
    return 0;
}
 
int __stdcall _NT3DESCBCEncrypt(char* vi, char* pDataBuffer, int length)
{
    return 0;
}
 
int __stdcall _NTCheckLicense(int licenseCode)
{
    return 0;
}
 
int __stdcall _NTFindFirst(char* NTCode)
{
    return 0;
}
 
int __stdcall _NTGetHardwareID(char* hardwareID)
{
    return 0;
}
 
int __stdcall _NTLogin(char* LoginCode)
{
    return 0;
}
 
int __stdcall _NTLogout()
{
    return 0;
}
 
char* _dogData = "azmap09.........-1";
int __stdcall _NTRead(int address, int endAddress, char* pDataBuffer)
{
    int size = endAddress - address;
    DWORD oldProtect;
    VirtualProtect(pDataBuffer, size, PAGE_READWRITE, &oldProtect);
    memcpy(pDataBuffer, _dogData + address, size);
    VirtualProtect(pDataBuffer, size, oldProtect, &oldProtect);
    return 0;
}
 
int __stdcall _NTWrite(int address, int Length, char* pDataBuffer)
{
    return 0;
}
LIBRARY FakeLib
EXPORTS
NT3DESCBCDecrypt=_NT3DESCBCDecrypt
NT3DESCBCEncrypt=_NT3DESCBCEncrypt
NTCheckLicense=_NTCheckLicense
NTFindFirst=_NTFindFirst
NTGetHardwareID=_NTGetHardwareID
NTLogin=_NTLogin
NTLogout=_NTLogout
NTRead=_NTRead
NTWrite=_NTWrite
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the FAKELIB_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// FAKELIB_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef FAKELIB_EXPORTS
#define FAKELIB_API extern "C" __declspec(dllexport) int __stdcall
#else
#define FAKELIB_API __declspec(dllimport)
#endif
FAKELIB_API _NT3DESCBCDecrypt(char* vi, char* pDataBuffer, int length);
FAKELIB_API _NT3DESCBCEncrypt(char* vi, char* pDataBuffer, int length);
FAKELIB_API _NTCheckLicense(int licenseCode);
FAKELIB_API _NTFindFirst(char* NTCode);
FAKELIB_API _NTGetHardwareID(char* hardwareID);
FAKELIB_API _NTLogin(char* LoginCode);
FAKELIB_API _NTLogout();
FAKELIB_API _NTRead(int address, int Length, char* pDataBuffer);
FAKELIB_API _NTWrite(int address, int Length, char* pDataBuffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment