Author Topic: how to reassemble a disassembled script?  (Read 6276 times)

0 Members and 1 Guest are viewing this topic.

Offline richruss691

how to reassemble a disassembled script?
« 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?



Offline MusicallyInspired

Re: how to reassemble a disassembled script?
« Reply #1 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.
Brass Lantern Prop Competition

Offline richruss691

Re: how to reassemble a disassembled script?
« Reply #2 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.

Offline Kawa

Re: how to reassemble a disassembled script?
« Reply #3 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.

Offline MusicallyInspired

Re: how to reassemble a disassembled script?
« Reply #4 on: May 20, 2018, 12:43:38 AM »
Which game are you trying to edit? Whoch SCI interpreter?
Brass Lantern Prop Competition

Offline richruss691

Re: how to reassemble a disassembled script?
« Reply #5 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.

Offline Kawa

Re: how to reassemble a disassembled script?
« Reply #6 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.
« Last Edit: May 20, 2018, 09:07:03 AM by Kawa »

Offline MusicallyInspired

Re: how to reassemble a disassembled script?
« Reply #7 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.
« Last Edit: May 20, 2018, 09:17:09 AM by MusicallyInspired »
Brass Lantern Prop Competition

Offline richruss691

Re: how to reassemble a disassembled script?
« Reply #8 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.
« Last Edit: May 21, 2018, 11:18:07 PM by richruss691 »

Offline richruss691

Re: how to reassemble a disassembled script?
« Reply #9 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.
« Last Edit: May 20, 2018, 01:51:46 PM by richruss691 »


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.043 seconds with 22 queries.