Permalink
Browse files

Add enableDRM() lua command.

This will make CE unreadable for normal windows API based memory scanners
  • Loading branch information...
1 parent a98b7bc commit 662cc7b25fd7d0fc378776e1b9711856d6916790 @cheat-engine committed Jan 11, 2017
@@ -7837,8 +7837,12 @@ function lua_copyMemory(L: Plua_State): integer; cdecl;
end;
end;
end;
+end;
-
+function lua_enableDRM(L: Plua_State): integer; cdecl;
+begin
+ DBK32Initialize;
+ dbk_enabledrm;
end;
procedure InitializeLua;
@@ -8343,6 +8347,7 @@ procedure InitializeLua;
lua_register(LuaVM, 'connectToCEServer', lua_connectToCEServer);
lua_register(LuaVM, 'copyMemory', lua_copyMemory);
+ lua_register(LuaVM, 'enableDRM', lua_enableDRM);
@@ -554,6 +554,7 @@ TMainForm = class(TForm)
procedure AddressKeyPress(Sender: TObject; var Key: char);
procedure FoundListDblClick(Sender: TObject);
procedure Browsethismemoryarrea1Click(Sender: TObject);
+ procedure testClick(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure UpdateTimerTimer(Sender: TObject);
procedure FreezeTimerTimer(Sender: TObject);
@@ -5359,6 +5360,11 @@ procedure TMainForm.Browsethismemoryarrea1Click(Sender: TObject);
end;
end;
+procedure TMainForm.testClick(Sender: TObject);
+begin
+ dbk_enabledrm;
+end;
+
procedure TMainForm.TrackBar1Change(Sender: TObject);
begin
@@ -15,7 +15,7 @@ interface
zstream, luafile, disassemblerComments, commonTypeDefs;
-var CurrentTableVersion: dword=24;
+var CurrentTableVersion: dword=25;
procedure protecttrainer(filename: string);
procedure unprotecttrainer(filename: string; stream: TStream);
procedure SaveTable(Filename: string; protect: boolean=false);
@@ -18,6 +18,8 @@ getCEVersion(): Returns a floating point value specifying the version of cheat e
activateProtection(): Prevents basic memory scanners from opening the cheat engine process
+enableDRM() : Prevents normal memory scanners from reading the Cheat Engine process (kernelmode)
+
fullAccess(address,size): Changes the protection of a block of memory to writable and executable
loadTable(filename, merge OPTIONAL): Loads a .ct or .cetrainer. If merge is provided and set to true it will not clear the old table
@@ -2238,6 +2240,7 @@ unmapMemory(address, mdl)
+
onAPIPointerChange(function): Registers a callback when an api pointer is changed (can happen when the user clicks ok in settings, or when dbk_use*** is used. Does NOT happen when setAPIPointer is called)
@@ -13,7 +13,7 @@ interface
-const currentversion=2000021;
+const currentversion=2000022;
const FILE_ANY_ACCESS=0;
const FILE_SPECIAL_ACCESS=FILE_ANY_ACCESS;
@@ -136,6 +136,9 @@ interface
const IOCTL_CE_ULTIMAP2_GETTRACESIZE = (IOCTL_UNKNOWN_BASE shl 16) or ($085a shl 2) or (METHOD_BUFFERED ) or (FILE_RW_ACCESS shl 14);
const IOCTL_CE_ULTIMAP2_RESETTRACESIZE= (IOCTL_UNKNOWN_BASE shl 16) or ($085b shl 2) or (METHOD_BUFFERED ) or (FILE_RW_ACCESS shl 14);
+const IOCTL_CE_ENABLE_DRM = (IOCTL_UNKNOWN_BASE shl 16) or ($085c shl 2) or (METHOD_BUFFERED ) or (FILE_RW_ACCESS shl 14);
+
+
type TDeviceIoControl=function(hDevice: THandle; dwIoControlCode: DWORD; lpInBuffer: Pointer; nInBufferSize: DWORD; lpOutBuffer: Pointer; nOutBufferSize: DWORD; var lpBytesReturned: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
@@ -340,6 +343,8 @@ procedure ultimap2_resume;
procedure ultimap2_lockfile(cpunr: integer);
procedure ultimap2_releasefile(cpunr: integer);
+procedure dbk_enabledrm;
+
{
const IOCTL_CE_ULTIMAP2_WAITFORDATA = (IOCTL_UNKNOWN_BASE shl 16) or ($0851 shl 2) or (METHOD_BUFFERED ) or (FILE_RW_ACCESS shl 14);
const IOCTL_CE_ULTIMAP2_CONTINUE = (IOCTL_UNKNOWN_BASE shl 16) or ($0852 shl 2) or (METHOD_BUFFERED ) or (FILE_RW_ACCESS shl 14);
@@ -589,6 +594,13 @@ procedure ultimap2_resetTraceSize;
deviceiocontrol(hdevice,IOCTL_CE_ULTIMAP2_RESETTRACESIZE,nil,0,nil,0,br,nil);
end;
+procedure dbk_enabledrm;
+var
+ br: dword;
+begin
+ deviceiocontrol(hdevice,IOCTL_CE_ENABLE_DRM,nil,0,nil,0,br,nil);
+end;
+
procedure dbk_test;
var cc,br: dword;
@@ -3,6 +3,7 @@ kernel: When using the processwatcher obtain handles for them on creation (use c
lua: Add the openFile equivalent for openProcess to lua
+lua: forms, add option to save the current state as base
ultimap2: Finish the timed/space based processing of file results
@@ -12,6 +13,7 @@ hexview: editing by typing chars seems broken (ascii)
memscan: Add a wincp scan option to text scans
+
symbol condig window: tab 0 isn't on the symbolname
lua:autoassembler: Make autoAssembler return the alloclist which can then be passed to disable scripts

0 comments on commit 662cc7b

Please sign in to comment.