📄 cefuncproc.pas
字号:
unit CEFuncProc;
//This version of CEFuncProc has been COPIED to the server dir
//Cheat Engine regular WONT look at this
interface
uses Windows,StdCtrls,Classes,SysUtils,dialogs,tlhelp32,forms,messages,
Graphics,
ComCtrls,
reinit,
assemblerunit,
imagehlp,
{$ifdef netclient}
netapis,
{$else}
NewKernelHandler,
{$ifndef standalonetrainer}
{$ifndef netserver}
hypermode,
{$endif}
{$endif}
{$endif}
math,syncobjs;
Type TBytes = array of integer;
type tfloatscan=(rounded,extremerounded,truncated);
Type TMemoryRegion = record
BaseAddress: Dword;
MemorySize: Dword;
IsChild: boolean;
startaddress: pointer;
end;
type TMemoryregions = array of tmemoryregion;
type bitaddress = record
address: dword;
bit: dword;
end;
type TFreememoryThread = class(tthread)
public
Bitscan: array of byte;
tempbits: array of byte;
FoundAddress: array of dword;
FoundValue1:Array of Byte;
FoundValue2:Array of word;
FoundValue3:Array of Dword;
FoundValue7:Array of Int64;
FoundValue8:array of byte;
FoundValue4:Array of Single;
FoundValue5:Array of Double;
foundValue6:Array of int64; //byte ?????
FoundValue1switch:Array of Byte;
FoundValue2switch:Array of word;
FoundValue3switch:Array of Dword;
FoundValue7switch:Array of Int64;
FoundValue8switch:array of byte;
FoundValue4switch:Array of Single;
FoundValue5switch:Array of Double;
foundValue6switch:Array of int64;
foundaddressB: array of bitaddress;
previousmemory: array of byte;
SearchAddress: array of dword;
SearchAddressB: array of BitAddress;
previousmemory1: array of Byte;
previousmemory2: array of word;
previousmemory3: array of dword;
previousmemory4: array of Single;
previousmemory5: array of Double;
previousmemory6: array of int64; //Byte;
PreviousMemory7: Array of Int64;
PreviousMemory8: array of byte;
previousmemory1switch: array of Byte;
previousmemory2switch: array of word;
previousmemory3switch: array of dword;
previousmemory4switch: array of Single;
previousmemory5switch: array of Double;
previousmemory6switch: array of int64; //Byte;
PreviousMemory7switch: Array of Int64;
PreviousMemory8switch: array of byte;
Memory: ^Byte;
memory2: ^byte;
bytes: array of integer; //-1=wildcard
bytearray: array of byte;
procedure execute; override;
end;
procedure quicksortmemoryregions(lo,hi: integer);
//function NextScan(var Results: TListBox; value: dword; FValue: Double; ScanWay, ValType,max: Integer; ProgressBar: TProgressbar): Integer;
procedure rewritecode(processhandle: thandle; address:dword; buffer: pointer; size:dword);
procedure rewritedata(processhandle: thandle; address:dword; buffer: pointer; size:dword);
function FindPointer(start,stop:dword;foundlist: TStringlist; AddressToFind:Dword; progressbar: Tprogressbar; offset: Tbytes;max:dword):int64;
function NextScan2(var Results: TStringlist; scantext,scantext2:string; ScanWay, ValType: Integer; roundingtype:tfloatscan; max:dword; option:boolean; ProgressBar: TProgressbar;fastscan:boolean;unicode,percentage: boolean): dword;
procedure GetProcessListSmall(ProcessList: TListBox);
procedure GetProcessList(ProcessList: TListBox; var ArrIcons: Tbytes);
procedure GetWindowList(ProcessList: TListBox{; var ArrIcons: TBytes});
function AvailMem:dword;
function isreadable(address:dword):boolean;
function GetMemoryRanges2(Start,Stop: Dword; readonly: boolean; Progressbar: TProgressBar;vartype:integer;fastscan:boolean):int64;
function GetMemoryRangesAndScanValue2(Start,Stop: Dword; readonly,findonlyone: boolean; ScanType,VarType: Integer; foundlist: TStringlist; scanvalue,scanvalue2: string;roundingtype:tfloatscan ;max:integer; extra: boolean;progressbar: Tprogressbar;fastscan:boolean;unicode: boolean): Int64; //integer;
procedure RemoveAddress(address: Dword;bit: Byte; vartype: Integer);
procedure FillListIfPossible(vartype:integer;max:integer;extra:boolean;foundlist:TStringlist);
function GetCEdir:string;
procedure Open_Process;
Procedure Shutdown;
function KeyToStr(key:word):string;
procedure Freememory;
procedure closefiles;
function undolastscan(valtype: integer;max:integer;hexadecimal:boolean;results: TStringlist): integer;
procedure ConvertStringToBytes(scanvalue:string; hex:boolean;var bytes: TBytes);
function getbit(bitnr: integer; bt: Byte):integer;
procedure setbit(bitnr: integer; var bt: Byte;state:integer);
function ByteStringToText(s: string;hex: boolean):string;
function ByteStringToDouble(s: string;hex: boolean):double;
function ByteStringToSingle(s: string;hex: boolean):single;
function ByteStringToInt(s: string;hex: boolean):int64;
function VarToBytes(v: pointer; size: integer): string;
function RawToString(const buf: array of byte; vartype: integer;showashex: boolean; bufsize: integer):string;
function IntToBin(i: int64):string;
function BinToInt(s: string): int64;
procedure decimal(var key: char);
procedure hexadecimal(var key: char);
function scanbits(var found: dword;number:dword;var bytep: pbyte;nrofbits,i,actualread: integer): boolean;
function GetSystemType: Integer;
procedure ToggleOtherWindows;
procedure EnableStealth;
procedure DisableStealth;
Procedure InjectDll(dllname: string; functiontocall: string);
{$ifndef standalonetrainer}
Procedure CreateCodeCave(address:dword; sourceaddress:dword; sizeofcave: integer);
{$endif}
procedure errorbeep;
{$ifndef net}
procedure SetLanguage;
{$endif}
{$ifndef standalonetrainer}
procedure DetachIfPossible;
{$endif}
procedure getexecutablememoryregionsfromregion(start: dword; stop:dword; var memoryregions: TMemoryRegions);
const
Exact_value = 0;
Increased_value = 1;
Increased_value_by = 2;
Decreased_value = 3;
Decreased_value_by = 4;
Changed_value = 5;
Unchanged_value = 6;
Advanced_Scan = 7;
String_Scan = 8;
SmallerThan = 9;
BiggerThan = 10;
Userdefined = 11; //not used
ValueBetween = 12;
splitvalue=400000;
number=600; //is my using the new value on my system arround 580000
type
MemoryRecordcet3 = record
Description : string[50];
Address : dword;
VarType : byte;
Bit : Byte;
Frozen : boolean;
FrozenValue : Int64;
Group: Byte;
end;
type TCEPointer=record
Address: Dword; //only used when last pointer in list
Interpretableaddress: string; //same as address
offset: integer;
end;
type TCEAlloc=record
address: dword;
varname: string;
size: dword;
end;
type PCEAlloc=^TCEAlloc;
type TCEAllocArray=array of TCEAlloc;
type
MemoryRecord = record
Description : string;
Address : dword;
interpretableaddress: string;
VarType : byte;
unicode : boolean;
IsPointer: Boolean;
pointers: array of TCEPointer;
Bit : Byte;
bitlength: integer;
Frozen : boolean;
FrozenValue : Int64;
OldValue: string; //not saved
Frozendirection: integer; //0=always freeze,1=only freeze when going up,2=only freeze when going down
Group: Byte;
ShowAsHex: boolean;
autoassemblescript: string;
allocs: TCEAllocArray;
end;
type
MemoryRecordOld = record
Description : string[50];
Address : dword;
VarType : byte;
Frozen : boolean;
FrozenValue : Dword;
end;
type TScanSettings = record
UseHyperscan: boolean;
scanning: boolean;
CEProcessID: dword;
CEMainThreadID: Dword;
applicantionhandle: thandle;
mainformHandle: THandle;
formscanningHandle: THandle;
hyperscanwindow: Thandle;
StartAddress: Dword;
StopAddress: Dword;
Scantype: Integer;
ValueType: Integer;
roundingtype: tfloatscan;
scan:byte;
readonly: boolean;
FastScan: boolean;
Hexadecimal: boolean;
unicode: boolean;
percentage: boolean;
LowMemoryUsage: boolean;
Skip_PAGE_NOCACHE:boolean;
scan_mem_private:boolean;
scan_mem_image:boolean;
scan_mem_mapped: boolean;
scanvalue: string[255];
scanvalue2: string[255];
CheatEngineDir: string[255];
buffersize:dword;
priority:integer;
nrofbits:integer;
bitstring: string[255];
bitoffsetchange: integer;
asktocontinue: boolean;
HookDirect3d: boolean;
HookOpenGL: boolean;
PacketEditor: boolean;
Stealthed: boolean;
hooknewprocesses: boolean;
end;
type TKeyCombo=array [0..4] of word;
type TKeys=record
configured: boolean;
CEDir: string[255];
cewindow: thandle;
callibrationmode: boolean; //false=no textureselect hud
callibrationkey: TKeycombo;
setcallibration: boolean;
mousecallibrationhorizontal1point: single;
mousecallibrationvertical1point: single;
mousecallibrationhorizontal2point: single;
mousecallibrationvertical2point: single;
mousecallibrationhorizontal5point: single;
mousecallibrationvertical5point: single;
mousecallibrationhorizontal10point: single;
mousecallibrationvertical10point: single;
mousecallibrationhorizontal20point: single;
mousecallibrationvertical20point: single;
mousecallibrationhorizontal40point: single;
mousecallibrationvertical40point: single;
loadaimsettingsfile: tkeycombo;
saveaimsettingsfile: tkeycombo;
aimsettings1: string[255];
Aimsettings2: string[255];
Aimsettings3: string[255];
setaimsetting1: tkeycombo;
setaimsetting2: tkeycombo;
setaimsetting3: tkeycombo;
nexttexture: tkeycombo;
previoustexture: tkeycombo;
locktexture: tkeycombo;
IncreaseX: tkeycombo;
DecreaseX: TKeyCombo;
Increasey: tkeycombo;
Decreasey: TKeyCombo;
Increasez: tkeycombo;
Decreasez: TKeyCombo;
HoldAutoaimtoggle: boolean;
autoshoot: boolean;
autoaimtoggle: tKeycombo;
increaselag: tkeycombo;
decreaselag: tkeycombo;
zoomin,zoomout: TKeyCombo;
nozoom: tKeyCombo;
zoom1: tKeyCombo;
zoomlevel1: single;
zoom2: tkeycombo;
zoomlevel2: single;
zoom3: tkeycombo;
zoomlevel3: single;
zoom4: tkeycombo;
zoomlevel4: single;
zoom5: tkeycombo;
zoomlevel5: single;
zoomdelta: single;
lagdelta: integer;
setlag: boolean;
lagtoset: dword;
usefpslag: boolean;
rotateleft: tKeycombo;
rotateright: tkeycombo;
rotateup: tkeycombo;
rotatedown: tkeycombo;
moveleft: tkeycombo;
moveright: tkeycombo;
moveup: tkeycombo;
movedown: tkeycombo;
moveforward: tkeycombo;
movebackwards: tkeycombo;
movespeed: single;
rotatespeed: single;
setcameraback: tkeycombo;
zbuffer: tkeycombo;
fog: tkeycombo;
lighting: tkeycombo;
wireframe: tkeycombo;
ShowKeylist: tkeycombo;
SaveAlltextures: TKeycombo;
selectedlagrecord: string[50];
lagmemorytype: byte;
getlagfrommemory: boolean;
nrofoffsets: dword;
lagaddress: dword;
offset1: dword;
offset2: dword;
offset3: dword;
offset4: dword;
offset5: dword;
offset6: dword;
offset7: dword;
offset8: dword;
offset9: dword;
offset10: dword;
offset11: dword;
offset12: dword;
offset13: dword;
offset14: dword;
offset15: dword;
pollinginterval: integer;
end;
type PKeys= ^TKeys;
type TKeys2=record
configured: boolean;
CEDir: string[255];
cewindow: thandle;
textures: tkeycombo;
lighting: tkeycombo;
depthtest: tkeycombo;
fog: tkeycombo;
zoomin,zoomout: TKeyCombo;
nozoom: tKeyCombo;
zoom1: tKeyCombo;
zoomlevel1: single;
zoom2: tkeycombo;
zoomlevel2: single;
zoom3: tkeycombo;
zoomlevel3: single;
zoom4: tkeycombo;
zoomlevel4: single;
zoom5: tkeycombo;
zoomlevel5: single;
zoomdelta: single;
pollinginterval: integer;
end;
type PKeys2= ^TKeys2;
function ConvertKeyComboToString(x: tkeycombo):string;
var
old8087CW: word; //you never know...
ProcessSelected: Boolean;
ProcessID: Dword;
ProcessHandle: Thandle;
Skip_PAGE_NOCACHE: boolean;
Scan_MEM_PRIVATE: boolean;
Scan_MEM_IMAGE: boolean;
Scan_MEM_MAPPED: boolean;
CheatEngineDir: String;
//scanhelpers
nrofbits: integer;
Bitscan: array of byte;
tempbits: array of byte;
bitoffsetchange: integer;
FoundValue1:Array of Byte;
FoundValue1switch:Array of Byte;
FoundValue2:Array of word;
FoundValue2switch:Array of word;
FoundValue3:Array of Dword;
FoundValue3switch:Array of Dword;
FoundValue4:Array of Single;
FoundValue4switch:Array of Single;
FoundValue5:Array of Double;
FoundValue5switch:Array of Double;
foundValue6:Array of int64;
foundValue6switch:Array of int64;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -