 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Fri Jun 29, 2007 5:17 am Post subject: Opening programs, not using ShellExecute? |
|
|
Ok... i got these programs i want to be able to open...
Lets say MapleStory (i never played, but people here seems to love it :\)
i want to execute MapleStory from a button/panel in my Delphi program.
But since i want this to work on every computer, i can't use ShellExecute (unless i tell them where to place it)
but is there a function/component in Delphi which kinda like "searchs" for the executables name?
thanks in advance.
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Fri Jun 29, 2007 8:20 am Post subject: |
|
|
You got to get the path from the registry. It's located in HKEY_LOCAL_MACHINE\SOFTWARE\Wizet\MapleStory in the string "ExecPath".
I don't know in what language you program, if its in Delphi, I quickly found this code in the anti-cheat section. ( I beleive Appalsap posted something better, could not find it)
| Quote: |
var
Reg: TRegistry;
PathString: String;
begin
Reg:=TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKey('SOFTWARE\Wizet\MapleStory',false) then
PathString:=reg.ReadString('ExecPath');
except
showmessage('Error: Unable to read from Maple's registry');
end;
PathString=PathString+'\MapleStory.exe';
if FileExists(PathString) then
ShellExecute(Handle, 'open', PChar(PathString), nil, nil, SW_SHOWNORMAL)
else
showmessage('Maple doesn't exists?! WTF?!');
Reg.Free;
end; |
^^^ by assaf84
If you want in C++
| Code: |
HKEY keyHandle;
char rgValue [1024];
DWORD size1;
DWORD Type;
if( RegOpenKeyEx( HKEY_LOCAL_MACHINE,
"SOFTWARE\\Wizet\\MapleStory",0,
KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS)
{
size1=1024;
RegQueryValueEx( keyHandle, "ExecPath", NULL, &Type,
(LPBYTE)rgValue,&size1);
RegCloseKey(keyHandle);
strcat(rgValue, "\\MapleStory.exe");
HINSTANCE hRet = ShellExecute(
HWND_DESKTOP,
"open",
rgValue,
NULL,
NULL,
SW_SHOW);
else {
MessageBox(NULL,"Error","Not found", MB_OK);
ExitProcess(1);
}
|
I beleive that CreateProcesse would be better, if it's in something else, sorry can't help.
_________________
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Fri Jun 29, 2007 10:20 am Post subject: |
|
|
i wrote delphi program, so i assumed people knew which program it was
but thanks alot, i will research into this.
|
|
| Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Fri Jun 29, 2007 11:32 am Post subject: |
|
|
You can use a component if your using Delphi 4/3.
Delphi32.com
then search in the WinAPI section, and you will find it.Yes, its Shell Execute, but it will automatically do it for you.Just type in the path for the component and done.^.^ i find it usefull.
_________________
CEF Moderator since 2007 ^_^
ZenX-Engine
Last edited by ZenX on Fri Jun 29, 2007 11:40 am; edited 1 time in total |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Jun 29, 2007 11:33 am Post subject: |
|
|
| CreateProcess
|
|
| Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Fri Jun 29, 2007 11:36 am Post subject: |
|
|
*Not my Script*
I found this.It may be usefull
| Code: |
function CreateProcessSimple(
sExecutableFilePath : string )
: string;
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory( @si, sizeof( si ), 0 );
si.cb := sizeof( si );
CreateProcess(
Nil,
// path to the executable file:
PChar( sExecutableFilePath ),
Nil, Nil, False,
NORMAL_PRIORITY_CLASS, Nil, Nil,
si, pi );
// "after calling code" such as
// the code to wait until the
// process is done should go here
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
end;
|
Now, all you have to do is call CreateProcessSimple(), let's say to run Windows' Notepad:
| Code: |
CreateProcessSimple( 'notepad' );
|
_________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|