Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Need help modifying dwarf foreman, native hex readers welcome  (Read 877 times)

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile

im trying to modify the check values for dwarf foreman to work with version 22F, ive managed to bypass the version error and get into the editor but without knowing the addresses it needs to find i cant replace them

the config file takes the format
check= (version check, if its wrong the program finds a new one, pretty easy to fix)
critter_start= (first value of creature array)
dwarfidpos=(first position on dwarf array, dwarves are still included on the creature array)
profession_start=(first slot of the profession array)

i know how to read a hex editor and memory locations i just cant figure out how i can define values that would allow me to find the starting slots of these arrays

ive got cheat engine and HxD editor, searching the dwarfort.exe with HxD in ASCII mode gives me a whole bunch of characters that look like they belong ingame (smiley faces and the like) and i can define nicknames and custom professions and find them, but im still having trouble

help appreciated, just knowing what values i need to find or how to modify memory so i can find where arrays start would be nice
Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #1 on: June 02, 2009, 12:40:35 am »

Try this:
Code: [Select]
check=02401AD7
critter_start=00A7F6F0
dwarfidpos=00A4A1B0
profession_start=043C

It may work; it may not.  In particular, I seem to recall new professions were added in the jump to 3D.
Logged

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #2 on: June 02, 2009, 01:48:40 am »

ran it, got the error log below
 just to reiterate this is dwarf fortress 22 110 22f, so its fairly old

id also like to know how you got the critter start ids and suchlike

also, i tried running foreman with only the new check value, and got THIS debug log(below the first one
Code: [Select]
debug.cpp:  90: Testing vector paranoia, an error after this line is normal
/usr/lib/g: 481: Error at -1, /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/bits/stl_vector.h:481 - __n >= 0 && __n < size()
 debug.cpp:  96: Vector paranoia succeeded
  conf.cpp:  33: Got check=02401AD7critter_start=00A7F6F0dwarfidpos=00A4A1B0profession_start=043C
  conf.cpp:  37: Error at -1, conf.cpp:37 - tok.size() == 2
 debug.cpp:  64: End of stack
    os.cpp: 139: Stacktracing
    os.cpp: 193: Raw stack dump
    os.cpp: 195: 0040da77
    os.cpp: 195: 0042aa1f
    os.cpp: 195: 00405eb0
    os.cpp: 195: 00440380
    os.cpp: 195: 1004d3b9
    os.cpp: 195: 00a2856e
    os.cpp: 195: 00405dc0
    os.cpp: 195: 0042c4d8
    os.cpp: 195: 0040124b
    os.cpp: 195: 004012b8
    os.cpp: 195: 77794911
    os.cpp: 195: 77d3e4b6
    os.cpp: 195: 77d3e489
    os.cpp: 196: Raw stack dump done
    os.cpp: 199:
 debug.cpp: 109: About to crash!

Code: [Select]
debug.cpp:  90: Testing vector paranoia, an error after this line is normal
/usr/lib/g: 481: Error at -1, /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/bits/stl_vector.h:481 - __n >= 0 && __n < size()
 debug.cpp:  96: Vector paranoia succeeded
  conf.cpp:  33: Got check=02401AD7
  conf.cpp:  40: Parsed check as 37755607
  conf.cpp:  33: Got critter_start=0141DA30
  conf.cpp:  40: Parsed critter_start as 21092912
  conf.cpp:  33: Got dwarfidpos=0123EAC8
  conf.cpp:  40: Parsed dwarfidpos as 19131080
  conf.cpp:  33: Got profession_start=45c
  conf.cpp:  40: Parsed profession_start as 1116
    db.cpp: 224: Miner: Mining
    db.cpp: 224: Mason: Masonry
    db.cpp: 224: Mason: Stone Detailing
    db.cpp: 224: Mason: Architecture
    db.cpp: 224: Carpenter: Wood Cutting
    db.cpp: 224: Carpenter: Carpentry
    db.cpp: 224: Carpenter: Bowyer
    db.cpp: 224: Carpenter: Wood Burning
    db.cpp: 224: Carpenter: Pump Operating
    db.cpp: 224: Carpenter: Potash making
    db.cpp: 224: Carpenter: Lye making
    db.cpp: 224: Carpenter: Siege Engineering
    db.cpp: 224: Metalsmith: Weaponsmithing
    db.cpp: 224: Metalsmith: Furnace Operating
    db.cpp: 224: Metalsmith: Armorsmithing
    db.cpp: 224: Metalsmith: Furnituresmithing
    db.cpp: 224: Metalsmith: Metalcrafting
    db.cpp: 224: Trapper: Trapping
    db.cpp: 224: Trapper: Hunting
    db.cpp: 224: Trapper: Animal Training
    db.cpp: 224: Trapper: Animal Care
    db.cpp: 224: Trapper: Vermin Dissection
    db.cpp: 224: Jeweler: Gemcutting
    db.cpp: 224: Jeweler: Gem encrusting
    db.cpp: 224: Craftsdwarf: Weaving
    db.cpp: 224: Craftsdwarf: Clothes Making
    db.cpp: 224: Craftsdwarf: Leatherworking
    db.cpp: 224: Craftsdwarf: Woodcrafting
    db.cpp: 224: Craftsdwarf: Stonecrafting
    db.cpp: 224: Craftsdwarf: Bonecarving
    db.cpp: 224: Craftsdwarf: Glassmaking
    db.cpp: 224: Craftsdwarf: Dyeing
    db.cpp: 224: Craftsdwarf: Tanning
    db.cpp: 224: Craftsdwarf: Alchemy
    db.cpp: 224: Craftsdwarf: Soapmaking
    db.cpp: 224: Farmer: Farming
    db.cpp: 224: Farmer: Cooking
    db.cpp: 224: Farmer: Brewing
    db.cpp: 224: Farmer: Butchery
    db.cpp: 224: Farmer: Milling
    db.cpp: 224: Farmer: Plant Gathering
    db.cpp: 224: Farmer: Farming Workshop
    db.cpp: 224: Farmer: Cheesemaking
    db.cpp: 224: Farmer: Milking
    db.cpp: 224: Fisherdwarf: Fishing
    db.cpp: 224: Fisherdwarf: Fish Cleaning
    db.cpp: 224: Fisherdwarf: Fish Dissection
    db.cpp: 224: Mechanic: Mechanics
    db.cpp: 224: Peasant: Stone Hauling
    db.cpp: 224: Peasant: Wood Hauling
    db.cpp: 224: Peasant: Item Hauling
    db.cpp: 224: Peasant: Food Hauling
    db.cpp: 224: Peasant: Refuse Hauling
    db.cpp: 224: Peasant: Furniture Hauling
    db.cpp: 224: Peasant: Animal Hauling
    db.cpp: 224: Peasant: Cleaning
    db.cpp: 224: Peasant: Burial
    db.cpp: 224: Peasant: Health Care
    db.cpp: 224: Peasant: Siege Operating
    db.cpp: 224: Adamantine: Strand extracting
 poker.cpp: 468: 000010f8
 poker.cpp: 470: 00000140
 poker.cpp: 473: Found process is C:\Users\Christopher Baxter\Documents\df_22_110_22f\dwarfort.exe
 poker.cpp: 375: Switching 4344 1
 poker.cpp: 408: Done switching
 poker.cpp: 265: SE is 00000000 00000000, 0 items
 poker.cpp: 375: Switching 4344 0
 poker.cpp: 408: Done switching
 poker.cpp: 468: 000010f8
 poker.cpp: 470: 00000140
 poker.cpp: 473: Found process is C:\Users\Christopher Baxter\Documents\df_22_110_22f\dwarfort.exe
 poker.cpp: 375: Switching 4344 1
 poker.cpp: 408: Done switching
 poker.cpp: 265: SE is 00000000 00000000, 0 items
 poker.cpp: 375: Switching 4344 0
 poker.cpp: 408: Done switching
« Last Edit: June 02, 2009, 01:51:49 am by LordBaxter »
Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #3 on: June 02, 2009, 12:09:56 pm »

ran it, got the error log below
It's not gonna work then.  Sorry, guy.  I think source code is available for Foreman.  However I'm not offering to make it work.

Quote
id also like to know how you got the critter start ids and suchlike
Basically by matching up parts of two disassemblies, .40c which I have done a fair amount of looking at and knew the offsets in question, and .22f which I had not looked at before.
Logged

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #4 on: June 02, 2009, 07:17:30 pm »

thanks for the help anyway

im sort of tempted to ask one of my lecturers whether he wants to have a crack at this, or maybe one of the student mentors at uni...

failing that i could email the original creator of dwarf foreman and ask for the source code, or decompile it myself

i WOULD try and make my own tool bar the fact that the only language i know anything about is java, and what little assembly code i know is for the motorola 68K processor :P
Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #5 on: June 02, 2009, 11:37:14 pm »

I looked at that first error dump and it looked like you got the config file wrong.

Quote
Code: [Select]
  conf.cpp:  33: Got check=02401AD7critter_start=00A7F6F0dwarfidpos=00A4A1B0profession_start=043C

This indicates to me that when you make the config file, you didn't put line endings in it.

OR, more likely, that you used a text editor that put in Macintosh-style line endings instead of Unix or MS-DOS style.

Foreman will accept Unix (0D) or MS-DOS (0D,0A); it will not accept Macintosh (0A).
Logged

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #6 on: June 03, 2009, 02:40:55 am »

i jsut copied the text into the config file with notepad, and then again by typing it out,
Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #7 on: June 04, 2009, 12:40:12 am »

With the same results in the debug file?  (Delete the debug file each time you test-run foreman.)

What version do you have?  I have version 0.3.8b.
Logged

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile
Re: Need help modifying dwarf foreman, native hex readers welcome
« Reply #8 on: June 04, 2009, 03:44:20 am »

i was using ver 22f, but i think i might try a different old version

its mainly the more complex world generation and z-axis that make the new versions of the game kind of less fun to play, i know theres an extensive list of working foreman configurations for other versions so im gonna give those ones a try, that and they also have numerous bugfixes and other handy changes, ill hunt down a changelog first so i can find a ver that has the right balance of simplicity and complexity, so probably version 23a or 32a,

thanks for the help though, it was fun trying to work things out
« Last Edit: June 04, 2009, 03:53:21 am by LordBaxter »
Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!