Skip to content

Commit

Permalink
forgot to commit this
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jun 23, 2018
1 parent 1730f8e commit 97a246a
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 95 deletions.
8 changes: 2 additions & 6 deletions Cheat Engine/LuaHandler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5436,6 +5436,8 @@ function lua_dbvm_ept_reset(L: PLua_State): integer; cdecl;
result:=0;
end;



function lua_dbvm_log_cr3_start(L: PLua_State): integer; cdecl;
begin
lua_pushboolean(L, dbvm_log_cr3values_start);
Expand Down Expand Up @@ -8068,9 +8070,6 @@ function executeCode(L:PLua_state): integer; cdecl; //executecode(address, param
s.add('allocNX(result,4)');





s.add('stub:');
if processhandler.is64Bit then
begin
Expand All @@ -8088,9 +8087,6 @@ function executeCode(L:PLua_state): integer; cdecl; //executecode(address, param
s.add('ret 4');
end;




if processhandler.is64Bit then
begin
s.add('addressToCall:');
Expand Down
4 changes: 3 additions & 1 deletion Cheat Engine/MainUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6383,10 +6383,12 @@ procedure TMainForm.VarTypeChange(Sender: TObject);
end;

procedure TMainForm.LogoClick(Sender: TObject);
var s: string;
begin
s:=format('http://www.cheatengine.org/?referredby=CE%.2f',[ceversion]);
if messagedlg(rsDoYouWantToGoToTheCheatEngineWebsite, mtConfirmation,
[mbYes, mbNo], 0) = mrYes then
ShellExecute(0, PChar('open'), PChar('http://www.cheatengine.org/?referredby=CE67'),
ShellExecute(0, PChar('open'), PChar(s),
PChar(''), PChar(''), SW_MAXIMIZE);

end;
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/MainUnit2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ procedure initcetitle;



const beta=' B1'; //empty this for a release
const beta=''; //empty this for a release

var
CEnorm:string;
Expand Down
47 changes: 35 additions & 12 deletions Cheat Engine/MemoryBrowserFormUnit.lfm
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
object MemoryBrowser: TMemoryBrowser
Left = 1152
Height = 618
Top = 113
Left = 414
Height = 544
Top = 114
Width = 622
HelpContext = 12
Caption = 'Memory Viewer'
ClientHeight = 598
ClientHeight = 524
ClientWidth = 622
Menu = MainMenu1
OnActivate = FormActivate
Expand Down Expand Up @@ -495,18 +495,18 @@ object MemoryBrowser: TMemoryBrowser
end
object Panel4: TPanel
Left = 0
Height = 293
Height = 219
Top = 305
Width = 622
Align = alClient
BevelOuter = bvNone
BorderWidth = 1
ClientHeight = 293
ClientHeight = 219
ClientWidth = 622
TabOrder = 1
object Splitter3: TSplitter
Left = 406
Height = 291
Height = 217
Top = 1
Width = 5
Align = alRight
Expand All @@ -517,7 +517,7 @@ object MemoryBrowser: TMemoryBrowser
end
object Panel3: TPanel
Left = 1
Height = 291
Height = 217
Top = 1
Width = 405
Align = alClient
Expand All @@ -526,19 +526,19 @@ object MemoryBrowser: TMemoryBrowser
end
object pnlStacktrace: TPanel
Left = 411
Height = 291
Height = 217
Top = 1
Width = 210
Align = alRight
BevelInner = bvLowered
ClientHeight = 291
ClientHeight = 217
ClientWidth = 210
PopupMenu = pmStacktrace
TabOrder = 1
Visible = False
object lvStacktraceData: TListView
Left = 2
Height = 287
Height = 213
Hint = 'Shows the current stack.'#13#10'Tip: When doubleclicking the value and it represents an address, then you can hold shift to make it show in the disassembler, and ctrl to make it show in the memory view. Else Cheat Engine will guess it for you based on if it''s executable memory or not'
Top = 2
Width = 206
Expand Down Expand Up @@ -819,8 +819,31 @@ object MemoryBrowser: TMemoryBrowser
OnClick = Addthisaddresstothelist1Click
end
object Makepagewritable1: TMenuItem
Caption = 'Make page writable'
Caption = 'Change page protection'
OnClick = Makepagewritable1Click
object miChangeProtectionRWE: TMenuItem
Caption = 'Read Write Execute'
RadioItem = True
OnClick = miChangeProtectionClick
end
object miChangeProtectionRE: TMenuItem
Tag = 1
Caption = 'Read Execute'
RadioItem = True
OnClick = miChangeProtectionClick
end
object miChangeProtectionRW: TMenuItem
Tag = 2
Caption = 'Read Write'
RadioItem = True
OnClick = miChangeProtectionClick
end
object miChangeProtectionR: TMenuItem
Tag = 3
Caption = 'Read'
RadioItem = True
OnClick = miChangeProtectionClick
end
end
object MenuItem4: TMenuItem
Caption = 'Data Breakpoint'
Expand Down
6 changes: 5 additions & 1 deletion Cheat Engine/MemoryBrowserFormUnit.lrt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ TMEMORYBROWSER.MILOCK.CAPTION=Link with other hexview
TMEMORYBROWSER.MISHOWDIFFERENCE.CAPTION=Show difference
TMEMORYBROWSER.N1.CAPTION=-
TMEMORYBROWSER.ADDTHISADDRESSTOTHELIST1.CAPTION=Add this address to the list
TMEMORYBROWSER.MAKEPAGEWRITABLE1.CAPTION=Make page writable
TMEMORYBROWSER.MAKEPAGEWRITABLE1.CAPTION=Change page protection
TMEMORYBROWSER.MICHANGEPROTECTIONRWE.CAPTION=Read Write Execute
TMEMORYBROWSER.MICHANGEPROTECTIONRE.CAPTION=Read Execute
TMEMORYBROWSER.MICHANGEPROTECTIONRW.CAPTION=Read Write
TMEMORYBROWSER.MICHANGEPROTECTIONR.CAPTION=Read
TMEMORYBROWSER.MENUITEM4.CAPTION=Data Breakpoint
TMEMORYBROWSER.MENUITEM6.CAPTION=Break on Write
TMEMORYBROWSER.MENUITEM5.CAPTION=Break on Access
Expand Down
58 changes: 43 additions & 15 deletions Cheat Engine/MemoryBrowserFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ TMemoryBrowser = class(TForm)
MenuItem27: TMenuItem;
MenuItem28: TMenuItem;
MenuItem29: TMenuItem;
miChangeProtectionRWE: TMenuItem;
miChangeProtectionRE: TMenuItem;
miChangeProtectionRW: TMenuItem;
miChangeProtectionR: TMenuItem;
miTextEncodingCodePage: TMenuItem;
miSVCopy: TMenuItem;
miShowRelative: TMenuItem;
Expand Down Expand Up @@ -278,6 +282,7 @@ TMemoryBrowser = class(TForm)
zflabel: TLabel;
procedure FormActivate(Sender: TObject);
procedure GotoBookmarkClick(Sender: TObject);
procedure Makepagewritable1Click(Sender: TObject);
procedure memorypopupPopup(Sender: TObject);
procedure MenuItem10Click(Sender: TObject);
procedure MenuItem11Click(Sender: TObject);
Expand All @@ -292,6 +297,7 @@ TMemoryBrowser = class(TForm)
procedure MenuItem27Click(Sender: TObject);
procedure MenuItem29Click(Sender: TObject);
procedure miAddRefClick(Sender: TObject);
procedure miChangeProtectionClick(Sender: TObject);
procedure miHVBackClick(Sender: TObject);
procedure miHVFollowClick(Sender: TObject);
procedure miDebugSetAddressClick(Sender: TObject);
Expand Down Expand Up @@ -390,7 +396,6 @@ TMemoryBrowser = class(TForm)
procedure Changestateofregisteratthislocation1Click(Sender: TObject);
procedure miTogglebreakpointClick(Sender: TObject);
procedure Breakpointlist1Click(Sender: TObject);
procedure Makepagewritable1Click(Sender: TObject);
procedure Dissectdata1Click(Sender: TObject);
procedure Showsymbols1Click(Sender: TObject);
procedure miDissectDataClick(Sender: TObject);
Expand Down Expand Up @@ -862,6 +867,8 @@ procedure TMemoryBrowser.memorypopupPopup(Sender: TObject);
islocked: boolean;
a,a2: ptruint;
hasbp: boolean;

mbi: TMEMORYBASICINFORMATION;
begin
miShowDifference.clear;
miLock.Clear;
Expand Down Expand Up @@ -944,6 +951,21 @@ procedure TMemoryBrowser.memorypopupPopup(Sender: TObject);

miHVBack.visible:=hexview.hasBackList;
miShowRelative.checked:=hexview.UseRelativeBase;



miChangeProtectionRWE.checked:=false;
miChangeProtectionRE.checked:=false;
miChangeProtectionRW.checked:=false;
miChangeProtectionR.checked:=false;
if VirtualQueryEx(processhandle, pointer(hexview.Address), mbi, sizeof(mbi))=sizeof(mbi) then
begin
miChangeProtectionRWE.checked:=((mbi.Protect and PAGE_EXECUTE_READWRITE)=PAGE_EXECUTE_READWRITE) or ((mbi.Protect and PAGE_EXECUTE_WRITECOPY)=PAGE_EXECUTE_WRITECOPY);
miChangeProtectionRE.checked:=((mbi.Protect and PAGE_EXECUTE)=PAGE_EXECUTE) or ((mbi.Protect and PAGE_EXECUTE_READ)=PAGE_EXECUTE_READ);
miChangeProtectionRW.checked:=((mbi.Protect and PAGE_READWRITE)=PAGE_READWRITE) or ((mbi.Protect and PAGE_WRITECOPY)=PAGE_WRITECOPY);
miChangeProtectionR.checked:=((mbi.Protect and PAGE_READONLY)=PAGE_READONLY);
end;

end;


Expand Down Expand Up @@ -1197,6 +1219,21 @@ procedure TMemoryBrowser.miAddRefClick(Sender: TObject);
end;
end;

procedure TMemoryBrowser.miChangeProtectionClick(Sender: TObject);
var
protection: dword;
oldprotect: dword;
begin
case (sender as TMenuItem).Tag of
0: protection:=PAGE_EXECUTE_READWRITE;
1: protection:=PAGE_EXECUTE_READ;
2: protection:=PAGE_READWRITE;
3: protection:=PAGE_READONLY;
end;

VirtualProtectEx(processhandle, pointer(hexview.Address),1,protection, oldprotect);
end;

procedure TMemoryBrowser.miHVBackClick(Sender: TObject);
begin
hexview.back;
Expand Down Expand Up @@ -1256,6 +1293,10 @@ procedure TMemoryBrowser.GotoBookmarkClick(Sender: TObject);
disassemblerview.SelectedAddress:=newaddress;
end;

procedure TMemoryBrowser.Makepagewritable1Click(Sender: TObject);
begin
end;

procedure TMemoryBrowser.FormActivate(Sender: TObject);
begin
disassemblerview.LastFormActiveEvent:=getTickCount64;
Expand Down Expand Up @@ -2965,9 +3006,7 @@ procedure TMemoryBrowser.Reservememory1Click(Sender: TObject);

baseaddress:=nil;

baseaddress:=VirtualAllocEx(processhandle,nil,memsize,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
// baseaddress:=VirtualAllocEx(processhandle,nil,memsize,MEM_COMMIT,PAGE_READWRITE);

baseaddress:=VirtualAllocEx(processhandle,nil,memsize,MEM_COMMIT or MEM_RESERVE,PAGE_EXECUTE_READWRITE);
if baseaddress=nil then
raise exception.Create(rsErrorAllocatingMemory);

Expand Down Expand Up @@ -3245,18 +3284,7 @@ procedure TMemoryBrowser.Breakpointlist1Click(Sender: TObject);
end;


procedure TMemoryBrowser.Makepagewritable1Click(Sender: TObject);
var x: dword;
begin
//todo: change to changhe protection submenu
if VirtualProtectEx(processhandle,pointer(memoryaddress),4096,PAGE_EXECUTE_READWRITE,x)=false then

// if VirtualProtectEx(processhandle,pointer(memoryaddress),4096,PAGE_EXECUTE_READWRITE,x)=false then
showmessage('Failure. Error:'+inttostr(getlasterror));
// if (memoryaddress>80000000) and (DarkByteKernel<>0) then
// MakeWritableEx(processhandle,memoryaddress,4096,false);

end;

procedure TMemoryBrowser.Dissectdata1Click(Sender: TObject);
begin
Expand Down
6 changes: 3 additions & 3 deletions Cheat Engine/aboutunit.lfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object About: TAbout
Left = 408
Left = 1224
Height = 310
Top = 207
Top = 466
Width = 488
HelpContext = 2
AutoSize = True
Expand All @@ -21,7 +21,7 @@ object About: TAbout
Width = 488
Align = alClient
AutoSize = True
Caption = 'Cheat Engine 6.8'
Caption = 'Cheat Engine 6.8.1'
ClientHeight = 290
ClientWidth = 484
TabOrder = 0
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/aboutunit.lrt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TABOUT.CAPTION=About Cheat Engine
TABOUT.GROUPBOX1.CAPTION=Cheat Engine 6.8
TABOUT.GROUPBOX1.CAPTION=Cheat Engine 6.8.1
TABOUT.LABEL2.CAPTION=Special thanks to:
TABOUT.LABEL5.CAPTION=And all the other people that helped me out
TABOUT.LABEL10.CAPTION=Script engine powered by Lua
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/cheatengine.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ procedure TFormFucker.addFormEvent(Sender: TObject; Form: TCustomForm);

path: string;
begin
Application.Title:='Cheat Engine 6.8';
Application.Title:='Cheat Engine 6.8.1';
Application.Initialize;

overridefont:=nil;
Expand Down
6 changes: 6 additions & 0 deletions Cheat Engine/dbk32/vmxfunctions.pas
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ interface
VMCALL_RAISEPMI = 55;
VMCALL_ULTIMAP2_HIDERANGEUSAGE = 56;

VMCALL_ADD_MEMORY = 57;
VMCALL_DISABLE_EPT = 58;



//---
Expand Down Expand Up @@ -370,6 +373,8 @@ function dbvm_cloak_removechangeregonbp(PhysicalAddress: QWORD): integer;

procedure dbvm_ept_reset;



function dbvm_log_cr3values_start: boolean;
function dbvm_log_cr3values_stop(log: pointer): boolean;

Expand Down Expand Up @@ -1458,6 +1463,7 @@ function dbvm_cloak_removechangeregonbp(PhysicalAddress: QWORD): integer;
result:=vmcall(@vmcallinfo,vmx_password1);
end;


procedure dbvm_ept_reset;
var vmcallinfo: packed record
structsize: dword;
Expand Down
Loading

0 comments on commit 97a246a

Please sign in to comment.