Community
SCI Programming => SCI Development Tools => Topic started by: Aftertaste on December 06, 2014, 05:28:25 PM
-
I was wondering, i am trying to edit SCI32 hep files, i need to know more about the structure of the file, although i can change the values i wish to change, it is a real bad hack job, and if i knew how to manage hep files a bit better, it wouldn't be so cringe-worthy, would anyone have knowledge in this area ?
-
The tools and experience that can be found here are about SCI0, which didn't use HEP files. Its function was simply part of the scripts. There are those that have worked with later versions, but mostly using self made tools for dumping the scripts and heps and to edit them. You might try to track down NewRisingSun, but don't know how willing he'll be to be helpful.
-
Been having a difficult time finding out information on this subject, so i am just going to post the info here, if nothing comes of it, will only be a few minutes wasted.
SV.exe opens this hep file and the contents are
local[$8] =
{
$0, $0, $0, $0, $0, $0, $0, $0
}
instance ExitObj of Code
{
scratch = $0
pModule = $ffff ; -1
pLine = $ffff ; -1
}
instance StartScreen of StaticRealmRoom
{
-script- = $0
-super- = $ffff ; -1
-info- = $ffff ; -1
name = $0
scratch = $0
pModule = $0
pLine = $0
top = $0
left = $0
bottom = $0
right = $0
canTrack = $0
canDrag = $0
state = $0
x = $0
checkPolyKludge = $3 ; z
strIndex = $ffff ; -1
-objID- = $1
-size- = $0
-propDict- = $0
-methDict- = $a0 ; 160, firstTrue
-classScript- = $0
-script- = $1
-super- = $0
-info- = $0
name = $0
scratch = $0
pModule = $0
pLine = $0
script = $0
}
instance connectScript of Script
{
-script- = $0
-super- = $ffff ; -1
-info- = $ffff ; -1
name = $0
scratch = $ffff ; -1
pModule = $0
pLine = $0
client = $0
state = $0
start = $0
timer = $0
cycles = $0
seconds = $0
lastSeconds = $0
ticks = $0
lastTicks = $0
register = $0
script = $0
}
subclass ProgressItem of IconItem
{
init = $0
less = $ffff ; -1
dispose = $ffff ; -1
pSendMovie = $0
handleEvent = $0
restorePanel = $0
z = $0
dispose = $1
BAD SELECTOR = $0
handleError = $0
accept = $0
changeState = $0
pCloseBtn = $0
-objID- = $0
-size- = $0
-propDict- = $80 ; 128, lastKey
-methDict- = $80 ; 128, lastKey
-classScript- = $80 ; 128, lastKey
-script- = $0
-super- = $0
-info- = $ffff ; -1
name = $0
scratch = $0
pModule = $0
pLine = $0
top = $0
left = $0
bottom = $0
right = $0
canTrack = $0
canDrag = $0
state = $0
priority = $2b ; 43, '+', type
plane = $fe ; 254, strIndex
x = $fe ; 254, strIndex
y = $ffff ; -1
z = $0
scaleX = $0
scaleY = $0
maxScale = $0
fixPriority = $0
seenRect = $0
view = $0
loop = $6 ; maxScale
cel = $0
bitmap = $0
scaleSignal = string_069e ; "Waiting..."
magnifier = $1
}
instance progressItem of ProgressItem
{
init = $0
less = $ffff ; -1
dispose = $ffff ; -1
pSendMovie = $0
handleEvent = $0
restorePanel = $0
z = $0
dispose = $1
BAD SELECTOR = $0
handleError = $0
accept = $0
changeState = $0
pCloseBtn = $0
-objID- = $0
-size- = $0
-propDict- = $80 ; 128, lastKey
-methDict- = $80 ; 128, lastKey
-classScript- = $80 ; 128, lastKey
-script- = $0
-super- = $0
-info- = $2337 ; 9015
name = $0
scratch = $0
pModule = $0
pLine = $0
top = $0
left = $0
bottom = $0
right = $0
canTrack = $0
canDrag = $0
state = $0
priority = $2b ; 43, '+', type
plane = $fe ; 254, strIndex
x = $fe ; 254, strIndex
y = $ffff ; -1
z = $0
scaleX = $0
scaleY = $0
maxScale = $0
fixPriority = $0
seenRect = $0
view = $0
loop = $6 ; maxScale
cel = $0
bitmap = $0
scaleSignal = string_069e ; "Waiting..."
magnifier = $1
}
subclass GetPatchScript of Script
{
init = $0
less = $ffff ; -1
dispose = $ffff ; -1
pSendMovie = $0
handleEvent = $ffff ; -1
restorePanel = $0
z = $0
dispose = $0
BAD SELECTOR = $0
handleError = $0
accept = $0
changeState = $0
pCloseBtn = $0
-objID- = $0
-size- = $0
-propDict- = $0
-methDict- = $0
-classScript- = $0
-script- = $0
-super- = $0
-info- = $0
name = $0
scratch = $0
pModule = $0
pLine = $0
top = $0
}
string_01dc = "You have aborted waiting to login. Please try again later."
string_0217 = "I've Had Enough!"
string_0228 = "Okay"
string_022d = "ExitObj"
string_0235 = "Version %d.%d"
string_0243 = "UID.DAT"
string_024b = "|c30||a1|Welcome to The Realm."
string_026a = "205.185.62.90"
string_0278 = "7002"
string_027d = "-Z"
string_0280 = "="
string_0282 = "rs"
string_0285 = "rp"
string_0288 = "ln"
string_028b = "pw"
string_028e = "StartScreen"
string_029a = "RESSCI.000"
string_02a5 = "RESSCI.013"
string_02b0 = "autoLogin"
string_02ba = "start.mid"
string_02c4 = "Connecting to the routing server."
string_02e6 = "updates %d %d"
string_02f4 = "Connecting to the update server."
string_0315 = "getting the route for roommgr\n"
string_0334 = "roommgr "
string_033d = "Connecting to The Realm server."
string_035d = "login"
string_0363 = "password"
string_036c = "Login Name:"
string_0378 = "Password:"
string_0382 = "Verifying name and password."
string_039f = "We are unable to process your connection. Please contact technical support."
string_03eb = "Oops!"
string_03f1 = "Invalid login name or password. Try again."
string_041c = "That login name is currently in use. If you are just trying to re-login after a disconnect, try again in 3 minutes."
string_0490 = "There are too many users connected to the server right now. Try again later."
string_04dd = "Try Again"
string_04e7 = "Quit"
string_04ec = "The account you are trying to use has expired. Please renew your subscription."
string_053b = "Oh No!"
string_0542 = "login.lst"
string_054c = "code = $%x, $%x ($%x)\n"
string_0563 = "wwww"
string_0568 = "Uploading debugging information from last crash."
string_0599 = "fatal.log"
string_05a3 = "NETERR:"
string_05ab = "Error 142"
string_05b5 = "Error 141"
string_05bf = "Error 140"
string_05c9 = "Error 105"
string_05d3 = "Out of Memory:"
string_05e2 = "Out of memory"
string_05f0 = "You are currently waiting in line to play The Realm. Please wait."
string_0632 = "Waiting to Connect"
string_0645 = "Stop Waiting"
string_0652 = "Getting character information."
string_0671 = "Error Establishing Connection."
string_0690 = "connectScript"
string_069e = "Waiting..."
string_06a9 = "%d of %d"
string_06b2 = "ProgressItem"
string_06bf = "progressItem"
string_06cc = "Are you sure you want to cancel patch downloading?"
string_06ff = "Yes"
string_0703 = "No"
string_0706 = "Downloading update %d of %d:"
string_0723 = "Cancel"
string_072a = "patch%02d.rtp"
string_0738 = "You don't have enough disk space to write the update file. Free up some more space and try again."
string_079a = "GetPatchScript"
string_07a9 = ""
string_07aa = " OK "
I want to change
string_026a = "205.185.62.90"
I can do this to an extent, but it is sloppy and causes problems, so was hoping someone would know how to compile the text version back into a hep, and a hep into the text version.
-
I don't believe the Realm is a true SCI game, but just uses SCI type resources, like Betrayal in Antara and Shivers Two. Regardless, I see what you are trying to do, now. I'm not sure that changing the string will do what you want, but it can't hurt to try. It is just a string. The disassembled txt file exported by the Resource Viewer is not anything that will compile, even if you could track down a compiler. Trying to edit the resource in a text editor will only corrupt the file. Did you try to edit the actual dumped resource with just a hex editor?
-
Yes, and i can get it to work in another more recent version of the game, but it's a hack, and looks like this.
string_0224 = "ExitObj"
string_022c = "Version: %d.%03d"
string_023d = "UID.DAT"
string_0245 = "localhost"
string_024f = ""
string_0250 = ""
string_0251 = ""
string_0252 = ""
string_0253 = ""
string_0254 = ""
string_0255 = ""
string_0256 = ""
string_0257 = ""
string_0258 = ""
string_0259 = ""
string_025a = ""
string_025b = ""
string_025c = "7002"
This works for the newer version because the original length of the data is 27, so i can reformat and fit any ip address into it and most hostnames, however, the older version i am playing with only has a total of 15 allotted to contain this same information, so for me to fit a value of 19 in there just causes problems.
I am fairly new to editing files at the byte level, and most i come across contain a 2 byte area before the string data to hold the length of that data, seeing as how this file does not, then i have no clue whats going on :D
I was going to try ida pro later and see if it reads it as asm, but that's is just to keep me busy, i do not think it will help at all.
-
This is the hep file in question, had to rename it with a .txt extension to post it here, the filename should be 40512.hep
Sv,exe reads it.
-
What IP address are you trying to change it to?
-
Any, i am working on an emulator for this game, and would like to be able to change the ip and port at will.
-
Well, what are you trying to change it to?
-
I wrote a bit of a emulator for The Realm Online, i edited the 45012.hep file, and that allows me to redirect the client to the servers i want, however the version i was writing the emulator for is still running live servers, so, i found the very old 1.x code, which honestly is the version those of us who are nostalgic about the game really wants, and it may even be abandon-ware, even if it's not, it wouldn't interfere with live subscribers.
I wrote a launcher that works with the current game, the hep file for 3.x is different, they used hostnames instead of ip's so my program allows any ip address and hostname up to 23 in length, this is what i would like to do with 1.x.
However i run into a few problems, the hep file for 1.x only has a total of 12 byte values allotted for the ip and 4 for the port, to fit any ip in there i need at least 15, so i am unable to do the nasty hack job like i did before.
Also, the nasty hack job was always just a temp fix to allow me to see the network packets sent, i always did mean to figure out how to edit heaps correctly.
I have been working on this for over a year, and i am no closer to figuring it out, not alot of information about the heap file, i am not sure what type it even is.
So honestly, the desired end result, is for me to be able to decompile the heap into the text sv.exe shows, and then make changes, and recompile it back into the heap.
So any information i can find on this file format would be helpful, i am a novice but some of this resembles asm, so is it asm byte code ? and if so, why are portions of it encoded in ascii and others not, i have been all over the net recently, and see your forum name posted all over the SCI stuff, so i figured, if anyone would know what format this file is in, it would be you.
I have plenty of time to work on this issue, but am thoroughly confused by the format of this file, wish i was smarter.
-
Sorry, a more direct answer to your question, being able to change it to a full ip address is what i need.
111.111.111.111 then a 4 digit port is fine.
-
What the Sierra Viewer shows is a disassembly of the resource, not a decompilation resembling anything like the original source. Take a look ASCI from Enrico Rolfi on http://sci.sierrahelp.com/Tools/OtherTools.html
-
Thankyou, i get tons of class errors, but at least is something new to try, so thanks again.
-
This is the client i am working with btw
http://www.sierrahelp.com/Files/Demos/RealmDemo.zip
-
Another thought. If it works just to replace the string, see if TraduSCI works.
http://sciwiki.sierrahelp.com/index.php?title=SCI_Resource_Utilities#TraduSCI
-
Not sure how to get it to open heap files, it errors out, seems it just wants message, although the heap files do resemble message files a bit.
-
TraduSCI's version support is very limited. It might also be that my original thought is correct that like some of the later Dynamix titles it uses SCI type resources, but not the scripting. Anyway, before you give up on it, check the manual, especially http://sciwiki.sierrahelp.com/index.php?title=TraduSCI_Manual#Things_to_do_in_the_beginning
-
Thankyou for all the suggestions, and i won't be giving up, i am mapping network streams atm, and when i get brave enough i jump back to the hep files.
So far i have learned this about all heap files.
header
short -> 145
int32 file-length
OK yeah that isn't a lot, but is more than i knew before :D
-
Good luck.
-
The HEP and SCR files are intertwined so that if you add or remove bytes in the HEP file, you'd have to rewrite the SCR file, changing offsets to things that come after the spot you've changed.
It is so much easier if you can keep things the same length. :)
Have you considered making an Winsock wrapper DLL to do this instead? If all you want to do is change an IP address, that should be easier.
-
Writing a wrapper now, slow going, i can change the IP in the hep and force the client to use my server(s), but it is messy, and for the older version 1.x or 2.x the hostname used is too short to do this hack, so eventually i will need to find out how to at least customize the 45012.hep file.