unit PointerscannerSettingsFrm; {$MODE Delphi} interface uses windows, LCLIntf, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, LResources, EditBtn, Buttons, Contnrs, CEFuncProc, NewKernelHandler, symbolhandler, multilineinputqueryunit, registry, resolve, math, PointerscanSettingsIPConnectionList, types, commonTypeDefs; type TPointerFileEntry=class(TCustomPanel) private addresslist: TStringlist; fimagelist: Timagelist; ffilename: string; fOnDelete: TNotifyEvent; fOnSetfilename: TNotifyEvent; lblFilename: TLabel; btnSetFile: TSpeedButton; btnDelete: TSpeedButton; cbAddress: TComboBox; procedure btnSetFileClick(Sender: TObject); procedure btnDeleteClick(Sender: TObject); procedure setFileName(filename: string); procedure cbAddressDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); public property filename: string read ffilename write setFileName; property OnDelete: TNotifyEvent read fOnDelete write fOnDelete; property OnSetFileName: TNotifyEvent read fOnSetFileName write fOnSetFileName; constructor create(imagelist: TImageList; AOwner: TComponent); destructor destroy; override; end; type //TPointerFileEntries = TFPGList; TPointerFileList=class(TPanel) private lblFilenames: TLabel; lblAddress: TLabel; fimagelist: TImageList; fOnEmptyList: TNotifyEvent; Entries: TList; function getCount: integer; function getFilename(index: integer): string; function getAddress(index: integer): ptruint; procedure DeleteEntry(sender: TObject); procedure FilenameUpdate(sender: TObject); function AddEntry: TPointerFileEntry; private procedure AdjustPos(sender: tobject); public constructor create(imagelist: TImageList; AOwner: TComponent; w: integer); destructor destroy; override; property OnEmptyList: TNotifyEvent read fOnEmptyList write fOnEmptyList; property Count: integer read getCount; property filenames[index: integer]: string read getFilename; property addresses[index: integer]: ptruint read getAddress; end; type tmoduledata = class public moduleaddress: dword; modulesize: dword; end; type TOffsetEntry=class(Tedit) private function getOffset: dword; procedure setOffset(x: dword); protected procedure KeyPress(var Key: Char); override; public constructor create(AOwner: TComponent); override; published property offset: dword read getOffset write setOffset; end; type { TfrmPointerScannerSettings } TfrmPointerScannerSettings = class(TForm) btnCancel: TButton; btnOk: TButton; cbAcceptNonModuleVtable: TCheckBox; CbAlligned: TCheckBox; cbAllowRuntimeWorkers: TCheckBox; cbClassPointersOnly: TCheckBox; cbCompressedPointerscanFile: TCheckBox; cbConnectToNode: TCheckBox; cbHeapOnly: TCheckBox; cbIncludeSystemModules: TCheckBox; cbLimitScanToRegionFile: TCheckBox; cbMaxOffsetsPerNode: TCheckBox; cbMustEndWithSpecificOffset: TCheckBox; cbMustStartWithBase: TCheckBox; cbNoLoop: TCheckBox; cbNoReadOnly: TCheckBox; cbOnlyOneStatic: TCheckBox; cbStackOnly: TCheckBox; cbStaticOnly: TCheckBox; cbStaticStacks: TCheckBox; cbUseHeapData: TCheckBox; cbUseLoadedPointermap: TCheckBox; cbCompareToOtherPointermaps: TCheckBox; cbShowAdvancedOptions: TCheckBox; cbAddress: TComboBox; ComboBox1: TComboBox; editMaxLevel: TEdit; editStructsize: TEdit; edtBaseFrom: TEdit; edtBaseTo: TEdit; edtDistributedPassword: TEdit; edtDistributedPort: TEdit; edtMaxOffsetsPerNode: TEdit; edtReverseStart: TEdit; edtReverseStop: TEdit; edtStackSize: TEdit; edtThreadcount: TEdit; edtThreadStacks: TEdit; il: TImageList; Label1: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label9: TLabel; lblNumberOfStackThreads: TLabel; lblPort: TLabel; lblStackSize: TLabel; odLoadPointermap: TOpenDialog; odLoadRegionFile: TOpenDialog; Panel1: TPanel; Panel10: TPanel; Panel11: TPanel; Panel12: TPanel; Panel3: TPanel; cbValueType: TComboBox; Panel2: TPanel; Panel4: TPanel; Panel5: TPanel; Panel6: TPanel; Panel7: TPanel; Panel8: TPanel; Panel9: TPanel; rbGeneratePointermap: TRadioButton; rbFindAddress: TRadioButton; rbFindValue: TRadioButton; procedure btnOkClick(Sender: TObject); procedure canNotReuse(Sender: TObject); procedure cbAddressDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); procedure cbLimitScanToRegionFileChange(Sender: TObject); procedure cbMustStartWithBaseChange(Sender: TObject); procedure cbConnectToNodeChange(Sender: TObject); procedure cbAllowRuntimeWorkersChange(Sender: TObject); procedure cbMaxOffsetsPerNodeChange(Sender: TObject); procedure cbMustEndWithSpecificOffsetChange(Sender: TObject); procedure cbShowAdvancedOptionsChange(Sender: TObject); procedure cbStaticOnlyChange(Sender: TObject); procedure cbStaticStacksChange(Sender: TObject); procedure cbUseLoadedPointermapChange(Sender: TObject); procedure cbCompareToOtherPointermapsChange(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormCreate(Sender: TObject); procedure cbMustEndWithSpecificOffsetClick(Sender: TObject); procedure cbUseHeapDataClick(Sender: TObject); procedure Panel1Click(Sender: TObject); procedure rbFindValueClick(Sender: TObject); procedure edtAddressChange(Sender: TObject); procedure cbHeapOnlyClick(Sender: TObject); private { Private declarations } //iplist: tstringlist; firstshow: boolean; mainaddressList: TStringlist; warnedAboutDisablingInstantRescan: boolean; procedure iplistResize(Sender: TObject); procedure iplistWantedToDeleteLastItem(Sender: TObject); procedure btnAddClick(sender: TObject); procedure btnRemoveClick(sender: TObject); procedure updatepositions; procedure PointerFileListEmpty(sender: TObject); procedure PointerFileListResize(sender: TObject); procedure UpdateGuiBasedOnSavedPointerScanUsage; public { Public declarations } reverse: boolean; //indicates to use the reverse method start:ptrUint; stop: ptrUint; unalligned: boolean; automaticaddress: ptrUint; structsize: integer; maxOffsetsPerNode: integer; maxlevel: integer; codescan: boolean; threadcount: integer; baseAddressRange: TComponentList; offsetlist: TComponentList; btnAddOffset: TButton; btnRemoveOffset: TButton; lblInfoLastOffset: TLabel; threadstacks: integer; stacksize: integer; scannerpriority: TThreadPriority; distributedport: word; baseStart: ptruint; baseStop: ptruint; iplist: TIpList; { resolvediplist: array of THostAddr; } pdatafilelist: TPointerFileList; end; var frmpointerscannersettings: tfrmpointerscannersettings; implementation uses MainUnit, frmMemoryAllocHandlerUnit, MemoryBrowserFormUnit, ProcessHandlerUnit, Globals, parsers; resourcestring rsAdd = 'Add'; rsRemove = 'Remove'; rsIdle = 'Idle'; rsLowest = 'Lowest'; rsLower = 'Lower'; rsNormal = 'Normal'; rsHigher = 'Higher'; rsHighest = 'Highest'; rsTimeCritical = 'TimeCritical'; strMaxOffsetsIsStupid = 'Sorry, but the max offsets should be 1 or higher, or else disable the checkbox'; //'Are you a fucking retard?'; rsUseLoadedPointermap = 'Use saved pointermap'; rsNoCompareFiles = 'You will get billions of useless results and giga/terrabytes of wasted diskspace if you do not use the compare results with other saved pointermap option. Are you sure ?'; rsSelectAFile = '