From: 5k3105 on
On Jul 27, 3:36 pm, "Thorsten Albers"

> Usually there is a hotkey which has to be hit to enter the monitor while an
> application is running in the emulator. AFAIK WinVice has a built in
> monitor.

Ok. I've read that somewhere else as well, that the window or process
handle is not necessarily the exact base address...

And yes, I know many things about Vice's monitor :) But this is one
command line interface and I have ideas for something a little more
specialized and user friendly while I'm developing so..

My other idea is to simply scan all of memory. No need for pointers to
memory locations. The C64 boots up with definite recognizable blocks
that should be searchable ie the BASIC and KERNAL roms. I would shell
execute the emulator and once it comes up execute a search for the
binary string of the kernal or basic, therefore the rest of the 64k
block. Maybe using less than 10 bytes of the kernal would give me a
unique field to search for.

What I would need help on is to find the fastest memory reading
function.

Thanks.
From: Tom Shelton on
5k3105 formulated on Tuesday :
> I want to open a game program of mine running in an windows emulator
> and read and write directly to offsets in that memory space. So I need
> the base address of the process/window.
>
> If I start it from my program maybe it will be easier to get the base
> address?
>
> I already have a program that will allow me to scroll the memory space
> in hex I just need a way to get the base address.
>
> Thanks.

ReadProcessMemory/WriteProcessMemory. I believe these are the api's
you'll want for reading and writting to the other process.

Others you'll probably need:

CreateProcess - if you need to programatically start the process
OpenProcess - if you are attachign to an already running process.

You'll probably need to use FindWindow or EnumWindows to get a handle
to the main window of the game if you are going to be attaching to an
already running instance... And then use GetWindowThreadProcessId to
actually get the process id to pass to OpenProcess

You'll also need CloseHandle to clean up when done.

--
Tom Shelton


From: Thorsten Albers on
5k3105 <christianlott1(a)yahoo.com> schrieb im Beitrag
<541c93cc-749d-4b21-8ecf-d6207a9aa222(a)a30g2000vba.googlegroups.com>...
> My other idea is to simply scan all of memory. No need for pointers to
> memory locations. The C64 boots up with definite recognizable blocks
> that should be searchable ie the BASIC and KERNAL roms. I would shell
> execute the emulator and once it comes up execute a search for the
> binary string of the kernal or basic, therefore the rest of the 64k
> block. Maybe using less than 10 bytes of the kernal would give me a
> unique field to search for.
>
> What I would need help on is to find the fastest memory reading
> function.

Ok. ReadProcessMemory() and WriteProcessMemory() etc. have already been
mentioned by Tom; VirtualQueryEx() and VirtualProtectEx() presumably will
be needed too. In addition you may try StackWalk() from the library
DBGHELP.DLL which AFAIK is shipped with Windows version >= 2000 but has to
be manually installed on Windows 9x.
Information on how to handle these procedures you have to extract from the
MSDN.

And - it will be hard work to do...

--
Thorsten Albers

albers (a) uni-freiburg.de

From: Karl E. Peterson on
Mike Williams formulated the question :
> "dpb" <none(a)non.net> wrote...
>
>> I'm thinkin' the same thing, Karl...he's going to spawn another
>> process I'm virtually certain and won't have access to it owing
>> to OS saying "not yours!"...

yep.

> Many years ago (too long to remember!) I used to do stuff like this on
> admittedly much simpler machines like the Oric and the C64, but I think it is
> still possible (although much more difficult) to do it on modern PCs. In my
> day there were two main basic methods. One was to modify the game code itself
> before the game was run and the other was to modify the contents of the
> memory addresses it used to store various data items at runtime. It was very
> easy many years ago on simpler machines, but I am far too long in the tooth
> now to even consider delving into how it can be achieved on modern PCs!

I'm thinking, *maybe* in a Win95 VM?

Definitely not in NT class operating systems.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Dee Earley on
On 27/07/2010 21:52, 5k3105 wrote:
> On Jul 27, 3:36 pm, "Thorsten Albers"
>
>> Usually there is a hotkey which has to be hit to enter the monitor while an
>> application is running in the emulator. AFAIK WinVice has a built in
>> monitor.
>
> Ok. I've read that somewhere else as well, that the window or process
> handle is not necessarily the exact base address...

No, it's not any kind of address, it's a handle.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)