Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Memory Editing  (Read 700 times)

phillipk

  • Escaped Lunatic
    • View Profile
Memory Editing
« on: July 17, 2012, 05:45:12 am »

Hey mates!

I just signed in here *g*

Iam currently working on a little program that will do the same like quickfort.
Anyways, my attempts using blitzmax + autoit are a bit unstable.
Now i was wondering, if it possible to write designations directly into ram.

I allready found out, how to set a designation on a block of my choice, but they wont be processed until i made a designation on my own (d -> place cursor on some block -> enter) in the sektor.

Now i think, that there is somthing like a change flag, or any kind of list, that contains the sektor, when a change was made.
But iam unable to find out, where i could finde the address for somthing like this.
I worked for over 3 hours now with Cheatengine and its 'unchanged' / 'changed' search filter, without any usefull result.

I also tried to watch some parts of the memory if changes happen (start of an block-sektor, for example), but it also failed.

Could somebody help me with this? Maybe a littl step-by-step to find the map-data vector itself?
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Memory Editing
« Reply #1 on: July 17, 2012, 06:02:20 am »

Logged

phillipk

  • Escaped Lunatic
    • View Profile
Re: Memory Editing
« Reply #2 on: July 17, 2012, 06:20:11 am »

DFHack can me also help to find out some memory adresses? oO
Well, i didnt knew that. My english is not the best, so i didnt took the time to overview the full content of DFHack.
Ill take a look at it, know :D

I just thought, its a helper to modify the game via Lua and console input. The most commands look like cheating, so i decided, not to use it.
I want my program to run on its own, not depended on another programm :/
Logged

peregarrett

  • Bay Watcher
  • Гномовержец Enjoyed throwing someone recently
    • View Profile
Re: Memory Editing
« Reply #3 on: July 17, 2012, 06:25:27 am »

dfhack has some utilities like digexp, that can help you develop your own plugin
Logged
Did you know that the Russian word for "sock" is "no sock"?
I just saw a guy with two broken legs push a minecart with a corpse in it. Yeah.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Memory Editing
« Reply #4 on: July 17, 2012, 06:37:07 am »

DFHack can me also help to find out some memory adresses? oO
Well, i didnt knew that. My english is not the best, so i didnt took the time to overview the full content of DFHack.
Ill take a look at it, know :D

I just thought, its a helper to modify the game via Lua and console input. The most commands look like cheating, so i decided, not to use it.
I want my program to run on its own, not depended on another programm :/

DFhack is a library for accessing the game's memory, that comes with a number of plugins that use it, such as the aforesaid lua interpreter.  While it is true that many (or most, depending on your point of view) of these are cheats, that is not the purpose of DFhack itself, which is to provide a unified framework to be used to access DF's memory.

While you can make a separate program to access DF's memory directly, it will take longer, due to repeating much of the work, and it will run much slower, because of using OS debugging calls, rather than accessing the memory directly.

I would recommend just writing a DFhack plugin, if for no other reason than the fact that most of the work will already be done for you.
Logged

phillipk

  • Escaped Lunatic
    • View Profile
Re: Memory Editing
« Reply #5 on: July 17, 2012, 07:06:24 am »

Well, i got 2 reaons, why i want to write my own stuff:

1) I want to make a fancy GUI, that greatly improves the speed of using my programm (easy layout, schemes to make saveable user-settings with easy re-using, stuff like this) - so i need a way to  some access to DFHack at runtime (i know lua, so it wouldnt be hard to generate a script at runtime of my programm, instead of parsing the values to ram / using autoit) and give it a lua file for example.

2) I dont want to force anyone, to use a Third party tool, which they generally dont need. I dont know how "Popular" DFHack is, maybe this second point is obsolete.

Ill check out the lua api readme, maybe i can use something like a tmp-lua file & a little tmp-lua-file-reloader-lua-file *g*
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Memory Editing
« Reply #6 on: July 17, 2012, 07:24:51 am »

DFhack is moderately popular. Both of the only two fortress visualizers use it (Stonesense and Overseer), so using it won't alienate /too/ many people.

And you're unlikely to need to touch lua at all, especially if you are writing your own external app. The preferred method would be to have a minimal plugin on the DFHack side that your program communicates with, which would be written in C++
Logged

peregarrett

  • Bay Watcher
  • Гномовержец Enjoyed throwing someone recently
    • View Profile
Re: Memory Editing
« Reply #7 on: July 17, 2012, 07:40:39 am »

Don't forget about needs to update all those vectors any time new version is released. DFhack usually updates in a few days, with help of community.
Logged
Did you know that the Russian word for "sock" is "no sock"?
I just saw a guy with two broken legs push a minecart with a corpse in it. Yeah.