default.cpp

来自「数据加密算法」· C++ 代码 · 共 51 行

CPP
51
字号
#include <windows.h>
#include "mirager.h"
#pragma hdrstop

static RoutineEntry g_stRoutineEntry ;

extern "C" 
BOOL CALLBACK LPWSTRDecoder ( LPVOID lpAddress , CHAR* lpBuf )
{
	LPVOID addr = ( LPVOID ) g_stRoutineEntry.m_pfnReadDWord ( 
		g_stRoutineEntry.m_hControl , lpAddress ) ;		/* 获得字符串的首地址 */

	if ( 0 == g_stRoutineEntry.m_pfnReadStringW ( 
		g_stRoutineEntry.m_hControl ,
		addr ,
		lpBuf ) )
		return FALSE ;						/* 失败 */

	return TRUE ;
}

extern "C" 
BOOL CALLBACK LPSTRDecoder ( LPVOID lpAddress , CHAR* lpBuf )
{
	LPVOID addr = ( LPVOID ) g_stRoutineEntry.m_pfnReadDWord ( 
		g_stRoutineEntry.m_hControl , lpAddress ) ;		/* 获得字符串的首地址 */

	if ( 0 == g_stRoutineEntry.m_pfnReadString ( 
		g_stRoutineEntry.m_hControl ,
		addr ,
		lpBuf ) )
		return FALSE ;						/* 失败 */

	return TRUE ;
}

extern "C" __declspec(dllexport)
void CALLBACK LoadRoutine ( RoutineEntry* lpRoutineEntry )
{
	g_stRoutineEntry = *lpRoutineEntry ;

	g_stRoutineEntry.m_pfnRegisterDecoder (
		g_stRoutineEntry.m_hControl ,
		"LPWSTR",
		LPWSTRDecoder ) ;

	g_stRoutineEntry.m_pfnRegisterDecoder (
		g_stRoutineEntry.m_hControl ,
		"LPSTR",
		LPSTRDecoder ) ;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?