Siga-nos em...
Follow us on Twitter Follow us on Facebook Watch us on YouTube
Registro

Alpha Servers
Resultados 1 a 4 de 4

Visão do Encadeamento

  1. #1

    Avatar de Sain
    Data de Ingresso
    Mar 2014
    Localização
    Porto Alegre
    Idade
    27
    Posts
    55
    Agradecido
    38
    Agradeceu
    19
    Peso da Avaliação
    11

    Padrão Proteção contra debuggers e Ant Inject

    Achei perdido no meu PC, a função do mesmo é fazer checagem de debuggers e dll inject no executavel do jogo, é bem simples, mas serve como base para quem está começando a desenvolver proteções para games

    Código PHP:
    {
        
    Versãov.1.0
        Autor
    z0pe
        
    }
        
    library Imperyus;
        
    uses
          SysUtils
    ,
          
    Classes,
          
    Windows,
          
    Dialogs,
          
    TLHelp32,
          
    PsAPI,
          
    Messages;
        {
    $R *.res}
        
    //var ThreadID: Dword;
        
    function FinalizarJogo(sFileString): Boolean;
        var
          
    verSystemTOSVersionInfo;
          
    hdlSnap,hdlProcessTHandle;
          
    bPath,bLoopBool;
          
    peEntryTProcessEntry32;
          
    arrPid: Array [0..1023of DWORD;
          
    iCDWord;
          
    k,iCountInteger;
          
    arrModul: Array [0..299of Char;
          
    hdlModulHMODULE;
        
    begin
          Result 
    := False;
          if 
    ExtractFileName(sFile)=sFile then
                bPath
    :=false
          
    else
                
    bPath:=true;
          
    verSystem.dwOSVersionInfoSize:=SizeOf(TOSVersionInfo);
          
    GetVersionEx(verSystem);
          if 
    verSystem.dwPlatformId=VER_PLATFORM_WIN32_WINDOWS then
          begin
                hdlSnap
    :=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS0);
                
    peEntry.dwSize:=Sizeof(peEntry);
                
    bLoop:=Process32First(hdlSnap,peEntry);
                while 
    integer(bLoop)<>do
                
    begin
                  
    if bPath then
                  begin
                        
    if CompareText(peEntry.szExeFile,sFile) = 0 then
                        begin
                          TerminateProcess
    (OpenProcess(PROCESS_TERMINATE,false,peEnt&#8203;ry.th32ProcessID), 0);
                          
    Result := True;
                        
    end;
                  
    end
                  
    else
                  
    begin
                        
    if CompareText(ExtractFileName(peEntry.szExeFile),sFile) = 0 then
                        begin
                          TerminateProcess
    (OpenProcess(PROCESS_TERMINATE,false,peEnt&#8203;ry.th32ProcessID), 0);
                          
    Result := True;
                        
    end;
                  
    end;
                  
    bLoop := Process32Next(hdlSnap,peEntry);
                
    end;
                
    CloseHandle(hdlSnap);
          
    end
          
    else
                if 
    verSystem.dwPlatformId=VER_PLATFORM_WIN32_NT then
                begin
                  EnumProcesses
    (@arrPid,SizeOf(arrPid),iC);
                  
    iCount := iC div SizeOf(DWORD);
                  for 
    := 0 to Pred(iCount) do
                  
    begin
                        hdlProcess
    :=OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,false,arrPid [k]);
                        if (
    hdlProcess<>0then
                        begin
                          EnumProcessModules
    (hdlProcess,@hdlModul,SizeOf(hdlModul),i&#8203;C);
                          
    GetModuleFilenameEx(hdlProcess,hdlModul,arrModul,SizeOf(ar&#8203;rModul));
                          
    if bPath then
                          begin
                                
    if CompareText(arrModul,sFile) = 0 then
                                begin
                                  TerminateProcess
    (OpenProcess(PROCESS_TERMINATE or PROCESS_QUERY_INFORMATION,False,arrPid [k]), 0);
                                  
    Result := True;
                                
    end;
                          
    end
                          
    else
                          
    begin
                                
    if CompareText(ExtractFileName(arrModul),sFile) = 0 then
                                begin
                                  TerminateProcess
    (OpenProcess(PROCESS_TERMINATE or PROCESS_QUERY_INFORMATION,False,arrPid [k]), 0);
                                  
    Result := True;
                                
    end;
                          
    end;
                          
    CloseHandle(hdlProcess);
                        
    end;
                  
    end;
                
    end;
        
    end;
        function 
    Hack(exeFileNamestring): Boolean;
        var
          
    ContinueLoopBOOL;
        
    FSnapshotHandleTHandle;
        
    FProcessEntry32TProcessEntry32;
        
    begin
        FSnapshotHandle 
    := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS0);
        
    FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
        
    ContinueLoop := Process32First(FSnapshotHandleFProcessEntry32);
        
    Result := False;
        while 
    Integer(ContinueLoop) <> do
        
    begin
                        
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
                          
    UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
                         
    UpperCase(ExeFileName))) then
        begin
        Result 
    := True;
        
    end;
        
    ContinueLoop := Process32Next(FSnapshotHandleFProcessEntry32);
        
    end;
        
    CloseHandle(FSnapshotHandle);
        
    end;
        
    procedure Finalize2;
        
    begin
          
    if Hack('Main.exe'then
          begin
                FinalizarJogo
    ('Main.exe');
          
    end;
          if 
    Hack('Open.exe'then
          begin
                FinalizarJogo
    ('Open.exe');
          
    end;
        
    end;
        
    //end;
        
    procedure AntHack;
        var
          
    ThreadID2Programa DWORD;
        
    begin
          Programa 
    := FindWindow(nil,'Form1');
          while 
    Programa do
          
    begin
                Sleep
    (2000);
          if (
    FindWindow('Window',nil) > 0) or (Hack('cheatengine-i386.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          break;
          
    end;
           
    Sleep(2000);
                if (
    FindWindow(nil,'Cheat Engine 6.2') > 0) or (Hack('cheatengine-i386.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
           
    Sleep(2000);
                if (
    FindWindow(nil,'Cheat Engine 6.1') > 0) or (Hack('cheatengine-i386.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
           
    Sleep(2000);
                if (
    FindWindow(nil,'Cheat Engine 6.0') > 0) or (Hack('cheatengine-i386.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
           
    Sleep(2000);
                if (
    FindWindow(nil,'Cheat Engine 5.6.1') > 0) or (Hack('cheatengine-i386.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
           
    Sleep(2000);
                if (
    FindWindow('OLLYDBG',nil) > 0) or (Hack('OLLYDBG.EXE')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
           
    Sleep(2000);
                  if (
    FindWindow(nil,'Autostart And Process Viewer:www.konrado.com') > 0) or (Hack('autostart_and_process_viewer.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
           
    Sleep(2000);
           if (
    FindWindow('PROCEXPL',nil) > 0) or (Hack('Sigma Explorer.exe')) then
          begin
          CreateThread
    (nil,ThreadID2,@Finalize2,nil,ThreadID2,ThreadID2);
          Break;
          
    end;
          
    end;
        
    end;
        
    procedure hook(targetnewfunc:pointer);
        var
          
    jmpto:dword;
                
    OldProtectCardinal// old protect in memory
        
    begin
          jmpto
    :=dword(newfunc)-dword(target)-5;
          
    VirtualProtect(target5PAGE_EXECUTE_READWRITE, @OldProtect);
          
    pbyte(target)^:=$e9;
          
    pdword(dword(target)+1)^:=jmpto;
        
    end;
        var
          
    ThreadID3DWORD;
        
    procedure myLdrLoadDll(PathToFile:PAnsiCharFlags:variantModuleFileName:PAnsiChar; var ModuleHandle:THandle);
        
    begin
           CreateThread
    (nil,ThreadID3,@Finalize2,nil,ThreadID3,ThreadID3);
           
    ModuleHandle:=0;
        
    end;
        
    procedure AntDLL;
        var
          
    Programa1 DWORD;
        
    begin
          Programa1
    := FindWindow(nil,'Main');
          while 
    Programa1 do
          
    begin
        Hook
    (GetProcAddress(GetModuleHandle('ntdll.dll'), 'LdrLoadDll'), @myLdrLoadDll);
        Break;
        
    end;
        
    end;
        var
           
    ThreadID,ThreadID2:DWORD;
        
    begin
          CreateThread
    (nil,ThreadID2,@AntDLL,nil,ThreadID2,ThreadID2);
          
    CreateThread(nil,ThreadID,@AntHack,nil,ThreadID,ThreadID);
        
    end
    Créditos:
    z0pe
    "Pesquisar, desenvolver, solucionar e comercializar serviços de web design de alta qualidade buscando a melhoria continua de web"
    Hidden Content

  2. O Seguinte Usuário Agradeceu Sain Por este Post Útil:


 

 

Informações de Tópico

Usuários Navegando neste Tópico

Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)

Tópicos Similares

  1. |Dúvida| Proteção contra ataque a site.
    Por rodrigopf no fórum Dúvidas|Pedidos
    Respostas: 3
    Último Post: 14-10-2015, 06:32 PM
  2. |Jobs/Query| Fix - Proteção contra Brute Force para Effect-Web
    Por GuilhermeSouza no fórum Flood Livre
    Respostas: 4
    Último Post: 13-10-2015, 06:47 PM
  3. |Source| Proteção contra Skill Bug
    Por Getulio no fórum Sources
    Respostas: 0
    Último Post: 02-04-2012, 01:39 AM
  4. |Source| Proteção contra Trade Hack
    Por Getulio no fórum Sources
    Respostas: 0
    Último Post: 01-04-2012, 04:17 AM
  5. |Notícia| Windows 8 terá nova proteção contra pirataria
    Por Matcher no fórum Windows
    Respostas: 1
    Último Post: 09-04-2011, 12:10 PM

Marcadores

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •