View previous topic :: View next topic |
Author |
Message |
The Dami3n Master Cheater
Reputation: 1
Joined: 15 Nov 2006 Posts: 441 Location: Mulkerolandia
|
Posted: Mon Oct 29, 2007 11:13 am Post subject: Run program button? |
|
|
How can i take specific program path out from register, and then run that program?
_________________
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Oct 29, 2007 5:10 pm Post subject: |
|
|
RegOpenKeyEx(), RegGetValue(), CreateProcess();
|
|
Back to top |
|
 |
The Dami3n Master Cheater
Reputation: 1
Joined: 15 Nov 2006 Posts: 441 Location: Mulkerolandia
|
Posted: Tue Oct 30, 2007 11:00 am Post subject: |
|
|
Can u give me example how to use them, i already have registery path...
_________________
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Tue Oct 30, 2007 11:54 am Post subject: |
|
|
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 )
Edit2: Attached. (Delphi)
|
|
Back to top |
|
 |
The Dami3n Master Cheater
Reputation: 1
Joined: 15 Nov 2006 Posts: 441 Location: Mulkerolandia
|
Posted: Tue Oct 30, 2007 12:26 pm Post subject: |
|
|
Thanks for the all replys, i got it finally work
Thank you all who helped me!
Symbol you again , i luv you!
_________________
|
|
Back to top |
|
 |
SnipaReapa How do I cheat?
Reputation: 0
Joined: 24 Nov 2007 Posts: 7
|
Posted: Sat Nov 24, 2007 1:31 am Post subject: |
|
|
nice
_________________
THE PWNAGE KING OF ALL GAMES! :/ |
|
Back to top |
|
 |
DURAN Newbie cheater
Reputation: 14
Joined: 19 Apr 2007 Posts: 16 Location: The Netherlands
|
Posted: Fri Dec 07, 2007 7:08 am Post subject: |
|
|
i need For VB6
|
|
Back to top |
|
 |
rump Expert Cheater
Reputation: 0
Joined: 03 Oct 2007 Posts: 169
|
Posted: Fri Dec 07, 2007 9:31 am Post subject: |
|
|
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 |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Dec 07, 2007 9:44 am Post subject: |
|
|
Wow, 3 bumpers, 1 thread...
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8586 Location: 127.0.0.1
|
Posted: Fri Dec 07, 2007 10:12 am Post subject: |
|
|
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 |
|
 |
rump Expert Cheater
Reputation: 0
Joined: 03 Oct 2007 Posts: 169
|
Posted: Fri Dec 07, 2007 2:09 pm Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8586 Location: 127.0.0.1
|
Posted: Fri Dec 07, 2007 4:02 pm Post subject: |
|
|
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 |
|
 |
|