Ver Mensaje Individual
  #22  
Antiguo 21-11-2016
Reasen Reasen is offline
Miembro
NULL
 
Registrado: dic 2015
Ubicación: Barcelona
Posts: 140
Reputación: 9
Reasen Va por buen camino
Paso a dejar un ejemplo para detectar "breakpoints de hardware" que es lo que se suele usar en herramientas de cracking
Si el valor no devuelve 0 esque alguien nos esta intentando crackear


Código Delphi [-]
function checkBP(): integer;
var
  NumBps: integer;
  Context: TContext;
  hThread: Thandle;
begin

  NumBps := 0;
  ZeroMemory(@Context, sizeof(TContext));
  Context.ContextFlags := CONTEXT_DEBUG_REGISTERS;
  hThread := GetCurrentThread();

  GetThreadContext(hThread, Context);

  if (Context.Dr0 = 0) = false then
    inc(NumBps);
  if (Context.Dr1 = 0) = false then
    inc(NumBps);
  if (Context.Dr2 = 0) = false then
    inc(NumBps);
  if (Context.Dr3 = 0) = false then
    inc(NumBps);

  result := NumBps;

end;


Esto no cubre breakpoints en memoria o código.
Este tipo de breakpoint lo suele usar el cracker si se le complica la situación, como encontrarse con un anti-debugger.
Responder Con Cita