Reading process memory

Got a problem with your sim software or your PC? Start here

Moderators: Pace Racing, Higpup, Koolbrown

Post Reply
User avatar
Ultimo_Posto
Alpaca Farmer
Posts: 3413
Joined: Tue Jan 18, 2005 5:38 pm
Contact:

Reading process memory

Post by Ultimo_Posto » Fri May 26, 2006 10:11 pm

I've been looking into building a util to display some basic realtime telemetry on a second monitor, principally so that I don't have to rotate my steering wheel display a hundred times in a race. There are other applications for this such as computing fuel strategies on-the-fly, but the first job is to discover where F1C stores the telemetry while you drive. I've spent about a week with a memory browser, and this is a sample of what I've got:

Image

Some of the data is spurious; not all variables are used for each driving mode, and you're completely at the mercy of the sim as to what you get. For example, I can get ambient temperature but not oil or water temp.

The next step is to write a small app to read some of these addresses and display them, and I'm stuck. I've tried C and Visual Basic and it seems they both have a function called ReadProcessMemory that will do just what I need, but I'm not familiar enough with either language to see it through. What I need is therefore:

1. Someone to write a demo app to read, eg. the address of fuel remaining, and display it,

or

2. A link to an app that will display the address of my choice in the process of my choice

Surprisingly, nobody in the sim community seems to have cracked this yet, including Simon Philips, the author of the F1C telemetry app itself. The implementation isn't complicated, but I haven't got 6 weeks right now to learn VB. Frustrating.

JohnW
Jaded Figurehead
Posts: 13266
Joined: Fri Apr 09, 2004 10:12 am
Location: High Desert, California

Post by JohnW » Fri May 26, 2006 11:23 pm

Hmmmm. I've been looking to have a reason to learn some C#. I think you can directly adress memory with any of the C variants. Some of the data does seem to be odd. Ambient Temp of over 700 Kelvin ?!!!

Do the values always appear at the same addresses ?
Image

User avatar
Ultimo_Posto
Alpaca Farmer
Posts: 3413
Joined: Tue Jan 18, 2005 5:38 pm
Contact:

Post by Ultimo_Posto » Sat May 27, 2006 12:45 am

JohnW wrote:Ambient Temp of over 700 Kelvin ?!!!
Well that is obviously not the ambient temp after all. It was slow detective work to find the right addresses. Sometimes they would hold the right value for a while and later on report garbage.
Do the values always appear at the same addresses ?
For most of the ones in the above table, yes. I've tested it on 3 different machines. Incidentally, the addresses for rFactor are different. rFactor will need a separate array of addresses, but functionally it will be able to use the same code.

User avatar
Hynee
Judging Panel Member
Posts: 3226
Joined: Thu Apr 08, 2004 3:43 am
Location: Melbourne, AUSTRALIA
Contact:

Post by Hynee » Sat May 27, 2006 2:58 am

How do you enter the strings? Just an address, or address and length of string?

I would guess that you just enter the address, and the program uses the first 1 or 2 bytes to tell the length of the string, but you've got a lot of split up strings.
||||||| Hynee |||||||

Image

User avatar
Ultimo_Posto
Alpaca Farmer
Posts: 3413
Joined: Tue Jan 18, 2005 5:38 pm
Contact:

Post by Ultimo_Posto » Sat May 27, 2006 12:24 pm

Hynee wrote:How do you enter the strings? Just an address, or address and length of string?

I would guess that you just enter the address, and the program uses the first 1 or 2 bytes to tell the length of the string, but you've got a lot of split up strings.
You point the software to the F1C.exe process, enter the address value and specify the variable type. The descriptions are just labels entered by me. It's F1C that's splitting the strings for things like track name. I guess that's how they're stored - as byte arrays. There's nowhere to tell it the length of the string. The strings for track name are a little bit useless because they have different offsets from track to track. Getting the data is the hard part. Once we have it stored in an array somewhere, we can parse it and pick pretty fonts to display it, or draw a nice dashboard and put text boxes all over it.

JohnW
Jaded Figurehead
Posts: 13266
Joined: Fri Apr 09, 2004 10:12 am
Location: High Desert, California

Post by JohnW » Sat May 27, 2006 2:19 pm

What's the name of the memory browser you found ?
Image

User avatar
Ultimo_Posto
Alpaca Farmer
Posts: 3413
Joined: Tue Jan 18, 2005 5:38 pm
Contact:

Post by Ultimo_Posto » Sat May 27, 2006 3:22 pm

Image

User avatar
Hynee
Judging Panel Member
Posts: 3226
Joined: Thu Apr 08, 2004 3:43 am
Location: Melbourne, AUSTRALIA
Contact:

Post by Hynee » Sat May 27, 2006 8:16 pm

Uh oh, Back Door Trojan, get it off your PC!

Image
||||||| Hynee |||||||

Image

User avatar
Hynee
Judging Panel Member
Posts: 3226
Joined: Thu Apr 08, 2004 3:43 am
Location: Melbourne, AUSTRALIA
Contact:

Post by Hynee » Sat May 27, 2006 8:29 pm

It could always just be a false hit, but hardly any sites link to- or talk about this site, so I just don't trust it.
||||||| Hynee |||||||

Image

User avatar
Ultimo_Posto
Alpaca Farmer
Posts: 3413
Joined: Tue Jan 18, 2005 5:38 pm
Contact:

Post by Ultimo_Posto » Sat May 27, 2006 10:26 pm

Well the memory browser I used isn't really the focus of what I was asking. I did a virus scan and came up clean.
Image

Post Reply