[Gambas-user] external function freezes

Demosthenes Koptsis demosthenesk at gmail.com
Sat Jun 9 09:38:36 CEST 2018


The same code freezes also a c++ project and c project.


On 06/09/2018 12:11 AM, Tobias Boege wrote:
> 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
>



More information about the User mailing list