Community

SCI Programming => SCI Development Tools => Topic started by: richruss691 on May 17, 2018, 10:28:55 PM

Title: how to reassemble a disassembled script?
Post by: richruss691 on May 17, 2018, 10:28:55 PM
How does one reassemble a script that has been disassembled using sci companion 3, after modifying it?
Title: Re: how to reassemble a disassembled script?
Post by: MusicallyInspired on May 18, 2018, 10:53:40 PM
Assuming you're not confusing disassembly with decompilation, it's more ideal to decompile scripts, make changes and/or additions with SCI Companion's Script editor, and recompile. There really is no reassembly unless someone else knows something I don't.
Title: Re: how to reassemble a disassembled script?
Post by: richruss691 on May 19, 2018, 10:14:39 AM
thank you for the reply. i did indeed mean disassemble not decompile. i tried decompile recompile too but i couldn't get it to recompile. i just wanted to do something simple, move a prop to a different position on screen. i was hoping there would be an easy way.
Title: Re: how to reassemble a disassembled script?
Post by: Kawa on May 19, 2018, 08:16:42 PM
For that sort of thing I like to use SV to figure out the location of the value to change and then use a hex editor on the raw resource exported earlier. Top of my head I'd think instance properties are on the heap and as such part of the HEP resource matching the script/room it's used in, for the SCI versions that use separate HEPs.

Either way, it gets trickier when the coordinate is set in a script (posn message or such) in which case I like to decompile the script to guide me in reading SV's disassembly, and then find the offsets to edit as above.
Title: Re: how to reassemble a disassembled script?
Post by: MusicallyInspired on May 20, 2018, 12:43:38 AM
Which game are you trying to edit? Whoch SCI interpreter?
Title: Re: how to reassemble a disassembled script?
Post by: richruss691 on May 20, 2018, 01:19:19 AM
quest for glory 1 vga. i don't know which interpreter version it is, how can i find out? i didn't like what they did with the eye on the magic shop so i decided to change but now i need to move the animated pupil.
Title: Re: how to reassemble a disassembled script?
Post by: Kawa on May 20, 2018, 08:54:47 AM
SCI 1.1, then. With the separate heap resources.

Room 310, theEye. View 310, loop 3. X 259, Y 47. Constantly checks Ego's X position to determine where to look. Given those properties, I can extract 310.HEP and check in a hex editor. 259 and 47 should be pretty unique. I find one instance of 259 ($103) in the HEP file, at offset $17E. The very next 16-bit value is $2F, which is our Y value.

Edit: mind you, those values are probably shown as 03 01 and 2F 00, cos we Intel.
Title: Re: how to reassemble a disassembled script?
Post by: MusicallyInspired on May 20, 2018, 09:11:20 AM
If it's SCI1.1 is what Companion is meant to work with. Did you decompile all the scripts or just the one? You must decompile them all because names of global variables and procedures can change. Select all scripts in the decompilation dialogue before executing the process. It will decompile multiple times as it discovers new variable names.
Title: Re: how to reassemble a disassembled script?
Post by: richruss691 on May 20, 2018, 10:08:00 AM
Kawa, thank you, that should be very helpful. I'd done all that stuff but couldn't find the numbers in my hex editor because i didn't realize the values would be reversed. i'm very inexperienced with this sort of thing.

MusicallyInspired, I decompiled all the scripts then tried to compile just script 310 but it complains about global12 not being intialized. it won't even compile script 000.  any help you can give would be greatly appreciated. i have some other, more complicated changes i'd like to attempt, if i can get the thing to compile.

update: i did finally get it to decompile well enough to recompile.
Title: Re: how to reassemble a disassembled script?
Post by: richruss691 on May 20, 2018, 11:01:37 AM
Kawa, i found the location in the heap and changed it as i desired, but noting seems to have changed in the game. did i miss something?

Update: it, in fact, worked perfectly. i didn't realize because i'd saved on the screen i was trying to change and it didn't change until o moved off the screen and returned. again, thank you for your help.
i've also found another way to do the same thing but possibly a little easier. there is an option in the toolbox frame to apply an offset to a loop cel positioning. so its possible to change the position of a prop by adjusting the offset directly from sci companion.