Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Run program button?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
The Dami3n
Master Cheater
Reputation: 1

Joined: 15 Nov 2006
Posts: 441
Location: Mulkerolandia

PostPosted: Mon Oct 29, 2007 11:13 am    Post subject: Run program button? Reply with quote

How can i take specific program path out from register, and then run that program?
_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Mon Oct 29, 2007 5:10 pm    Post subject: Reply with quote

RegOpenKeyEx(), RegGetValue(), CreateProcess();
Back to top
View user's profile Send private message
The Dami3n
Master Cheater
Reputation: 1

Joined: 15 Nov 2006
Posts: 441
Location: Mulkerolandia

PostPosted: Tue Oct 30, 2007 11:00 am    Post subject: Reply with quote

Can u give me example how to use them, i already have registery path...
_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Oct 30, 2007 11:54 am    Post subject: Reply with quote

I know only in delphi and C#.
Delphi:
Add to uses Registry.
Make a variable of TRegistry. (Ex. var Reg: TRegistry;)
Add now reg:=TRegistry.Create; (I suggest you to add it in form.create)
Now use Reg.OpenKey(); to open a key, Reg.Read String/Bool/Integer/Binary and remember, when you want to read a value from another key just use Reg.CloseKey(); thats all.

In C# add Using Microsoft.Win32;
And pretty much the same, Registry.BlaBla(); and for reading values if (Registry.BlaBla() == "Blaaaa")
{
Blaaaaaaaaaaa
}

Edit: Wait 2 seconds I'll upload a mini program source. (I'll just comment it and rar Smile )

Edit2: Attached. (Delphi)



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message
The Dami3n
Master Cheater
Reputation: 1

Joined: 15 Nov 2006
Posts: 441
Location: Mulkerolandia

PostPosted: Tue Oct 30, 2007 12:26 pm    Post subject: Reply with quote

Thanks for the all replys, i got it finally work Very Happy
Thank you all who helped me!

Symbol you again Razz, i luv you!

_________________
Back to top
View user's profile Send private message
SnipaReapa
How do I cheat?
Reputation: 0

Joined: 24 Nov 2007
Posts: 7

PostPosted: Sat Nov 24, 2007 1:31 am    Post subject: Reply with quote

nice
_________________
THE PWNAGE KING OF ALL GAMES! :/
Back to top
View user's profile Send private message
DURAN
Newbie cheater
Reputation: 14

Joined: 19 Apr 2007
Posts: 16
Location: The Netherlands

PostPosted: Fri Dec 07, 2007 7:08 am    Post subject: Reply with quote

i need For VB6
Back to top
View user's profile Send private message
rump
Expert Cheater
Reputation: 0

Joined: 03 Oct 2007
Posts: 169

PostPosted: Fri Dec 07, 2007 9:31 am    Post subject: Reply with quote

How do you get the registry path? (sorry for this uttermost noobful question)
_________________
C# boot camp, PM me if you want a simple application made and I'll give it a try!
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Fri Dec 07, 2007 9:44 am    Post subject: Reply with quote

Wow, 3 bumpers, 1 thread... Rolling Eyes
Snipa, shut up, MobScene, google and rump, what language do you need? if its delphi there's a link up there ^ if its something else, GOOGLE IT!
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8586
Location: 127.0.0.1

PostPosted: Fri Dec 07, 2007 10:12 am    Post subject: Reply with quote

MobScene wrote:
i need For VB6


Look up the same API that was given above on the following site:
http://allapi.mentalis.org/apilist/apilist.php

It contains examples for VB6 (and in some cases VB.NET) for almost if not all the API.

rump wrote:
How do you get the registry path? (sorry for this uttermost noobful question)


If you are refering how to know where to look at in the registry to obtain said information, you would need to open regedit yourself, or another registry editor program. In most cases, games come packed inside an installer which will create registry keys for the most typical things such as the install path, cd location, etc. The usual spot for these to show up for is in HKEY_LOCAL_MACHINE so looking there first would be a good start.

Taking Steam as an example. The company the creates and publishes Steam is Valve, so inside our registry we look for 'Steam' or 'Valve'.



In this case it was under Valve then Steam as a subkey. From there you can see on the right we have the install path to the program in the registry which is used to easily locate the path to the game.

Not all games use the registry, and not all games keep the path listed in it either. If worse comes to worse, on the first run of your program, have the user select the exe themselves and store the location in the registry yourself, or in another configuration style file such as an INI file.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
rump
Expert Cheater
Reputation: 0

Joined: 03 Oct 2007
Posts: 169

PostPosted: Fri Dec 07, 2007 2:09 pm    Post subject: Reply with quote

Code:
LONG WINAPI RegOpenKey(
  __in      HKEY hKey,
  __in_opt  LPCTSTR lpSubKey,
  __out     PHKEY phkResult
);


this is the code for RegOpenKey() on msdn, I read the information for it but I still have problems using it..

Will I by using this and putting the regkey for ventrilo 2.1.4.exe as hkey be able to start ventrilo on whichever machine my form is executed on?

//EDIT: Seeing as ventmix sometimes isnt installed, merely unrared which will not lead to the creation of a regkey my application will need, is there a third way of creating a process, like searching for the process name ventrilo 2.1.4.exe somehow?

//EDIT2:

Code:
            RegOpenKey(
            HKEY_USERS,
            VENTRILO 2.1.4.EXE3FE763CD0008E000,
            RegCloseKey();

            );


This is what I'm trying to do in my button_click method but I'm overwhelmed with errors and I'm wondering if C# will interpret code1 different from code2

example code1

Code:
method(

someting,
something
);


example code2
Code:
method(something, something);

_________________
C# boot camp, PM me if you want a simple application made and I'll give it a try!
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8586
Location: 127.0.0.1

PostPosted: Fri Dec 07, 2007 4:02 pm    Post subject: Reply with quote

Heres a quick example in C++ reading a games install path:

Code:
   DWORD   dwDataSize         = NULL;
   HKEY   hKey            = NULL;
   TCHAR   tKey[MAX_PATH]      = {0};
   TCHAR   tGamePath[MAX_PATH]   = {0};

   _stprintf_s( tKey, sizeof(tKey), "SOFTWARE\\Nostale(UK)" );
   if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, tKey, NULL, KEY_READ, &hKey ) != ERROR_SUCCESS )
   {
      LogText( "[ERROR] Registry entry missing..." );
      return FALSE;
   }
   else
   {
      DWORD dwType = REG_SZ;
      if( RegQueryValueEx( hKey, _T("DestDir"), 0, &dwType, (PBYTE)NULL, &dwDataSize ) == ERROR_SUCCESS )
      {
         RegQueryValueEx( hKey, _T("DestDir"), 0, &dwType, (PBYTE)(LPTSTR)tGamePath, &dwDataSize );
      }
      else
      {
         LogText( "[ERROR] Reg: Failed to locate game path." );
         return FALSE;
      }
   }
   RegCloseKey( hKey );


The path was located at:
HKEY_LOCAL_MACHINE\SOFTWARE\Nostale(UK)
And the key that held the path was:
DestDir

Hopefully that should give you some insight.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites