Your question is quite a bit unclear to me. I'll try several interpretations and answers :
- I want to pass the address of a variable to another program. How ?
This question is answered by the Zen of interpreted languages : Even if you had the address, what would you do with it ? You don't know in what binary format variables are stored and cross-process memory access does not work, not even under Windows 9x (at least, reliably).
- I want to change a variable from another program. How ?
Interprocess communication is best done by reading perlman:perlipc. I suggest Win32::Semaphore if working under Win32, but you might also find success in using read/write pipes.
- I want to patch another program currently running in memory. How ?
While this is thinkable in Perl, it's quite a non-trivial task. To patch other running programs under Windows, you must attach the current process as a debugger to the running process, something which needs deep tinkering with the Windows API and callbacks/threading, two things with levels that range from "advanced" to "black magic". Forget about using Perl in that case, unless you want to prove a point.
|Replies are listed 'Best First'.|
Better clarify : How do I find out the RAM memory address of a var in a program running on WIN ?
by DarkGoth (Acolyte) on Jan 30, 2001 at 16:22 UTC
by tilly (Archbishop) on Jan 30, 2001 at 21:20 UTC