| View previous topic :: View next topic |
| Author |
Message |
cleiton Newbie cheater
Reputation: 0
Joined: 05 Mar 2014 Posts: 21
|
Posted: Sun Mar 29, 2015 8:43 pm Post subject: CE Function |
|
|
I'm looking for dissectcodeunit, im using this code with "withSystemModules" as false but it is showing all system modules, where's the problem?
| Code: | procedure GetModuleList(ModuleList: TStrings; withSystemModules: boolean);
var ths: thandle;
me32: MODULEENTRY32;
x: pchar;
moduledata: tmoduledata;
i: integer;
alreadyInTheList: boolean;
begin
cleanModuleList(modulelist);
ths:=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId);
if ths<>0 then
begin
try
zeromemory(@me32,sizeof(me32));
me32.dwSize:=sizeof(me32);
if module32first(ths,me32) then
repeat
x:[email protected][0];
if (withSystemModules) or (not inSystemModule(ptrUint(me32.modBaseAddr))) then
begin
alreadyInTheList:=false;
for i:=0 to ModuleList.count-1 do
begin
moduledata:=tmoduledata(ModuleList.objects[i]);
if moduledata.moduleaddress=ptrUint(me32.modBaseAddr) then
begin
alreadyInTheList:=true;
break;
end;
end;
if not alreadyInTheList then
begin
moduledata:=tmoduledata.Create;
moduledata.moduleaddress:=ptrUint(me32.modBaseAddr);
moduledata.modulesize:=me32.modBaseSize;
ModuleList.AddObject(x,moduledata);
end;
end;
until module32next(ths,me32)=false;
finally
closehandle(ths);
end;
end;
end;
|
ALL FUNCTIONS:
| Code: |
type
{$IFNDEF FPC}
{$IFDEF CPUX64}
PtrInt = Int64;
PtrUInt = UInt64;
{$ELSE}
PtrInt = longint;
PtrUInt = Longword;
{$ENDIF}
{$ENDIF}
SuperInt = Int64;
type TModuleInfo=record
modulename: string;
modulepath: string;
isSystemModule: boolean;
baseaddress: ptrUint;
basesize: dword;
is64bitmodule: boolean;
symbolsLoaded: boolean; //true if the api symbols have been handled
end;
type
NTSTATUS = ULONG;
THREADINFOCLASS = DWORD;
type tmoduledata =class
public
moduleaddress: ptrUint;
modulesize: dword;
end;
TModuleInfoArray=array of TModuleInfo;
var
modulelistpos: integer;
modulelist: TModuleInfoArray;
procedure cleanModuleList(ModuleList: TStrings);
var i: integer;
begin
for i:=0 to ModuleList.Count-1 do
if ModuleList.Objects[i]<>nil then
begin
tmoduledata(ModuleList.Objects[i]).Free;
ModuleList.Objects[i]:=nil;
end;
ModuleList.Clear;
end;
function getmodulebyaddress(address: ptrUint; var mi: TModuleInfo):BOOLEAN;
var i: integer;
begin
result:=false;
for i:=0 to modulelistpos-1 do
if (address>=modulelist[i].baseaddress) and (address<modulelist[i].baseaddress+modulelist[i].basesize) then
begin
mi:=modulelist[i];
result:=true;
break;
end;
end;
function inSystemModule(address: ptrUint): BOOLEAN;
var mi: TModuleInfo;
begin
result:=false;
if getmodulebyaddress(address,mi) then
result:=mi.isSystemModule;
end;
|
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25818 Location: The netherlands
|
Posted: Mon Mar 30, 2015 2:15 am Post subject: |
|
|
don't use inSystemModule in GetModuleList but check it another way
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
cleiton Newbie cheater
Reputation: 0
Joined: 05 Mar 2014 Posts: 21
|
Posted: Mon Mar 30, 2015 10:24 am Post subject: |
|
|
| Dark Byte wrote: | | don't use inSystemModule in GetModuleList but check it another way |
Why not?
I wanna do as the Cheat Engine does, it's simply all I want is that working as cheat engine dissect code..
Thaks
|
|
| Back to top |
|
 |
cleiton Newbie cheater
Reputation: 0
Joined: 05 Mar 2014 Posts: 21
|
Posted: Wed Apr 01, 2015 4:46 pm Post subject: |
|
|
| Dark Byte wrote: | | don't use inSystemModule in GetModuleList but check it another way |
Please, reply me
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25818 Location: The netherlands
|
Posted: Wed Apr 01, 2015 5:22 pm Post subject: |
|
|
check if the path is inside the windows folder, and if so, it's a system module
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
|