Skip to content

Commit

Permalink
move the processid and handle from cefuncproc to processhandlerunit
Browse files Browse the repository at this point in the history
move the processlist function from cefuncproc to it's own unit
start work on the jni library for java
  • Loading branch information
[email protected] committed Sep 8, 2014
1 parent ef24b37 commit 0f35a52
Show file tree
Hide file tree
Showing 95 changed files with 1,849 additions and 1,073 deletions.
3 changes: 2 additions & 1 deletion Cheat Engine/AdvancedOptionsUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ implementation
frmFindCodeInFileUnit,
standaloneunit,}
formsettingsunit,
MainUnit2;
MainUnit2,
processhandlerunit;



Expand Down
5 changes: 4 additions & 1 deletion Cheat Engine/CEDebugger.pas
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ _THREAD_BASIC_INFORMATION = record // Information Class 0

implementation

uses debuggertypedefinitions, debugeventhandler, MainUnit,frmFloatingPointPanelUnit,Memorybrowserformunit,disassembler,frmTracerUnit,foundcodeunit,kerneldebugger,advancedoptionsunit,formChangedAddresses,frmstacktraceunit,frmThreadlistunit,formdebugstringsunit,formsettingsunit,processwindowunit,plugin(*,frmCreatedProcessListUnit*);
uses debuggertypedefinitions, debugeventhandler, MainUnit,frmFloatingPointPanelUnit,
Memorybrowserformunit,disassembler,frmTracerUnit,foundcodeunit,kerneldebugger,
advancedoptionsunit,formChangedAddresses,frmstacktraceunit,frmThreadlistunit,
formdebugstringsunit,formsettingsunit,processwindowunit,plugin,processhandlerunit(*,frmCreatedProcessListUnit*);


resourcestring
Expand Down
52 changes: 15 additions & 37 deletions Cheat Engine/CEFuncProc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ function rewritecode(processhandle: thandle; address:ptrUint; buffer: pointer; v
function rewritedata(processhandle: thandle; address:ptrUint; buffer: pointer; var size:dword): boolean;

function GetUserNameFromPID(ProcessId: DWORD): string;
procedure GetProcessList(ProcessList: TListBox; NoPID: boolean=false); overload;
procedure GetProcessList(ProcessList: TStrings; NoPID: boolean=false; noProcessInfo: boolean=false); overload;
//procedure GetProcessList(ProcessList: TListBox; NoPID: boolean=false); overload;
//procedure GetProcessList(ProcessList: TStrings; NoPID: boolean=false; noProcessInfo: boolean=false); overload;
procedure GetThreadList(threadlist: TStrings);
procedure cleanProcessList(processlist: TStrings);
//procedure cleanProcessList(processlist: TStrings);
procedure GetWindowList(ProcessList: TListBox; showInvisible: boolean=true);
procedure GetModuleList(ModuleList: TStrings; withSystemModules: boolean);
procedure cleanModuleList(ModuleList: TStrings);
Expand Down Expand Up @@ -550,8 +550,8 @@ function ConvertKeyComboToString(x: tkeycombo):string;
ProcessID and ProcessHandle as functions untill all code has been converted to
make use of ProcessHandlerUnit
}
function ProcessID: dword;
function ProcessHandle: THandle;
//function ProcessID: dword;
//function ProcessHandle: THandle;

//Global vars:
var
Expand All @@ -571,9 +571,7 @@ function ProcessHandle: THandle;
TablesDir: string;
CheatEngineDir: String;
WindowsDir: string;
GetProcessIcons: Boolean;
ProcessesWithIconsOnly: boolean;
ProcessesCurrentUserOnly: boolean;

username: string;

//scanhelpers
Expand Down Expand Up @@ -674,13 +672,6 @@ function ProcessHandle: THandle;
VEHRealContextOnThreadCreation: boolean;
waitafterguiupdate: boolean;



processhandler: TProcessHandler;




type
SYSTEM_INFO = record
case longint of
Expand Down Expand Up @@ -710,7 +701,7 @@ implementation

uses disassembler,CEDebugger,debughelper, symbolhandler,frmProcessWatcherUnit,
kerneldebugger, formsettingsunit, MemoryBrowserFormUnit, savedscanhandler,
networkInterface, networkInterfaceApi;
networkInterface, networkInterfaceApi, processlist;


resourcestring
Expand Down Expand Up @@ -2348,6 +2339,7 @@ function GetUserNameFromPID(ProcessId: DWORD): string;
end;
end;

{
procedure GetProcessList(ProcessList: TListBox; NoPID: boolean=false);
var sl: tstringlist;
i: integer;
Expand All @@ -2374,26 +2366,9 @@ procedure GetProcessList(ProcessList: TListBox; NoPID: boolean=false);
sl.free;
end;
end;
}


function GetFirstModuleName(processid: dword): string;
var
SNAPHandle: THandle;
check: boolean;
ModuleEntry: MODULEENTRY32;
begin
SNAPHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,processid);
if SNAPHandle<>0 then
begin
ModuleEntry.dwSize:=sizeof(moduleentry);
if Module32First(snaphandle,ModuleEntry) then
result:=moduleentry.szExePath
else
result:='';

closehandle(SNAPHandle);
end;
end;

procedure GetModuleList(ModuleList: TStrings; withSystemModules: boolean);
var ths: thandle;
Expand Down Expand Up @@ -2458,6 +2433,8 @@ procedure cleanModuleList(ModuleList: TStrings);
ModuleList.Clear;
end;

{
procedure cleanProcessList(processlist: TStrings);
var
i: integer;
Expand All @@ -2473,7 +2450,7 @@ procedure cleanProcessList(processlist: TStrings);
end;
processlist.clear;
end;
end; }

procedure GetThreadList(threadlist: TStrings);
var
Expand All @@ -2493,6 +2470,7 @@ procedure GetThreadList(threadlist: TStrings);
closehandle(ths);
end;

{
procedure GetProcessList(ProcessList: TStrings; NoPID: boolean=false; noProcessInfo: boolean=false);
var SNAPHandle: THandle;
ProcessEntry: PROCESSENTRY32;
Expand Down Expand Up @@ -2581,7 +2559,7 @@ procedure GetProcessList(ProcessList: TStrings; NoPID: boolean=false; noProcessI
closehandle(snaphandle);
end else raise exception.Create(rsICanTGetTheProcessListYouArePropablyUsingWindowsNT);
end;
end; }

procedure GetWindowList(ProcessList: TListBox; showInvisible: boolean=true);
var previouswinhandle, winhandle: Hwnd;
Expand Down Expand Up @@ -3971,7 +3949,7 @@ initialization
stealthhook:=0;
iswin2kplus:=GetSystemType>=5;

processhandler:=TProcessHandler.create;

GetSystemInfo(@systeminfo);

username:=GetUserNameFromPID(GetCurrentProcessId);
Expand Down
2 changes: 2 additions & 0 deletions Cheat Engine/DissectCodeThread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ TDissectCodeThread = class(TThread)

implementation

uses ProcessHandlerUnit;


{ TDissectCodeThread }

Expand Down
8 changes: 5 additions & 3 deletions Cheat Engine/DotNetDataCollector/DotNetDataCollector.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DotNetDataCollector", "DotNetDataCollector\DotNetDataCollector.vcproj", "{B853C34F-9357-4535-AB9C-A6240813FFD3}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DotNetDataCollector", "DotNetDataCollector\DotNetDataCollector.vcxproj", "{B853C34F-9357-4535-AB9C-A6240813FFD3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="shlwapi.lib"
AdditionalDependencies="shlwapi.lib MSCorEE.lib"
OutputFile="$(OutDir)\$(ProjectName)32.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
Expand Down Expand Up @@ -356,6 +356,10 @@
RelativePath=".\MyICorDebugDataTarget.cpp"
>
</File>
<File
RelativePath=".\MyICorDebugManagedCallback.cpp"
>
</File>
<File
RelativePath=".\PipeServer.cpp"
>
Expand Down Expand Up @@ -410,6 +414,10 @@
RelativePath=".\MyICorDebugDataTarget.h"
>
</File>
<File
RelativePath=".\MyICorDebugManagedCallback.h"
>
</File>
<File
RelativePath=".\PipeServer.h"
>
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/FindWindowUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TFindWindow = class(TForm)

implementation

uses MemoryBrowserFormUnit;
uses MemoryBrowserFormUnit, ProcessHandlerUnit;

resourcestring
rsNothingFound = 'Nothing found';
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/KernelDebuggerInterface.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TKernelDebugInterface=class(TDebuggerInterface)
implementation


uses symbolhandler;
uses symbolhandler, ProcessHandlerUnit;

procedure TThreadPoller.CreateThreadEvent(threadid: dword);
var ie: PInjectedEvent;
Expand Down
3 changes: 2 additions & 1 deletion Cheat Engine/LuaHandler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ implementation
LuaTableFile, LuaMemoryRecordHotkey, LuaMemoryView, LuaD3DHook, LuaDisassembler,
LuaDissectCode, LuaByteTable, LuaBinary, lua_server, HotkeyHandler, LuaPipeClient,
LuaPipeServer, LuaTreeview, LuaTreeNodes, LuaTreeNode, LuaCalendar, LuaSymbolListHandler,
LuaCommonDialog, LuaFindDialog, LuaSettings, LuaPageControl, SymbolListHandler;
LuaCommonDialog, LuaFindDialog, LuaSettings, LuaPageControl, SymbolListHandler,
processhandlerunit, processlist;

resourcestring
rsLUA_DoScriptWasNotCalledRomTheMainThread = 'LUA_DoScript was not called '
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/MainUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ implementation
frmFloatingPointPanelUnit, pluginexports, DBK32functions, frmUltimapUnit,
frmSetCrosshairUnit, StructuresFrm2, frmMemoryViewExUnit,
frmD3DHookSnapshotConfigUnit, frmSaveSnapshotsUnit, frmsnapshothandlerUnit,
frmNetworkDataCompressionUnit;
frmNetworkDataCompressionUnit, ProcessHandlerUnit, ProcessList;

resourcestring
rsInvalidStartAddress = 'Invalid start address: %s';
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/MainUnit2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ procedure initcetitle;
implementation


uses KernelDebugger,mainunit, DebugHelper, CustomTypeHandler;
uses KernelDebugger,mainunit, DebugHelper, CustomTypeHandler, ProcessList;

procedure UpdateToolsMenu;
var i: integer;
Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/ManualModuleLoader.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type TModuleLoader=class

implementation

uses ProcessHandlerUnit;

constructor TModuleLoader.create(filename: string);
var
Expand Down
2 changes: 2 additions & 0 deletions Cheat Engine/MemFuncs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ function getallmemoryregions(var memoryregions: tmemoryregions): qword;

implementation

uses ProcessHandlerUnit;


function getallmemoryregions(var memoryregions: tmemoryregions): qword;
var address: ptrUint;
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/MemoryRecordUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function TextToMemRecHotkeyAction(text: string): TMemrecHotkeyAction;

implementation

uses mainunit, addresslist, formsettingsunit, LuaHandler, lua, lauxlib, lualib;
uses mainunit, addresslist, formsettingsunit, LuaHandler, lua, lauxlib, lualib, processhandlerunit;

{-----------------------------TMemoryRecordHotkey------------------------------}
constructor TMemoryRecordHotkey.create(AnOwner: TMemoryRecord);
Expand Down
14 changes: 11 additions & 3 deletions Cheat Engine/MonoDataCollector/MonoDataCollector.sln
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MonoDataCollector", "MonoDataCollector\MonoDataCollector.vcproj", "{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MonoDataCollector", "MonoDataCollector\MonoDataCollector.vcxproj", "{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Debug|Win32.ActiveCfg = Debug|Win32
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Debug|Win32.Build.0 = Debug|Win32
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Debug|x64.ActiveCfg = Debug|x64
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Debug|x64.Build.0 = Debug|x64
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Release|Win32.ActiveCfg = Release|Win32
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Release|Win32.Build.0 = Release|Win32
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Release|x64.ActiveCfg = Release|x64
{941726A9-FAAD-49FD-9D69-A5D27B3DB4BA}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 0f35a52

Please sign in to comment.