Skip to content Skip to sidebar Skip to footer

Accessing A Memory-mapped File Using Python

I am looking to take use of a memory mapped file from Guild Wars 2, which is designed to link into Mumble for positional audio. The file contains information on the characters coor

Solution 1:

You can try to map more than 20 bytes from the file in mmap call, say use 1024, unpack the whole thing according to the http://mumble.sourceforge.net/Link and then extract the name and camera position:

s = struct.unpack('IL3f3f3f512s3f')
name = s[11].decode('utf-16')
camera_pos_x,camera_pos_y,camera_pos_z = s[12:15]

Solution 2:

For the names, create a character name in the game and make sure it gets written to disk - perhaps by exiting the game.

Then use a binary file editor to search for the name. I'm partial to http://sourceforge.net/projects/bpe/ , but there are many of these.

Finding camera positions could prove more difficult. I'd probably start out by finding character names, and then search nearby for things that could be camera positions.

Post a Comment for "Accessing A Memory-mapped File Using Python"