Changeset 307

Show
Ignore:
Timestamp:
01/11/10 01:02:39 (2 months ago)
Author:
dark_byte
Message:

fixed advanced options no rightclick browse and marking changed entries red

Location:
Cheat Engine
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • Cheat Engine/AdvancedOptionsUnit.dfm

    r306 r307  
    165165    TabOrder = 2 
    166166    ViewStyle = vsReport 
     167    OnCustomDrawItem = Codelist2CustomDrawItem 
    167168    OnDblClick = Codelist2DblClick 
    168169  end 
     
    174175      Caption = 'Open the disassembler at this location' 
    175176      Default = True 
     177      OnClick = Codelist2DblClick 
    176178    end 
    177179    object N2: TMenuItem 
  • Cheat Engine/AdvancedOptionsUnit.pas

    r306 r307  
    5757    procedure Codelist2DblClick(Sender: TObject); 
    5858    procedure Panel2Resize(Sender: TObject); 
     59    procedure Codelist2CustomDrawItem(Sender: TCustomListView; 
     60      Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); 
    5961  private 
    6062    { Private declarations } 
     
    904906var mi: TModuleInfo; 
    905907begin 
    906   if code[codelist2.itemindex].modulename<>'' then 
    907   begin 
    908     symhandler.getmodulebyname(code[codelist2.itemindex].modulename,mi); 
    909     code[codelist2.itemindex].Address:=mi.baseaddress+code[codelist2.itemindex].offset; 
    910   end; 
    911      
    912   memorybrowser.disassemblerview.SelectedAddress:=code[codelist2.itemindex].Address; 
    913  
    914   if memorybrowser.Height<(memorybrowser.Panel1.Height+100) then memorybrowser.height:=memorybrowser.Panel1.Height+100; 
    915   memorybrowser.panel1.visible:=true; 
    916   memorybrowser.show; 
     908  if codelist2.itemindex<>-1 then 
     909  begin 
     910    if code[codelist2.itemindex].modulename<>'' then 
     911    begin 
     912      symhandler.getmodulebyname(code[codelist2.itemindex].modulename,mi); 
     913      code[codelist2.itemindex].Address:=mi.baseaddress+code[codelist2.itemindex].offset; 
     914    end; 
     915 
     916    memorybrowser.disassemblerview.SelectedAddress:=code[codelist2.itemindex].Address; 
     917 
     918    if memorybrowser.Height<(memorybrowser.Panel1.Height+100) then memorybrowser.height:=memorybrowser.Panel1.Height+100; 
     919    memorybrowser.panel1.visible:=true; 
     920    memorybrowser.show; 
     921  end; 
    917922end; 
    918923 
     
    922927end; 
    923928 
     929procedure TAdvancedOptions.Codelist2CustomDrawItem(Sender: TCustomListView; 
     930  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); 
     931begin 
     932  if code[item.index].changed then sender.Canvas.Font.Color:=clred; 
     933end; 
     934 
    924935end. 
  • Cheat Engine/CEFuncProc.pas

    r305 r307  
    24042404var sl: tstringlist; 
    24052405    i: integer; 
     2406    pli: PProcessListInfo; 
    24062407begin 
    24072408  sl:=tstringlist.create; 
     
    24102411    for i:=0 to processlist.Items.count-1 do 
    24112412      if processlist.Items.Objects[i]<>nil then 
    2412         freemem(pointer(processlist.Items.Objects[i])); 
     2413      begin 
     2414        pli:=pointer(processlist.Items.Objects[i]); 
     2415        if pli.processIcon>0 then 
     2416          DestroyIcon(pli.processIcon); 
     2417        freemem(pli); 
     2418      end; 
    24132419 
    24142420    processlist.Items.Clear; 
     
    24562462  for i:=0 to processlist.count-1 do 
    24572463    if processlist.Objects[i]<>nil then 
    2458       freemem(pointer(processlist.Objects[i])); 
     2464    begin 
     2465      ProcessListInfo:= pointer( processlist.Objects[i]); 
     2466      if ProcessListInfo.processIcon>0 then 
     2467        DestroyIcon(ProcessListInfo.processIcon); 
     2468      freemem(ProcessListInfo); 
     2469    end; 
    24592470 
    24602471  processlist.clear; 
  • Cheat Engine/MainUnit.dfm

    r306 r307  
    27102710    end 
    27112711  end 
    2712   object Timer4: TTimer 
    2713     Enabled = False 
    2714     Interval = 4000 
    2715     OnTimer = Timer4Timer 
    2716     Left = 16 
    2717     Top = 264 
    2718   end 
    27192712  object ActionList1: TActionList 
    27202713    Images = ImageList1 
  • Cheat Engine/MainUnit.pas

    r306 r307  
    156156    Value1: TMenuItem; 
    157157    LabelModifiedmem: TLabel; 
    158     Timer4: TTimer; 
    159158    pnlFloat: TPanel; 
    160159    rt3: TRadioButton; 
     
    387386    procedure Value1Click(Sender: TObject); 
    388387    procedure ProcessLabelDblClick(Sender: TObject); 
    389     procedure Timer4Timer(Sender: TObject); 
    390388    procedure ProcessLabelMouseDown(Sender: TObject; Button: TMouseButton; 
    391389      Shift: TShiftState; X, Y: Integer); 
     
    1000710005end; 
    1000810006 
    10009 procedure TMainForm.Timer4Timer(Sender: TObject); 
    10010 begin 
    10011   LabelModifiedmem.visible:=false; 
    10012   timer4.Enabled:=false; 
    10013 end; 
    10014  
    10015  
    1001610007procedure TMainForm.ProcessLabelMouseDown(Sender: TObject; 
    1001710008  Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 
     
    1087210863    i,j,k: integer; 
    1087310864    newPID: dword; 
     10865    pli: PProcessListInfo; 
    1087410866begin 
    1087510867  //in case there is no processwatcher this timer will be used to enumare the processlist every 2 seconds 
     
    1088410876    for j:=0 to pl.Count-1 do //can't do indexof 
    1088510877    begin 
    10886       if pos(autoattachlist.Strings[i],pl.strings[j])=10 then 
     10878      if pos(uppercase(autoattachlist.Strings[i]),uppercase(pl.strings[j]))=10 then 
    1088710879      begin 
    1088810880        //the process is found 
     
    1089910891        enablegui(false); 
    1090010892 
     10893        openProcessEpilogue('',0,0); 
     10894 
    1090110895        symhandler.reinitialize; 
    1090210896        reinterpretaddresses; 
     
    1090610900  end; 
    1090710901//  pl.IndexOf(autoattachlist.items[i]); 
     10902 
     10903  for i:=0 to pl.count-1 do 
     10904    if pl.Objects[i]<>nil then 
     10905    begin 
     10906      pli:=pointer(pl.Objects[i]); 
     10907      if pli.processIcon>0 then 
     10908        DestroyIcon(pli.processIcon); 
     10909      freemem(pli); 
     10910    end; 
     10911 
    1090810912  pl.free; 
    1090910913end; 
  • Cheat Engine/PointerscannerSettingsFrm.pas

    r288 r307  
    322322    edtAddress.Width:=cbValueType.Left+cbValueType.Width-edtAddress.Left; 
    323323    cbValueType.Visible:=false; 
    324     editMaxLevel.Text:='5'; 
    325324    cbStaticOnly.Checked:=true; 
    326325  end 
     
    329328    edtAddress.Width:=rbFindAddress.Width; 
    330329    cbValueType.Visible:=true; 
    331     editMaxLevel.Text:='1'; 
    332330    cbStaticOnly.Checked:=false; 
    333331  end; 
  • Cheat Engine/Release/Cheat Engine.iss

    r306 r307  
    247247 
    248248[Run] 
    249 Filename: "{app}\Cheat Engine.exe"; Description: "Launch Cheat Engine 5.5"; Flags: nowait postinstall skipifsilent runascurrentuser 
     249Filename: "{app}\Cheat Engine.exe"; Description: "Launch Cheat Engine 5.6"; Flags: nowait postinstall skipifsilent runascurrentuser 
  • Cheat Engine/Structuresfrm.dfm

    r306 r307  
    7070      OnDblClick = tvStructureViewDblClick 
    7171      OnExpanding = tvStructureViewExpanding 
    72       OnKeyDown = tvStructureViewKeyDown 
    7372      OnMouseDown = tvStructureViewMouseDown 
    7473    end 
     
    184183      OnClick = Memorybrowsepointer1Click 
    185184    end 
     185    object Memorybrowsethisaddress1: TMenuItem 
     186      Caption = 'Memory browse this address' 
     187      ShortCut = 32 
     188      OnClick = Memorybrowsethisaddress1Click 
     189    end 
    186190    object N3: TMenuItem 
    187191      Caption = '-' 
  • Cheat Engine/Structuresfrm.pas

    r306 r307  
    8989    HeaderControl1: THeaderControl; 
    9090    Memorybrowsepointer1: TMenuItem; 
     91    Memorybrowsethisaddress1: TMenuItem; 
    9192    procedure Definenewstructure1Click(Sender: TObject); 
    9293    procedure Addelement1Click(Sender: TObject); 
     
    128129    procedure Newwindow1Click(Sender: TObject); 
    129130    procedure Memorybrowsepointer1Click(Sender: TObject); 
    130     procedure tvStructureViewKeyDown(Sender: TObject; var Key: Word; 
    131       Shift: TShiftState); 
     131    procedure Memorybrowsethisaddress1Click(Sender: TObject); 
    132132  private 
    133133    { Private declarations } 
     
    11691169      Deleteelement1.Visible:=true; 
    11701170      n2.Visible:=true; 
     1171      Memorybrowsethisaddress1.Visible:=true; 
    11711172      elementnr:=tvStructureView.Selected.Index; 
    11721173 
     
    11781179      Memorybrowsepointer1.Visible:=false; 
    11791180      Addtoaddresslist1.Visible:=false; 
     1181      Memorybrowsethisaddress1.Visible:=false; 
    11801182    end; 
    11811183  end; 
     
    21862188end; 
    21872189 
    2188 procedure TfrmStructures.tvStructureViewKeyDown(Sender: TObject; 
    2189   var Key: Word; Shift: TShiftState); 
     2190procedure TfrmStructures.Memorybrowsethisaddress1Click(Sender: TObject); 
    21902191var 
    21912192  i: integer; 
     
    21962197  section: integer; 
    21972198  address: dword; 
    2198   x: dword;   
    2199 begin 
    2200   if key=vk_space then 
    2201   begin 
    2202     if (tvStructureView.selected<>nil) then 
    2203     begin 
    2204       s:=tstructure(tvStructureView.Selected.Data); 
    2205       elementnr:=tvStructureView.Selected.Index; 
    2206       if s=nil then exit; 
    2207        
    2208  
    2209       if (elementnr>=0) then 
     2199  x: dword; 
     2200begin 
     2201  if (tvStructureView.selected<>nil) then 
     2202  begin 
     2203    s:=tstructure(tvStructureView.Selected.Data); 
     2204    elementnr:=tvStructureView.Selected.Index; 
     2205    if s=nil then exit; 
     2206 
     2207 
     2208    if (elementnr>=0) then 
     2209    begin 
     2210      //find the position that is clicked 
     2211      GetWindowRect(tvStructureView.Handle, tvrect); 
     2212 
     2213      clickpos.X:=popupmenu1.PopupPoint.X-tvrect.Left; 
     2214      clickpos.Y:=popupmenu1.PopupPoint.Y-tvrect.Top; 
     2215 
     2216      section:=headercontrol1.Sections.Count-1; 
     2217      for i:=0 to headercontrol1.Sections.Count-1 do 
    22102218      begin 
    2211         //find the position that is clicked 
    2212         GetWindowRect(tvStructureView.Handle, tvrect); 
    2213  
    2214         clickpos.X:=popupmenu1.PopupPoint.X-tvrect.Left; 
    2215         clickpos.Y:=popupmenu1.PopupPoint.Y-tvrect.Top; 
    2216  
    2217         section:=headercontrol1.Sections.Count-1; 
    2218         for i:=0 to headercontrol1.Sections.Count-1 do 
     2219        if (clickpos.x>=headercontrol1.Sections[i].Left) 
     2220          and 
     2221           (clickpos.x<headercontrol1.Sections[i].Left+headercontrol1.Sections[i].width) then 
    22192222        begin 
    2220           if (clickpos.x>=headercontrol1.Sections[i].Left) 
    2221             and 
    2222              (clickpos.x<headercontrol1.Sections[i].Left+headercontrol1.Sections[i].width) then 
    2223           begin 
    2224             //found it 
    2225             section:=i; 
    2226             break; 
    2227           end; 
     2223          //found it 
     2224          section:=i; 
     2225          break; 
    22282226        end; 
    2229  
    2230         if section>0 then 
    2231           section:=section-1; //count starts from 1, so decrease 
    2232  
    2233         memorybrowser.memoryaddress:=s.addresses[section]+definedstructures[s.basestructure].structelement[elementnr].offset; 
    2234         memorybrowser.RefreshMB; 
    22352227      end; 
    2236      // definedstructures[s.basestructure].structelement[elementnr]. 
    2237     end; 
    2238  
    2239   end; 
    2240  
     2228 
     2229      if section>0 then 
     2230        section:=section-1; //count starts from 1, so decrease 
     2231 
     2232      memorybrowser.memoryaddress:=s.addresses[section]+definedstructures[s.basestructure].structelement[elementnr].offset; 
     2233      memorybrowser.RefreshMB; 
     2234    end; 
     2235   // definedstructures[s.basestructure].structelement[elementnr]. 
     2236  end; 
    22412237 
    22422238 
  • Cheat Engine/autoassembler.pas

    r305 r307  
    311311    ProcessID: DWORD; 
    312312 
    313     symhandler: TSymhandler;    
     313    bytes: tbytes; 
     314 
     315    symhandler: TSymhandler; 
    314316begin 
    315317  if targetself then 
     
    330332 
    331333 
     334  pluginhandler.handleAutoAssemblerPlugin(@currentlinep, 0); //tell the plugins that an autoassembler script is about to get executed 
     335 
    332336//2 pass scanner 
    333337  try 
     
    387391          //plugins^^^ 
    388392 
    389  
     393          if uppercase(copy(currentline,1,7))='ASSERT(' then //assert(address,aob) 
     394          begin 
     395            a:=pos('(',currentline); 
     396            b:=pos(',',currentline); 
     397            c:=pos(')',currentline); 
     398            if (a>0) and (b>0) and (c>0) then 
     399            begin 
     400              s1:=copy(currentline,a+1,b-a-1); 
     401              s2:=copy(currentline,b+1,c-b-1); 
     402              testdword:= symhandler.getAddressFromName(s1,false); 
     403 
     404              setlength(bytes,0); 
     405              ConvertStringToBytes(s2, true, bytes); 
     406              if length(bytes)>0 then 
     407              begin 
     408                getmem(bytebuf,length(bytes)); 
     409                if ReadProcessMemory(processhandle, pointer(testdword), bytebuf, length(bytes),x) then 
     410                begin 
     411                  try 
     412                    for j:=0 to length(bytes)-1 do 
     413                    begin 
     414                      if bytes[j]>=0 then 
     415                        if byte(bytes[j])<>bytebuf[j] then 
     416                          raise exception.Create('The bytes at '+s1+' are not what was expected'); 
     417                    end; 
     418                  finally 
     419                    freemem(bytebuf); 
     420                  end; 
     421                end else raise exception.Create('The memory at +'+s1+' can not be read'); 
     422 
     423              end 
     424              else raise exception.Create(s2+' is not a valid bytestring'); 
     425 
     426 
     427 
     428              setlength(assemblerlines,length(assemblerlines)-1); 
     429              continue; 
     430            end 
     431            else 
     432              raise exception.Create('Wrong syntax. ASSERT(address,bvtes)'); 
     433          end; 
    390434 
    391435 
     
    470514              setlength(assemblerlines,length(assemblerlines)-1); 
    471515              continue; 
    472             end else raise exception.Create('Wrong syntax. CreateThread(address)');           
     516            end else raise exception.Create('Wrong syntax. CreateThread(address)'); 
    473517          end; 
    474518 
     
    14951539    tokens.free; 
    14961540 
     1541 
     1542    pluginhandler.handleAutoAssemblerPlugin(@currentlinep, 3); //tell the plugins to free their data 
    14971543  end; 
    14981544end; 
  • Cheat Engine/cheatengine.dof

    r306 r307  
    189189MinorVer=6 
    190190Release=0 
    191 Build=46 
     191Build=48 
    192192Debug=0 
    193193PreRelease=1 
     
    200200CompanyName= 
    201201FileDescription=Cheat Engine 5.6 
    202 FileVersion=5.6.0.46 
     202FileVersion=5.6.0.48 
    203203InternalName=CheatEngine 
    204204LegalCopyright=none 
  • Cheat Engine/formsettingsunit.dfm

    r306 r307  
    33  Top = 306 
    44  Width = 785 
    5   Height = 599 
     5  Height = 574 
    66  BorderIcons = [biSystemMenu] 
    77  Caption = 'Cheat Engine settings' 
     
    2323    Top = 0 
    2424    Width = 767 
    25     Height = 507 
     25    Height = 482 
    2626    Align = alClient 
    2727    TabOrder = 0 
     
    3030      Top = 1 
    3131      Width = 148 
    32       Height = 505 
     32      Height = 480 
    3333      Align = alLeft 
    3434      HideSelection = False 
     
    5858      Top = 1 
    5959      Width = 617 
    60       Height = 505 
     60      Height = 480 
    6161      ActivePage = GeneralSettings 
    6262      Align = alClient 
     
    286286        end 
    287287        object EditAutoAttach: TEdit 
    288           Left = 251 
     288          Left = 255 
    289289          Top = 340 
    290           Width = 149 
     290          Width = 143 
    291291          Height = 24 
    292292          Hint =  
     
    366366          Top = 0 
    367367          Width = 609 
    368           Height = 471 
     368          Height = 446 
    369369          Align = alClient 
    370370          TabOrder = 0 
     
    372372            Top = 62 
    373373            Width = 383 
    374             Height = 409 
     374            Height = 384 
    375375            inherited Label1: TLabel 
    376376              Width = 383 
     
    378378            inherited ListBox1: TListBox 
    379379              Width = 383 
    380               Height = 393 
     380              Height = 368 
    381381            end 
    382382          end 
     
    385385            Top = 62 
    386386            Width = 226 
    387             Height = 409 
     387            Height = 384 
    388388            DesignSize = ( 
    389389              226 
    390               409) 
     390              384) 
    391391            inherited Label2: TLabel 
    392392              Left = 7 
     
    407407              Top = 79 
    408408              Width = 209 
    409               Height = 391 
     409              Height = 366 
    410410              DesignSize = ( 
    411411                209 
    412                 391) 
     412                366) 
    413413              inherited Label52: TLabel 
    414414                Left = 14 
     
    685685            Left = 0 
    686686            Top = 0 
    687             Width = 512 
     687            Width = 210 
    688688            Height = 16 
    689689            Align = alTop 
     
    707707          Left = 0 
    708708          Top = 0 
    709           Width = 609 
     709          Width = 592 
    710710          Height = 48 
    711711          Align = alTop 
     
    11711171  object Panel6: TPanel 
    11721172    Left = 0 
    1173     Top = 507 
     1173    Top = 482 
    11741174    Width = 767 
    11751175    Height = 47 
  • Cheat Engine/plugin/cepluginsdk.h

    r304 r307  
    11/* 
    22 cepluginsdk.h 
    3  Updated January 2, 2010 
    4  Because people thought THIS was an SDK they could use without any editing, i've decided 
    5  to actually make it the default SDK for C and fill in the blanks 
    6  
    7  v1.0.1 
     3 Updated January 9, 2010 
     4 
     5 v3.0.1 
    86*/ 
    97#include <windows.h> 
    108#define CESDK_VERSION 3 
    119 
    12 typedef enum {ptAddressList=0, ptMemoryView=1, ptOnDebugEvent=2, ptProcesswatcherEvent=3, ptFunctionPointerchange=4, ptMainMenu=5} PluginType; 
     10typedef enum {ptAddressList=0, ptMemoryView=1, ptOnDebugEvent=2, ptProcesswatcherEvent=3, ptFunctionPointerchange=4, ptMainMenu=5, ptDisassemblerContext=6, ptDisassemblerRenderLine=7, ptAutoAssembler=8} PluginType; 
     11typedef enum {aaInitialize=0, aaPhase1=1, aaPhase2=2, aaFinalize=3} AutoAssemblerPhase; 
    1312 
    1413typedef struct _PluginVersion 
     
    3736typedef void (__stdcall *CEP_PLUGINTYPE4)(int reserved); 
    3837typedef void (__stdcall *CEP_PLUGINTYPE5)(void); 
     38typedef BOOL (__stdcall *CEP_PLUGINTYPE6ONPOPUP)(ULONG selectedAddress, char **addressofname); 
     39typedef BOOL (__stdcall *CEP_PLUGINTYPE6)(ULONG *selectedAddress); 
     40typedef void (__stdcall *CEP_PLUGINTYPE7)(ULONG address, char **addressStringPointer, char **bytestringpointer, char **opcodestringpointer, char **specialstringpointer, ULONG *textcolor); 
     41typedef void (__stdcall *CEP_PLUGINTYPE8)(char **line, AutoAssemblerPhase phase); 
     42 
     43 
    3944 
    4045typedef struct _PLUGINTYPE0_INIT 
     
    6974{ 
    7075  char* name; //0 terminated string describing the name for the user's menu item 
    71   CEP_PLUGINTYPE5 callbackroutine; //pointer to a callback routine of the type 1 plugin 
     76  CEP_PLUGINTYPE5 callbackroutine;  
    7277  char* shortcut; //0 terminated string containing the shortcut in textform. CE will try it's best to parse it to a valid shortcut 
    7378} PLUGINTYPE5_INIT, MAINMENUPLUGIN_INIT, *PPLUGINTYPE5_INIT, *PMAINMENUPLUGIN_INIT; 
     79 
     80typedef struct _PLUGINTYPE6_INIT 
     81{ 
     82  char* name; //0 terminated string describing the name for the user's menu item 
     83  CEP_PLUGINTYPE6ONPOPUP callbackroutineOnPopup;  
     84  CEP_PLUGINTYPE6 callbackroutine;  
     85  char* shortcut; //0 terminated string containing the shortcut in textform. CE will try it's best to parse it to a valid shortcut 
     86} PLUGINTYPE6_INIT, DISASSEMBLERCONTEXT_INIT, *PPLUGINTYPE6_INIT, *PDISASSEMBLERCONTEXT_INIT; 
    7487 
    7588 
  • Cheat Engine/plugin/cepluginsdk.pas

    r304 r307  
    77const PluginVersionSDK=3; 
    88 
    9 type TPluginType=(ptAddressList=0, ptMemoryView=1, ptOnDebugEvent=2, ptProcesswatcherEvent=3, ptFunctionPointerchange=4, ptMainMenu=5, ptDisassemblerContext=6, ptDisassemblerRenderLine=7); 
     9type TAutoAssemblerPhase=(aaInitialize=0, aaPhase1=1, aaPhase2=2, aaFinalize=3); 
     10type TPluginType=(ptAddressList=0, ptMemoryView=1, ptOnDebugEvent=2, ptProcesswatcherEvent=3, ptFunctionPointerchange=4, ptMainMenu=5, ptDisassemblerContext=6, ptDisassemblerRenderLine=7, ptAutoAssembler=8); 
    1011 
    1112type TDWordArray = array[0..0] of DWord; 
     
    6970type TFunction5=TFunction1; 
    7071type TFunction7=TFunction2; 
     72type TFunction8=TFunction2; 
    7173 
    7274 
     
    7981type PFunction6=^TFunction6; 
    8082type PFunction7=^TFunction7; 
     83type PFunction8=^TFunction8; 
    8184 
    8285type Tce_showmessage=procedure (s: pchar); stdcall; 
     
    272275type TPluginFunction4=function(section: integer):boolean; stdcall; 
    273276type TPluginfunction5=procedure; stdcall; 
     277type TPluginfunction6OnPoup=function(selectedAddress: dword; addressofname: pointer):bool; stdcall; 
    274278type TPluginfunction6=function(selectedAddress: pdword):bool; stdcall; 
    275279type TPluginFunction7=procedure(address: dword; addressStringPointer: pointer; bytestringpointer: pointer; opcodestringpointer: pointer; specialstringpointer: pointer; textcolor: PColor); stdcall; 
     280type TPluginFunction8=procedure(line: ppchar; phase: TAutoAssemblerPhase); stdcall; 
    276281 
    277282implementation