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 


How to execute a remote program (C++)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Negima
I post too much
Reputation: 6

Joined: 22 May 2007
Posts: 2221

PostPosted: Wed Apr 09, 2008 1:57 pm    Post subject: How to execute a remote program (C++) Reply with quote

Does anyone know how to do this? msnd wasn't a very good source.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 09, 2008 2:20 pm    Post subject: Reply with quote

It was a fantastic source

CreateProcess http://msdn2.microsoft.com/en-us/library/ms682425.aspx
Back to top
View user's profile Send private message
Negima
I post too much
Reputation: 6

Joined: 22 May 2007
Posts: 2221

PostPosted: Wed Apr 09, 2008 2:50 pm    Post subject: Reply with quote

Tried that one before, couldn't get it to work

Code:
#include <iostream>
#include <windows.h>

int main()
{
   int shutDown;
   std::cout << "Please enter how long you want to wait before your computer shuts down (miliseconds)\n";
      std::cin >> shutDown;
   Sleep(shutDown);
   CreateProcess("C:\\Windows\\System32\\shutdown.exe");
   return 0;
}



Code:
------ Build started: Project: Shut down timer, Configuration: Debug Win32 ------
Compiling...
Shut down timer.cpp
c:\users\joseph\documents\visual studio 2008\projects\shut down timer\shut down timer\shut down timer.cpp(10) : error C2660: 'CreateProcessW' : function does not take 1 arguments
Build log was saved at "file://c:\Users\Joseph\Documents\Visual Studio 2008\Projects\Shut down timer\Shut down timer\Debug\BuildLog.htm"
Shut down timer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


what am I doing wrong here
Back to top
View user's profile Send private message Visit poster's website
Drops
Advanced Cheater
Reputation: 0

Joined: 22 Feb 2008
Posts: 62

PostPosted: Wed Apr 09, 2008 3:24 pm    Post subject: Reply with quote

Code:

STARTUPINFO siSD;
PROCESS_INFORMATION piSD;
CreateProcess((LPCTSTR)"C:\\Windows\\System32\\shutdown.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &siSD, &piSD);


I think I'm forgetting or doing something wrong here though.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Apr 09, 2008 3:24 pm    Post subject: Reply with quote

Negima wrote:
Tried that one before, couldn't get it to work

Code:
#include <iostream>
#include <windows.h>

int main()
{
   int shutDown;
   std::cout << "Please enter how long you want to wait before your computer shuts down (miliseconds)\n";
      std::cin >> shutDown;
   Sleep(shutDown);
   CreateProcess("C:\\Windows\\System32\\shutdown.exe");
   return 0;
}



Code:
------ Build started: Project: Shut down timer, Configuration: Debug Win32 ------
Compiling...
Shut down timer.cpp
c:\users\joseph\documents\visual studio 2008\projects\shut down timer\shut down timer\shut down timer.cpp(10) : error C2660: 'CreateProcessW' : function does not take 1 arguments
Build log was saved at "file://c:\Users\Joseph\Documents\Visual Studio 2008\Projects\Shut down timer\Shut down timer\Debug\BuildLog.htm"
Shut down timer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


what am I doing wrong here


It's telling you exactly what's wrong. CreateProcess does not take 1 argument. Is that hard to understand?

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Negima
I post too much
Reputation: 6

Joined: 22 May 2007
Posts: 2221

PostPosted: Wed Apr 09, 2008 3:28 pm    Post subject: Reply with quote

samuri25404 wrote:
Negima wrote:
Tried that one before, couldn't get it to work

Code:
#include <iostream>
#include <windows.h>

int main()
{
   int shutDown;
   std::cout << "Please enter how long you want to wait before your computer shuts down (miliseconds)\n";
      std::cin >> shutDown;
   Sleep(shutDown);
   CreateProcess("C:\\Windows\\System32\\shutdown.exe");
   return 0;
}



Code:
------ Build started: Project: Shut down timer, Configuration: Debug Win32 ------
Compiling...
Shut down timer.cpp
c:\users\joseph\documents\visual studio 2008\projects\shut down timer\shut down timer\shut down timer.cpp(10) : error C2660: 'CreateProcessW' : function does not take 1 arguments
Build log was saved at "file://c:\Users\Joseph\Documents\Visual Studio 2008\Projects\Shut down timer\Shut down timer\Debug\BuildLog.htm"
Shut down timer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


what am I doing wrong here


It's telling you exactly what's wrong. CreateProcess does not take 1 argument. Is that hard to understand?
No need to be rude, it should be obvious that I am fairly new to programming and I don't know what a argument is.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 09, 2008 4:14 pm    Post subject: Reply with quote

Code:
#include <windows.h>

STARTUPINFO sInfo;
PROCESS_INFORMATION pInfo;

int main(){
   ZeroMemory(&sInfo, sizeof(sInfo));
   sInfo.cb = sizeof(STARTUPINFO);

   CreateProcess("C:\\Windows\\System32\\notepad.exe", NULL, NULL,
              NULL, FALSE, NULL, NULL, NULL, &sInfo, &pInfo);

   return 0;
}


easy
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Apr 09, 2008 7:30 pm    Post subject: Reply with quote

Negima wrote:
samuri25404 wrote:
Negima wrote:
Tried that one before, couldn't get it to work

Code:
#include <iostream>
#include <windows.h>

int main()
{
   int shutDown;
   std::cout << "Please enter how long you want to wait before your computer shuts down (miliseconds)\n";
      std::cin >> shutDown;
   Sleep(shutDown);
   CreateProcess("C:\\Windows\\System32\\shutdown.exe");
   return 0;
}



Code:
------ Build started: Project: Shut down timer, Configuration: Debug Win32 ------
Compiling...
Shut down timer.cpp
c:\users\joseph\documents\visual studio 2008\projects\shut down timer\shut down timer\shut down timer.cpp(10) : error C2660: 'CreateProcessW' : function does not take 1 arguments
Build log was saved at "file://c:\Users\Joseph\Documents\Visual Studio 2008\Projects\Shut down timer\Shut down timer\Debug\BuildLog.htm"
Shut down timer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


what am I doing wrong here


It's telling you exactly what's wrong. CreateProcess does not take 1 argument. Is that hard to understand?
No need to be rude, it should be obvious that I am fairly new to programming and I don't know what a argument is.


An argument is a value passed to a parameter.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 09, 2008 8:22 pm    Post subject: Reply with quote

x0r wrote:
Since you're globally defining it, the structure is empty (filled with NULL entries) all you would need to do is change the cbSize member. Anyway, for extra security you could have done { 0 } to ensure the entire structure was empty.

Lastly, I don't think those last two parameters are needed; being that they're optional. So in such a simple application as you've pointed out, it seems trivial Razz


noted, thanks.
Back to top
View user's profile Send private message
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