View previous topic :: View next topic |
Author |
Message |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Thu Mar 14, 2013 1:59 pm Post subject: Attaching using PID... |
|
|
Hey, When I attach using PID, its "successfully"attaching to any random bytes..
Like if I make a trainer form, put inside Editbox, and a button, that will do this:
Code: | function attach()
local pname=tonumber(control_getCaption( UDF1_CEEdit1 ));
if pname ~='' then
openProcess(pname)
local err=getOpenedProcessID()
if err==0 then
showMessage("Failed attaching to the given PID")
elseif err~=0 then
control_setEnabled(UDF1_CEButton2, true)
control_setCaption(UDF1_CELabel4, "Currently attached to PID: " .. err)
showMessage("Succeed attaching to the given PID")
if pname=='' then return end
end
end
end |
But if I write random numbers (e.g 123854031292) it still success attaching..
Although its not really attached to any processor (no processor has been opened in C.E).
How can I prevent this or fix this?
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25719 Location: The netherlands
|
Posted: Thu Mar 14, 2013 2:03 pm Post subject: |
|
|
Hmm, doesn't look like it.
But what you can do is use this code after openProcess:
Code: |
errorOnLookupFailure(false)
reinitializeSymbolhandler()
err=getAddress("kernel32.dll")==0
|
err will be true if no process is open
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Thu Mar 14, 2013 2:13 pm Post subject: |
|
|
Dark Byte wrote: | Hmm, doesn't look like it.
But what you can do is use this code after openProcess:
Code: |
errorOnLookupFailure(false)
reinitializeSymbolhandler()
err=getAddress("kernel32.dll")==0
|
err will be true if no process is open |
Code: | function attach()
local pname=tonumber(control_getCaption( UDF1_CEEdit1 ));
if pname ~='' then
openProcess(pname)
errorOnLookupFailure(false)
reinitializeSymbolhandler()
err=getAddress("kernel32.dll")==0
if err==0 then
showMessage("Failed attaching to the given PID")
elseif err~=0 then
showMessage("Succeed attaching to the given PID")
if pname=='' then return end
end
end
end |
Did this, but It still gives the message "Succeed attaching to the given PID"
And solution for this?
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25719 Location: The netherlands
|
Posted: Thu Mar 14, 2013 2:15 pm Post subject: |
|
|
err is a boolean, not an integer
true isn't the same as 0 (not even in c)
try "if err then " (or "if err==true then")
or in my script change err=getAddress("kernel32.dll")==0 to err=getAddress("kernel32.dll")
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
|
Back to top |
|
 |
|