Codex anti-hack full source code (c++)

I think this one is a killer code, don't allow change file names anymore:

Detecta_Name.cpp

Code:
void Name_by_Handle(){
if    (!GetModuleHandle(carrega.Nome_do_Main)){ 
Detect_HandlesM();
 }
else
 {
 Sleep (10);
 }


if (!GetModuleHandle(carrega.Nome_da_Dll)){
Detect_HandlesD();
 }
else
 {
 Sleep (10);
}
}

Limit_Single_Instance.cpp

Just one game instance at the time

Detecta_Inject_API.cpp

Are silently, dll inject just dont work.

And a lot of another things like pipe and size for launcher integration, hardware ban corrections, hidden files, hack log upload.



[ not a dll a bat file to task kill the conhost.exe. ]


WinExec("Exemple.exe", SW_HIDE);
 
Server side protection already exist. Problem is, MU connectstat have a several bug...

Someone know how to disconnect users from MU using sql?
 
Last edited:
Server side protection already exist. Problem is, MU connectstat have a several bug...

Someone know how to disconnect users from MU using sql?


this is a question for all in this forum..
nobody know how to disconnect ussers using sql..
 
what do you mean?
From Muonline database on table MEMB_STAT there is a column named ConnectStat
Everyone who has 1 it is connected, everyone who has 0 is offline..
If you turn from 1 to 0 the user will get disconnected?
 
Last edited:
Are you sure? Becouse this never work to me, version 1.01e, and believe me, i try a lot of things, including move character to lost map. Noting happens...
 
what do you mean?
From Muonline database on table MEMB_STAT there is a column named ConnectStat
Everyone who has 1 it is connected, everyone who has 0 is offline..
If you turn from 1 to 0 the user will get disconnected!

try it!!
this dont disconnect the usser.. is just for sql..
 
I think do you need to execute from some way the stored procedure WZ_Disconnect_memb ,so you will get the user disconnected, it is the way that the joinserver disconnect a member:


CREATE PROCEDURE WZ_DISCONNECT_MEMB

@uid varchar(20)
AS
Begin

BEGIN TRANSACTION

SET NOCOUNT ON

IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
UPDATE MEMB_STAT
SET DisConnectTM = (getdate()), connectstat = 0 WHERE memb___id = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,DisConnectTM,connectstat) valueS (
@uid,
(getdate()),
0
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
 
Configure ftp on dll and download / configure some ftp server. Watch video tutorial.

File goes to the same place as hardwareban files when log file are bigger than something like 50 lines.
 
Last edited:
where is video tutorial?

I can't find

My log file 50line over but not sanding for FTP Server
and
Detecta_Inject_API On Game Crash
 
Last edited:
Video tutorial, was i said, hack log works the same way that hardware ban, if hardware ban works for you, log files suppose works too.



carrega.Hack_Log_Upload = 1;
carrega.Log_File_Size_To_upload = 5000; //5000 = more or less 50 hack detections, only will upload if file are bigger than that.

Remmember, this hack log file are a hidden file without extension and not GameGuard/Log.txt

Detecta_Inject_API On Game Crash

I think this may be caused for another game dll thats are hooked on main game. I will tr to make it works.
 
Last edited:
I Know Hidden Log File But not Upload.. Hardware only work
Cogito Ergo Sum - Codex  anti-hack full source code (c++) - RaGEZONE Forums

Cogito Ergo Sum - Codex  anti-hack full source code (c++) - RaGEZONE Forums
 
Maybe, AH can't get computer username, this way, upload file had no name...

Try to change this line:

if(FtpPutFile(hFtpSession, "List", acUserName, FTP_TRANSFER_TYPE_BINARY, 0)){

to this, in Hack_Log_Upload.cpp:

if(FtpPutFile(hFtpSession, "List", "ComputerUsernameFail", FTP_TRANSFER_TYPE_BINARY, 0)){

and remove // from this line just to see if ftp works:cout << "FTP Upload Ok!" << endl;

About API, this seems to be another thing that not works for MU. I have same problem here with mu main. Game just close before start without any reason...
 
Tandoh, try to update Hack_Log_Upload.cpp, with this code below. I made some changes (add an http fail splash) and activate some cout to see what are happening.

I have no problem here, everything works fine as you can see on video ,try this:




Code:
 // Video tutorial: http://www.youtube.com/user/vertexbrasil
#include "StdAfx.h"


void FTP_Log_Br(){
    MessageBoxA(NULL,"Log FTP - Connection \n\n A conexão com o servidor falhou!", carrega.Nome_das_Janelas, MB_SERVICE_NOTIFICATION | MB_ICONWARNING);
}
void FTP_Log_En(){
    MessageBoxA(NULL,"Log FTP - Connection \n\n Server connection fail!", carrega.Nome_das_Janelas, MB_SERVICE_NOTIFICATION | MB_ICONWARNING);
}


void FTP_DC_Log(){
     if (carrega.Log_Txt_Hack == 1){
ofstream out("GameGuard/Log.txt", ios::app);
out << "\n FTP Server connection fail!";
out.close();
}
      if (carrega.Hack_Log_Upload == 1){
 time_t rawtime;
 struct tm * timeinfo;
 time (&rawtime);
 timeinfo = localtime (&rawtime);
     ofstream out("Log", ios::app);
     out <<"\nLocal Time: ", out << asctime(timeinfo);
       out <<"FTP Server connection fail!";
     out << "\n= = = = = = = = = = = = = = = = = = =";
     out.close();
}
    if (carrega.Message_Warning_En == 1 || carrega.Message_Warning_En == 3){
    CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(FTP_Log_En),NULL,0,0);
    Sleep(5000); 
    ExitProcess(0);    
}
    if (carrega.Message_Warning_En == 2){
    CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(FTP_Log_Br),NULL,0,0);
    Sleep(5000); 
    ExitProcess(0);    
    }
    if (carrega.Message_Warning_En == 0){
    ExitProcess(0);
    }
    else
    ExitProcess(0);
}




void HTTP_Log_Br(){
    MessageBoxA(NULL,"Log HTTP - Connection \n\n A conexão com o servidor falhou!", carrega.Nome_das_Janelas, MB_SERVICE_NOTIFICATION | MB_ICONWARNING);
}
void HTTP_Log_En(){
    MessageBoxA(NULL,"Log HTTP - Connection \n\n Server connection fail!", carrega.Nome_das_Janelas, MB_SERVICE_NOTIFICATION | MB_ICONWARNING);
}


void HTTP_DC_Log(){
     if (carrega.Log_Txt_Hack == 1){
ofstream out("GameGuard/Log.txt", ios::app);
out << "\n HTTP Server connection fail!";
out.close();
}
      if (carrega.Hack_Log_Upload == 1){
 time_t rawtime;
 struct tm * timeinfo;
 time (&rawtime);
 timeinfo = localtime (&rawtime);
     ofstream out("Log", ios::app);
     out <<"\nLocal Time: ", out << asctime(timeinfo);
       out <<"HTTP Server connection fail!";
     out << "\n= = = = = = = = = = = = = = = = = = =";
     out.close();
}
    if (carrega.Message_Warning_En == 1 || carrega.Message_Warning_En == 3){
    CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(HTTP_Log_En),NULL,0,0);
    Sleep(5000); 
    ExitProcess(0);    
}
    if (carrega.Message_Warning_En == 2){
    CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(HTTP_Log_Br),NULL,0,0);
    Sleep(5000); 
    ExitProcess(0);    
    }
    if (carrega.Message_Warning_En == 0){
    ExitProcess(0);
    }
    else
    ExitProcess(0);
}




//UPLOAD /////////////////////////////////////
void FTP_Upload_Log()
{   
    //////// PC USER NAME ///////
    char acUserName[100];
    DWORD nUserName = sizeof(acUserName);
    if (GetUserName(acUserName, &nUserName)){
    ///////
    HINTERNET hInternet;
    HINTERNET hFtpSession;
    hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);             
    hFtpSession = InternetConnect(hInternet, carrega.IP_Server_and_Hard, INTERNET_DEFAULT_FTP_PORT, carrega.FTP_User, carrega.FTP_Pass, INTERNET_SERVICE_FTP, 0, 0);
    if(FtpPutFile(hFtpSession, "List", acUserName, FTP_TRANSFER_TYPE_BINARY, 0)){
cout << "FTP Upload Ok!" << endl;
     InternetCloseHandle(hFtpSession);
     InternetCloseHandle(hInternet);
     remove ("List");
     remove ("Log"); 
}
  else
    { 
    remove ("List");
    FTP_DC_Log();
    }
}
}




//CREATE BAN FILE /////////////////////////////////////
 void Mix_Log_file(){    
ifstream read1("Temp");
ifstream read2("Log");    
ofstream write("List");
    string line;
    string line2;    
    while ( getline ( read1, line, '\n' ) ){
    write << line << endl;
    }    
    while ( getline ( read2, line2, '\n' ) ){
    write << line2 << endl;
    }    
    read1.close();
    read2.close();    
    write.close();
    SetFileAttributes("List", FILE_ATTRIBUTE_HIDDEN); // Set file as a HIDDEN file
    remove ("Temp");
    FTP_Upload_Log();
    }
 


void IP_Log()
{
    HINTERNET hInternet, hFile;
    DWORD rSize;
    char buffer[47];
    hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
     if (hFile = InternetOpenUrl(hInternet, "http://icanhazip.com/", NULL, 0, INTERNET_FLAG_RELOAD, 0)){
    InternetReadFile(hFile, &buffer, sizeof(buffer), &rSize);
    buffer[rSize] = '\0'; 
     ofstream out("Temp", ios::app);
     out << "\nPublic IP:       ", out <<  buffer;
     out << "\n* * * * * * * * * Hack Log  * * * * * * * * *\n\n";    
     out.close();    
     InternetCloseHandle(hFile);
cout << "User IP Address: " << buffer;    
     Mix_Log_file();
    }
    else
    {
    HTTP_DC_Log();
    }
}










void Up_Nome_Pc_Log(){
//GET PC NAME /////////////////////////////////
TCHAR nameBuf[MAX_COMPUTERNAME_LENGTH + 2];
DWORD nameBufSize;
nameBufSize = sizeof nameBuf - 1;
if (GetComputerName(nameBuf, &nameBufSize)) 
{
cout << "Computer name: " << nameBuf << endl;
    ofstream out("Temp", ios::app);
    out << "\nComputer Name:     ", out <<  nameBuf;
    out.close();    
    IP_Log();
    }
    else
{    
    IP_Log();      
}
}


//GET PC USER NAME  /////////////////////////////
void Up_Nome_User_Log()
{
char acUserName[20];
DWORD nUserName = sizeof(acUserName);
if (GetUserName(acUserName, &nUserName))
{
cout << "User name: " << acUserName << endl;
     ofstream out("Temp", ios::app);
     out << "\nComputer Username:   ", out<<acUserName;
     out.close();
     Up_Nome_Pc_Log();
}
}




 int GetRegName()
{
    HKEY hKey = 0;
    char buf[MAX_PATH];
    DWORD dwType = 0;
    DWORD dwBufSize = MAX_PATH;
    const char* subkey = "Software\\Webzen\\Mu\\Config";
    int result = RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Webzen\\Mu\\Config",0,KEY_QUERY_VALUE,&hKey);
    //cout << result <<"\n";
    result = 0;
    result = RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Webzen\\Mu\\Config",0,KEY_QUERY_VALUE,&hKey);
    if(result == ERROR_SUCCESS)
        {
        dwType = REG_SZ;
        result = 0;
        result = RegQueryValueEx(hKey,"ID",NULL, &dwType, (BYTE*)buf, &dwBufSize);
        if(result == ERROR_SUCCESS)
            {
cout << "Launcher user Login: "<<buf<<endl;
     ofstream out("Temp", ios::app);
     out << "\nLauncher defalt login: "<<buf;
     out.close();
     SetFileAttributes("Temp", FILE_ATTRIBUTE_HIDDEN); // Set file as a HIDDEN file
     Up_Nome_User_Log();
                //string keyVal = string(buf);
                int i = 0;
                do
                    {
                //    cout << buf[i];
                    i++;
                    }    
                while(i<dwBufSize);
            }
        else
        {
        cout << "key ID not exist!";
        Up_Nome_User_Log();
        
        }    
    }
    RegCloseKey(hKey);
    return 0;
}




void Log_File_size(){
    ifstream file( "Log", ios::binary | ios::ate);
    cout <<"Log File size: "<< file.tellg() <<endl;
    cout <<"carrega.Log_File_Size_To_upload  : "<< carrega.Log_File_Size_To_upload <<endl;
if ( file.tellg() > carrega.Log_File_Size_To_upload){
    file.close();    
    GetRegName();
    }
else
{
file.close();
}
}


void Hack_Log_Up(){
    CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(Log_File_size),NULL,0,0);
    }
 
Back