View previous topic :: View next topic |
Author |
Message |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Sat Oct 24, 2009 10:52 pm Post subject: [C#]Injecting a DLL |
|
|
So I'm using samurai's class to inject my dlls, I just had one question.
-How come the injection code works sometimes, while other times it just doesn't work at all
The error that always stops me is WriteProcessMemory not working correctly, any idea why it wouldn't work?
_________________
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Oct 24, 2009 11:43 pm Post subject: |
|
|
or you know, you could just debug it instead of expecting us to be psychic
also: GetLastError()
|
|
Back to top |
|
 |
nwongfeiying Grandmaster Cheater
Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Sat Oct 24, 2009 11:55 pm Post subject: |
|
|
slovach is psychic.
|
|
Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Oct 25, 2009 10:51 am Post subject: |
|
|
nwongfeiying wrote: | slovach is psychic. |
and your a spammer.
Also what happens? Does it throw exceptions or what?
_________________
Intel over amd yes. |
|
Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun Oct 25, 2009 11:59 am Post subject: |
|
|
I sometimes have injection errors too: it always happens the first time after a reboot, and only once. After that it always works.
Is that also what happens to you?
|
|
Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Sun Oct 25, 2009 1:02 pm Post subject: |
|
|
Oh crap, sorry for forgetting to put the actual error
I get error code 1008 which according to this website
http://help.netop.com/support/errorcodes/win32_error_codes.htm
is:
1008 An attempt was made to reference a token that does not exist. ERROR_NO_TOKEN
The error always appears right after the WPM line.
I'm on Vista, 32, UAC disabled
What makes this weird is that sometimes it works perfectly, other times I can't inject anything at all with his code.
No exceptions are thrown btw to answer that question.
_________________
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Oct 25, 2009 2:10 pm Post subject: |
|
|
Since we don't know where the source you're using is, I decided to take a trek over to that crappy forum of yours. Having found it, I can tell you that your pinvoke of WriteProcessMemory is incorrect, and that checking the last error as a condition is bad form as when it is set it is not unset, meaning anything could trigger it. Therefore, you should fix your pinvoke and check the return value.
|
|
Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Oct 25, 2009 9:13 pm Post subject: |
|
|
set the privileges with adjusttokenprivileges
|
|
Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Mon Oct 26, 2009 5:52 pm Post subject: |
|
|
How come I would be adjusting priveleges if the error is that there is no token?
_________________
|
|
Back to top |
|
 |
|