GameSama Blog
HackShield for Your RAN Server
SeiferXIII 2015-06-26 00:00:00
NOTE: NEVER EVER REPLICATE THIS GUIDE TO ANY FORUMS JUST FOR YOUR OWN FAME. IF YOU DO THAT, SHAME ON YOU.
Guide how to Integrate HackShield for your RAN Online Private Server
Prerequisites:
- HackShield SDK 5.6.6.1 (v235) [ Download]
- HackShield Client Files [ Download]
- RAN Online Source Code
- Once your RanOnline.exe done compiling, rename it to MiniA.exe
Steps:
1. Put the HackShield SDK to your Source Code Folder, and name it HackShield SDK then put the Files inside HackShield_ToClient.rar to your RAN Server Folder.
On Solution Explorer, Right Click Basic ► Properties ► Linker ► Input
Paste this below the list
"$(SolutionDir)/HackShield SDK/Lib/Win/x86/Single-Threaded/HShield/HShield.lib" "$(SolutionDir)/HackShield SDK/Lib/Win/x86/Single-Threaded/Update/HSUpChk.lib"
Find UINT_QUEUE g_AuthMsgBuffer;
Paste this below the said line
TCHAR g_szHShieldPath[MAX_PATH] = {0,}; TCHAR g_szIniPath[MAX_PATH] = {0,};
2. Go to your SourceBasic then Open BasicWndD3d.cpp
Paste this below #include ".basicwnd.h"
#include "../HackShield SDK/Include/HShield.h" #include "../HackShield SDK/Include/HSUpChk.h" #pragma comment(lib,"../HackShield SDK/Lib/Win/x86/Single-Threaded/HShield/HShield.lib") #pragma comment(lib,"../HackShield SDK/Lib/Win/x86/Single-Threaded/Update/HSUpChk.lib")
3. Find the function BOOL CALLBACK NPGameMonCallback(DWORD dwMsg, DWORD dwArg)
Paste this below the said function
/** HackShield Start - Glory to God to the Highest! SeiferXIII **/ int __stdcall AhnHS_Callback(long lCode, long lParamSize, void* pParam) { bool bAppExit( false ); LPCTSTR lpszMsg( NULL ); switch(lCode) { //Engine Callback case AHNHS_ENGINE_DETECT_GAME_HACK: { TCHAR msg[128]={0}; _stprintf(msg, _T("Game Hack foundn%s"), (char*)pParam); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ENGINE_DETECT_WINDOWED_HACK: { //ShowMsgAndExitWithTimer(_T("Windowed Hack found.")); break; } case AHNHS_ACTAPC_DETECT_SPEEDHACK: { TCHAR msg[128]={0}; _stprintf(msg, _T("Speed Hack found.")); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_KDTRACE: case AHNHS_ACTAPC_DETECT_KDTRACE_CHANGED: { TCHAR msg[128]={0}; _stprintf(msg, _T("AHNHS_ACTAPC_DETECT_KDTRACE_CHANGED"), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_AUTOMACRO: { TCHAR msg[128]={0}; _stprintf(msg, _T("AHNHS_ACTAPC_DETECT_AUTOMACRO"), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_ABNORMAL_FUNCTION_CALL: { TCHAR msg[128]={0}; _stprintf(msg, _T("Detect Abnormal Memory Accessn%s"), (char*)pParam); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_ABNORMAL_MEMORY_ACCESS: { TCHAR msg[128]={0}; _stprintf(msg, _T("Detect Memory Accessn%s"), (char*)pParam); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_AUTOMOUSE: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield DETECT_AUTOMOUSE."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_DRIVERFAILED: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield DETECT_DRIVERFAILED."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_HOOKFUNCTION: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield Detect D3D Hack. (%s)"), (char*)pParam); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_MESSAGEHOOK: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield DETECT_MESSAGEHOOK."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_MODULE_CHANGE: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield DETECT_MODULE_CHANGE."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_ENGINEFAILED: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield DETECT_ENGINEFAILED."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case HS_ERR_ALREADY_GAME_STARTED: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield already started."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); } break; case AHNHS_ACTAPC_DETECT_CODEMISMATCH: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield CODEMISMATCH."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_MEM_MODIFY_FROM_LMP: case AHNHS_ACTAPC_DETECT_LMP_FAILED: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield Detect memory modify."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } case AHNHS_ACTAPC_DETECT_ABNORMAL_HACKSHIELD_STATUS: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield Service Error"), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; //} } case AHNHS_ACTAPC_DETECT_PROTECTSCREENFAILED: { TCHAR msg[128]={0}; _stprintf(msg, _T("HackShield PROTECTSCREENFAILED."), lCode); DxGlobalStage::GetInstance().CloseGame( msg ); break; } return FALSE; }return TRUE; }
4. Find the function HRESULT CBasicWnd::InitDeviceObjects()
Paste this inside the said function after HRESULT hr = S_OK;
/** HackShield Start - Glory to God to the Highest! SeiferXIII **/ { int antihackNotFound = 0; TCHAR *pEnd = NULL; TCHAR szFullFileName[MAX_PATH] = { 0, }; TCHAR szMsg[255]; int nRet; GetModuleFileName(NULL, szFullFileName, MAX_PATH); pEnd = _tcsrchr( szFullFileName, _T('\')) + 1; if (!pEnd) { return FALSE; } *pEnd = _T(' '); _stprintf(g_szIniPath, _T("%s"), szFullFileName); _stprintf(g_szHShieldPath, _T("%s\HackShield"), szFullFileName); _tcscat(szFullFileName, _T("HackShield\EhSvc.dll")); _tcscat(g_szIniPath, _T("MiniAEnv.INI")); /*AHNHS_EXT_ERRORINFO HsExtError; sprintf( HsExtError.szServer, "%s", "210.121.169.209" ); sprintf( HsExtError.szUserId, "%s", "GameUser" ); sprintf( HsExtError.szGameVersion, "%s", "1.0.0.1" );*/ /*DWORD dwResult = _AhnHS_HSUpdate(g_szHShieldPath, 1000 * 600); if (dwResult != 0) { _stprintf(szMsg, _T("HackShield Update Failed. Folder HShield or HSUpdate.exe is missing from your computer(Error Code = %x)."), nRet); MessageBox(NULL, szMsg, "GameSama.com", MB_OK); return FALSE; } dwResult = _AhnHS_HSUpdateEx(g_szHShieldPath, 1000 * 600,1000 ,AHNHSUPDATE_CHKOPT_HOSTFILE| AHNHSUPDATE_CHKOPT_GAMECODE, HsExtError, 1000* 20 ); nRet = _AhnHS_StartMonitor( HsExtError, szFullFileName ); if (nRet != HS_ERR_OK) { _stprintf(szMsg, _T("HackShield Load Error. Folder HShield is missing from your computer(Error Code = %x)."), nRet); MessageBox(NULL, szMsg, "GameSama.com", MB_OK); return FALSE; }*/ nRet = _AhnHS_Initialize(szFullFileName, AhnHS_Callback, 1000, "B228F2916A48AC24", AHNHS_CHKOPT_ALL|AHNHS_SELFDESTRUCTION_RATIO_FAST| AHNHS_DISPLAY_HACKSHIELD_TRAYICON|AHNHS_CHKOPT_STANDALONE| AHNHS_CHKOPT_LOADLIBRARY| AHNHS_CHKOPT_LOCAL_MEMORY_PROTECTION, AHNHS_SPEEDHACK_SENSING_RATIO_GAME); if (nRet != HS_ERR_OK) { _stprintf(szMsg, _T("HackShield Initialize Error. (Error Code = %x)."), nRet); MessageBox(szMsg, "GameSama.com", MB_OK); return FALSE; } nRet = _AhnHS_StartService(); assert(nRet != HS_ERR_NOT_INITIALIZED); assert(nRet != HS_ERR_ALREADY_SERVICE_RUNNING); if (nRet != HS_ERR_OK) { _stprintf(szMsg, _T("HackShield Start Error. (Error Code = %x)."), nRet); MessageBox(szMsg, "GameSama.com", MB_OK); return FALSE; } } /** HackShield End - To God be the Glory!**/
5. Now you're done!