Reverse engineering (was:Temporary modding) thread

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
semi
Posts: 4
Joined: Fri Apr 13, 2012 4:43 pm

Re: Temporary modding thread

Post by semi »

thanks :) I've written a little brute forcing script that will try to find a correct suffix for the crystal.hlsl file. Attaching all possible alphanumeric (plus _.) character combinations of up to 5 characters length to both "assets/shaders/Crystal." and "assets/shaders/crystal." did not give a meaningful path matching a hash number. There are some very cryptic "hits", but I assume those are simply hash collisions.

What if removing all data from the grimrock.dat file actually causes another file to silently not be found, which in turn causes grimrock.exe to try to load a file which it normally never would? Maybe it's not there in the first place...
ymgve
Posts: 6
Joined: Thu Apr 12, 2012 7:59 pm

Re: Temporary modding thread

Post by ymgve »

It seems like a bug, but it appears that the shaders must stay inside Grimrock.dat. I managed to get the game running with a minimal Grimrock.dat (file removed) and the rest as loose files.

So far, these files are known: http://pastebin.com/nnKM34iB

It appears the files are mostly sorted alphabetically inside the dat file, so one might be able to guess what the other filenames are. I've made a more detailed list here: http://pastebin.com/U5Bqtq44

edit:
Got the console working! It even works without extracting stuff! Drop this file in your grimrock dir and it should work: file removed

What I've done is changed "developer" in the lua file to "mouseLook" - as long as you have that variable set to true in your config file, it should work. Also, for those with US or other keyboard layouts, you might need to change the character at offset 0x07C1 in Console.lua to a character you are actually able to type on your keyboard.
Last edited by ymgve on Mon Apr 16, 2012 7:35 pm, edited 1 time in total.
Tacticus
Posts: 2
Joined: Sat Apr 14, 2012 5:35 am

Re: Temporary modding thread

Post by Tacticus »

I haven't seen anyone mention this, but the file format you're all pulling elements out of is documented at https://github.com/n2liquid/GRiFS/wiki.
There is C++ code on there to interact with the virtual filesystem they're using. Also looks pretty promising to be able to make new GRARs that will act as overlays over the existing GRAR.
At the moment I'm poking around trying to find the vfs_load type function so I can dump out all of the filenames rather than brute forcing.
Tacticus
Posts: 2
Joined: Sat Apr 14, 2012 5:35 am

Re: Temporary modding thread

Post by Tacticus »

You can easily use Sysinternals (now Microsoft's) Procmon with a filter of "Process Name" grimlock.exe, Operation is CreateFile and Path begins with "C:\Program Files..." (whatever your path is) to see what files your Grimrock tried to open to override files from the GRAR.
The ones I pulled out in a quick run (merged with ymgve's pasted list) is at http://pastebin.com/RjhtwKiZ
spoilspot
Posts: 10
Joined: Sat Apr 14, 2012 2:52 pm

Re: Temporary modding thread

Post by spoilspot »

Crashbanito wrote:I replaced all the snails with spiders in level 1. Went and got something to eat. Started a new game and nearly gave myself a heart attack. :lol:
Yey!
Now, if you could do the opposite, and make an explanation on how to do it, a lot of arachnophobes will be happy :)

(I'm trying to figure out how to remove spiders from level 3 - switching them to, e.g., blobs would be a fine solution).
/L
User avatar
lostprophet
Posts: 37
Joined: Sun Apr 08, 2012 2:23 am

Re: Temporary modding thread

Post by lostprophet »

Sadly the files containing the game's texts can't be modified very well, since they are compiled .lua scripts :( I don't want to start a translation in hex, it would be suicide :D
My Hungarian game translations @ http://lostprophet.weboldala.net
User avatar
Crashbanito
Posts: 326
Joined: Sun Apr 01, 2012 2:50 pm
Location: Louisiana, USA
Contact:

Re: Temporary modding thread

Post by Crashbanito »

lostprophet wrote:Sadly the files containing the game's texts can't be modified very well, since they are compiled .lua scripts :( I don't want to start a translation in hex, it would be suicide :D

Can't you read them with a simple text editor? I'm using sublime text and I was able to read level01.lua just fine.
Grimrock FAQ | If you see something fishy, flag that post! | My Gaming/Tech Blog
Moorkh
Posts: 2
Joined: Wed Apr 11, 2012 9:10 pm

Re: Temporary modding thread

Post by Moorkh »

I would have expected to see character portrait graphics among those files, but I can't see them. Any clues?
User avatar
lostprophet
Posts: 37
Joined: Sun Apr 08, 2012 2:23 am

Re: Temporary modding thread

Post by lostprophet »

Crashbanito wrote:
lostprophet wrote:Sadly the files containing the game's texts can't be modified very well, since they are compiled .lua scripts :( I don't want to start a translation in hex, it would be suicide :D

Can't you read them with a simple text editor? I'm using sublime text and I was able to read level01.lua just fine.
I can only modify them if the translated string is exactly the same length as the original, otherwise I get an error.
My Hungarian game translations @ http://lostprophet.weboldala.net
astonerii
Posts: 1
Joined: Sun Apr 15, 2012 1:02 am

Re: Temporary modding thread

Post by astonerii »

edited
Never mind. I figured out how to the console, thanks to the above poster. Just type in spawn("wooden_box") and it either appears in front of you or where your cursor is pointed. not sure which.

original minus error.log text
can someone post a level01.lua that has several boxes starting out. I do not program, and I tried using the instructions at the beginning to edit the grimrock.dat file to 00 00 00 00, but it gave a bunch of errors and crashed.
Post Reply