Injecting Procedure to another process

Share your advanced PureBasic knowledge/code with the community.
okasvi
Enthusiast
Enthusiast
Posts: 150
Joined: Wed Apr 27, 2005 9:41 pm
Location: Finland

Post by okasvi »

which method were you using? i havent gotten that kind of error message at never...
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

:-S is your debugger disabled?
bye,
Daniel
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Post by LuCiFeR[SD] »

Using dark dragons code I think? second example in the first post.

and yes, I think the debugger was disabled EDIT: I lied Debugger was enabled (I find it so difficult to tell from the IDE gadgets these days if the debbuger is on or off!) Injects successfully if debugger disabled. My apologies for being a dumb ass lol
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Looks like microsoft aren't that clever after all... ;)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Post by LuCiFeR[SD] »

DoubleDutch wrote:Looks like microsoft aren't that clever after all... ;)
yes, seems odd that with the debugger on that M$ successfully interupts it. my faith in M$ was almost converted lol. At least somebody (other than me) thought to check if the debugger was enabled LMAO
okasvi
Enthusiast
Enthusiast
Posts: 150
Joined: Wed Apr 27, 2005 9:41 pm
Location: Finland

Post by okasvi »

ricardo wrote:Can anybody show something that the injected code can do without crashing?

I was only able to use delays and msgboxes, but not anymore. Any API call (per example) crashes for me.
here is one apicall used...

Code: Select all

Procedure RemoteThread()
	MessageRequester("Success","Injection worked.")
	CreateProcess_(0, "calc.exe", 0, 0, 0, #CREATE_SUSPENDED, 0, 0, @sinfo.STARTUPINFO, @pinfo.PROCESS_INFORMATION)
EndProcedure
after injecting that check your taskmanager(ctrl+alt+delete) and there should be calc.exe running ;)
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

LuCiFeR[SD] wrote:EDIT: I lied Debugger was enabled (I find it so difficult to tell from the IDE gadgets these days if the debbuger is on or off!) Injects successfully if debugger disabled. My apologies for being a dumb ass lol
Ok so now is all right again ;) . Debugger already had to be disabled with the code before.
bye,
Daniel
xgp
Enthusiast
Enthusiast
Posts: 128
Joined: Mon Jun 13, 2005 6:03 pm

Post by xgp »

Happened to me the same as LuCiFeR[SD].
Debugger disabled runs perdectly, when debugger is on it crashes.

xgp
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

If debugger is on it attemps to inject a part of the debugging code too!

Okvasi:

Code: Select all

DisableDebugger ;DISABLES DEBUGGER! This is needed.
add that on top of the sources so no one mistakes this. Then the source will work!
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

thefool wrote:If debugger is on it attemps to inject a part of the debugging code too!

Okvasi:

Code: Select all

DisableDebugger ;DISABLES DEBUGGER! This is needed.
add that on top of the sources so no one mistakes this. Then the source will work!
Yes, or we use some Critical Sections, that should also work.
bye,
Daniel
okasvi
Enthusiast
Enthusiast
Posts: 150
Joined: Wed Apr 27, 2005 9:41 pm
Location: Finland

Post by okasvi »

Critical sections? sounds interesting, tell me more... :)
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

okasvi wrote:Critical sections? sounds interesting, tell me more... :)
Critical Sections are for using strings in Threads. Maybe you should use them then.

In this Topic are a few Methods:

http://forums.purebasic.com/german/view ... l+sections
bye,
Daniel
okasvi
Enthusiast
Enthusiast
Posts: 150
Joined: Wed Apr 27, 2005 9:41 pm
Location: Finland

Post by okasvi »

found this and looked easy enought to implement viewtopic.php?t=16488&highlight=critical+sections


but do i really need that if i inject only one thread to same process?
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

okasvi wrote:found this and looked easy enought to implement viewtopic.php?t=16488&highlight=critical+sections


but do i really need that if i inject only one thread to same process?
Yes, threads are not secure, so it could crash.
bye,
Daniel
xgp
Enthusiast
Enthusiast
Posts: 128
Joined: Mon Jun 13, 2005 6:03 pm

Post by xgp »

I've tried other operations(Files) than Messagerequester and it crashes on that line.(I've made a messagerequester to every operation in the thread).

xgp
Post Reply