On Fri, 08 Jun 2018, Demosthenes Koptsis wrote:
> Hello, i implemented a ptrace and waitpid external functions in order to
> read/write a memory address of a process.
> 
> i want to make a trainer for a game in gambas and i created a small program
> that reads and writes to a memory process.
> 
> The problem is that when i try to write to memory it freezes at waitpid
> line.
> 
> i attach the test program you have to 1) open it as root 2) run a process
> you want to hack and get the pid 3) scan memory with scanmem and locate an
> address you want to write. 4) run my test program and see it freezes.
> 
> Any help?
> 

Does the same code work in a C program? It seems like waitpid() is just what
you need to do after PTRACE_ATTACH, but anyway I'd say it's a good idea to
develop the low-level bits in C first, so that we're sure it's the translation
to Gambas which is faulty, and not the algorithm.

Three other remarks:

  * I'm certainly not running a random somebody's buggy program as root.
    Can't you spawn a child process yourself and then use PTRACE_TRACEME
    for debugging purposes? That shouldn't require root privileges.

  * You should also check return values of system calls.

  * THIS MAILING LIST IS DEPRECATED. USE THE NEW ONE: 
https://lists.gambas-basic.org/listinfo/user

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to