Reverse engineering (was:Temporary modding) thread

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!

Re: Temporary modding thread

Postby semi » Sat Apr 14, 2012 1:53 am

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...
semi
 
Posts: 4
Joined: Fri Apr 13, 2012 4:43 pm

Re: Temporary modding thread

Postby ymgve » Sat Apr 14, 2012 3:40 am

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.
ymgve
 
Posts: 6
Joined: Thu Apr 12, 2012 7:59 pm

Re: Temporary modding thread

Postby Tacticus » Sat Apr 14, 2012 6:29 am

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

Postby Tacticus » Sat Apr 14, 2012 7:39 am

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
Tacticus
 
Posts: 2
Joined: Sat Apr 14, 2012 5:35 am

Re: Temporary modding thread

Postby spoilspot » Sat Apr 14, 2012 2:58 pm

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
spoilspot
 
Posts: 10
Joined: Sat Apr 14, 2012 2:52 pm

Re: Temporary modding thread

Postby lostprophet » Sat Apr 14, 2012 3:54 pm

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
lostprophet
 
Posts: 36
Joined: Sun Apr 08, 2012 2:23 am

Re: Temporary modding thread

Postby Crashbanito » Sat Apr 14, 2012 3:57 pm

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
User avatar
Crashbanito
 
Posts: 326
Joined: Sun Apr 01, 2012 2:50 pm
Location: Louisiana, USA

Re: Temporary modding thread

Postby Moorkh » Sat Apr 14, 2012 4:23 pm

I would have expected to see character portrait graphics among those files, but I can't see them. Any clues?
Moorkh
 
Posts: 2
Joined: Wed Apr 11, 2012 9:10 pm

Re: Temporary modding thread

Postby lostprophet » Sat Apr 14, 2012 4:28 pm

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
User avatar
lostprophet
 
Posts: 36
Joined: Sun Apr 08, 2012 2:23 am

Re: Temporary modding thread

Postby astonerii » Sun Apr 15, 2012 1:08 am

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.
astonerii
 
Posts: 1
Joined: Sun Apr 15, 2012 1:02 am

PreviousNext

Return to Modding

Who is online

Users browsing this forum: No registered users and 12 guests