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 


Sniffing Command-Line Arguments through arguments?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Oct 12, 2008 9:14 am    Post subject: Sniffing Command-Line Arguments through arguments? Reply with quote

How would I get the commandline arguements of a application? For example to run neuz.exe you need to call it as neuz.exe sunkist

Is it possible to get this value through a debugger or anything?
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sun Oct 12, 2008 9:17 am    Post subject: Reply with quote

If i got you right, you can do it in C++ like so:

Code:

int main(int argc,char* argv[])
{
for(int i = 0;i < argc;i++)
std::cout << argv[i]

}
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Oct 12, 2008 9:24 am    Post subject: Reply with quote

Given that the file is being checked before executed so that you cannot replace the file with yours to sniff...
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sun Oct 12, 2008 12:07 pm    Post subject: Reply with quote

Open the launcher up in olly and search for createprocess/shellexecute and look at the arguments passed when they're called. Or open up the program in olly and search for getstartupinfo.
_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sun Oct 12, 2008 12:12 pm    Post subject: Reply with quote

Put a breakpoint on CreateProcessA/W and ShellExecute when you have the launcher open.
Back to top
View user's profile Send private message MSN Messenger
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Sun Oct 12, 2008 12:42 pm    Post subject: Reply with quote

Another way is to debug the application (neuz.exe) and setup a breakpoint on GetCommandLine().
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Sun Oct 12, 2008 12:54 pm    Post subject: Reply with quote

or just use this program you can see command line arguments of every running process and suspend threads to debug.. etc.. you can even stop gameguard from loading (but it wont do any good)


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


_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Oct 12, 2008 1:10 pm    Post subject: Reply with quote

Thank you for your help but its useless since I forgot to mention the program is protected with themida....................... So I don't have access to the original exe that executes the program:

say the program that requires parameters is called a.exe It is not protected in any way.

The program that executes a.exe is protected with themida so...
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sun Oct 12, 2008 1:18 pm    Post subject: Reply with quote

Attach CE or olly to the launcher after it unpacks.
_________________
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Oct 12, 2008 1:31 pm    Post subject: Reply with quote

Do you even understand what themida is? If you do then you would not have made that idiotic comment.

EDIT: thank you pkedpker. Your program works perfect.
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sun Oct 12, 2008 1:46 pm    Post subject: Reply with quote

dnsi0 wrote:
Do you even understand what themida is? If you do then you would not have made that idiotic comment.

EDIT: thank you pkedpker. Your program works perfect.
Attaching w/ olly is really easy with themida. YOU are the one who makes idiotic comments.
_________________
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Oct 12, 2008 1:56 pm    Post subject: Reply with quote

how? freezing the program then attaching?
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon Oct 13, 2008 2:51 pm    Post subject: Reply with quote

I wrote this one just for you :) Well, out of interest.
Code:
Usage: getcommandline.exe PID

Refresh if the attachment is not seen.

And this is how to find it:
Code:
PROCESS_BASIC_INFORMATION
->PebBaseAddress
->ProcessParameters
->CommandLine.Buffer


Will require this (I think): Microsoft Visual C++ 2008 Redistributable Package (x86). So if it's crashing, try installing that one and then blame me if it still crashes :p



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
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Tue Oct 14, 2008 2:13 am    Post subject: Reply with quote

PROCESS_BASIC_INFORMATION. You get that structure from ZwQueryInformationProcess right?
The offsets in that structure, how are you sure that they're right? It's an unsupported api, so doesn't the structure change on every OS or service pack?

For the MsVC2008 Redistributable Package: When you go to project options, there's an option somewhere that is default set to 'multi-threaded dll'. If you change that to 'multi-threaded' then you don't need the package anymore.
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Tue Oct 14, 2008 5:44 am    Post subject: Reply with quote

tombana wrote:
PROCESS_BASIC_INFORMATION. You get that structure from ZwQueryInformationProcess right?
The offsets in that structure, how are you sure that they're right? It's an unsupported api, so doesn't the structure change on every OS or service pack?
I do check if the pointer to the function is OK, if it isn't I just throw an error. It does work on anything newer that W2k. And besides is anyone here running 9x? Less than 1% I'd guess.

tombana wrote:
For the MsVC2008 Redistributable Package: When you go to project options, there's an option somewhere that is default set to 'multi-threaded dll'. If you change that to 'multi-threaded' then you don't need the package anymore.
That's true, but then your executable grows like hell. Compare my 9KB with your >1MB or something. Myself, I prefer dynamically linking, because almost everyone has the redist package installed nowdays, since many games, etc, require it. So, if you've the package, you don't need to DL it anymore in a static linked executable -> saves B/W and HDD space (not that much, but anyway, a bit :) ). I suggest you to change your "multithreaded" back to "multithreaded dll." :)

</Offtopic>
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
Goto page 1, 2  Next
Page 1 of 2

 
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