Sue's Workshop - New version in Development!

Dec 13, 2011 at 9:45 PM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
OriginalSinner said:
I have a request.

Sue's Workshop will expand the exe under certain circumstances. This is HORRIBLY broken and needs to be FIXED! :/ First, SW detects this by checking the exe's header. If a fifth block exists, it assumes it to be the one it creates to expand into. Even if the block's name doesn't match the one it creates (".swdata"). Second, SW scraps the end of the exe COMPLETELY and overwrites it with its own data. Totally ignoring any kind of info it writes in the block's header such as size.

It'd be great if this part could be coded properly... The issue isn't so much that there's a bug or something like that as it is this part being done VERY sloppily. Reading the PE header and looking for one called ".swdata" rather than counting them, and using it to get the size of the block and overwriting said block rather than indiscriminately scrapping everything (including additional user-created blocks) would fix this.

In my current project, several entities are coded from scratch. This often means I have way too much extra code to pack into the space made available by the entities already in the game. So I've expanded the exe to include a 64k block of free space at the end. Sue's Workshop rapes this block and stupidly assumes the block belongs to it (no check made to see if it's called ".swdata"). I can create my block after SW's block and it leaves it alone, but it still ends up scrapping the end of the exe (including all my data) because it doesn't even bother to use the information written in the block it creates itself. Very frustrating - I have to make a lot of my changes manually while working on a throwaway copy...

Nice work so far. Lookin' forward to a demo of some kind! :pignon2:

Edit: Alternatively, if the project is no longer being worked on, can you make the source code available so someone who can work on it can correct this? It'd be really helpful. :D

Sue's workshop will also corrupt your executable if you have any custom resources (ex. changing the org files).

SP is working on a completely different version (that will be released eventually), but until then maybe you should try the newest version of CaveEditor? (available on the CE thread, not on the tribute site).
 
Dec 13, 2011 at 9:58 PM
Junior Member
"Fresh from the Bakery"
Join Date: Dec 13, 2011
Location:
Posts: 10
GIRakaCHEEZER said:
SP is working on a completely different version (that will be released eventually), but until then maybe you should try the newest version of CaveEditor? (available on the CE thread, not on the tribute site).

CaveEditor simply... uh... dies (even the latest version in that thread). It's clearly not written to handle expansions to the EXE at all. Sue's is, but it does it wrong in almost every way. :/

I don't believe the new Sue's is going to be released - it's been in dev for too long (sorry, but it's a cold hard fact at this point - 2 and a half years? :/ Unless I missed a release at some point; I'll admit I didn't read the entire thread; heck I remember SP talking about writing an editor almost 5 years ago, but...), which is why I was asking if the source has been made available.

Sigh... Guess I can just hack around in the current version of Sue's and remove the check myself. Thanks anyway though, I appreciate the prompt reply and the CE suggestion (it's always good to have other tools at one's disposal...).
 
Dec 13, 2011 at 10:02 PM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
OriginalSinner said:
CaveEditor simply... uh... dies (even the latest version in that thread). It's clearly not written to handle expansions to the EXE at all. Sue's is, but it does it wrong in almost every way. :/

I don't believe the new Sue's is going to be released - it's been in dev for too long (sorry, but it's a cold hard fact at this point - 2 and a half years? :/ Unless I missed a release at some point; I'll admit I didn't read the entire thread; heck I remember SP talking about writing an editor almost 5 years ago, but...), which is why I was asking if the source has been made available.

Sigh... Guess I can just hack around in the current version of Sue's and remove the check myself. Thanks anyway though, I appreciate the prompt reply and the CE suggestion (it's always good to have other tools at one's disposal...).

Well I believe noxid has the source code for CaveEditor, so maybe you could ask him for it? Would that work?
 
Dec 13, 2011 at 10:20 PM
Been here way too long...
Discord Group Admin
Org Discord Moderator
"Life begins and ends with Nu."
Join Date: Oct 18, 2011
Location:
Posts: 2337
GIRakaCHEEZER said:
Well I believe noxid has the source code for CaveEditor, so maybe you could ask him for it? Would that work?
CE is open-source and the source code is on the tribute site.
GIRakaCHEEZER said:
\try the newest version of CaveEditor? (available on the CE thread, not on the tribute site).
No, he should use v.0.99d, not 0.99c, because 0.99c will break your NPC.tbl.
 
Dec 13, 2011 at 10:24 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
.99d is available in the ce thread, dunc.
 
Dec 13, 2011 at 10:30 PM
Junior Member
"Fresh from the Bakery"
Join Date: Dec 13, 2011
Location:
Posts: 10
A few moments of debugging reveals that 004046F8 is the offset that writes Sue's workshop's expansion block. I can take it from there. :balrog:

Well, I guess I'll keep an eye out for if ever the source code to Sue's Workshop is ever made available... Thanks for your time!

*Returns to the land of code and assembly.*

For those interested, just xor eax,eax and jump to 00404B46 at the start of 004046F8 and Sue's will skip this part entirely. Fix'd, unless you add/remove maps (which WOULD require writing the block.) Currently, SW checks the exe's size to create a buffer into which the exe is then loaded. If the data's size is larger than the exe's size or if more than 95 maps exist, it writes the block. The bug could be fixed by creating a second buffer into which the extra data is loaded, writing it to the exe, and writing the REST of the buffer containing the original exe afterwards instead of overwriting blindly, fixing a terribly annoying bug with little effort. :muscledoc:
 
Dec 14, 2011 at 2:59 AM
Been here way too long...
Discord Group Admin
Org Discord Moderator
"Life begins and ends with Nu."
Join Date: Oct 18, 2011
Location:
Posts: 2337
OriginalSinner said:
A few moments of debugging reveals that 004046F8 is the offset that writes Sue's workshop's expansion block. I can take it from there. :)

Well, I guess I'll keep an eye out for if ever the source code to Sue's Workshop is ever made available... Thanks for your time!

*Returns to the land of code and assembly.*

For those interested, just xor eax,eax and jump to 00404B46 at the start of 004046F8 and Sue's will skip this part entirely. Fix'd, unless you add/remove maps (which WOULD require writing the block.) Currently, SW checks the exe's size to create a buffer into which the exe is then loaded. If the data's size is larger than the exe's size or if more than 95 maps exist, it writes the block. The bug could be fixed by creating a second buffer into which the extra data is loaded, writing it to the exe, and writing the REST of the buffer containing the original exe afterwards instead of overwriting blindly, fixing a terribly annoying bug with little effort. ;)
Please, never leave these forums.
And you know, you sound like someone who could code their own CS editor.
 
Dec 14, 2011 at 3:08 AM
Junior Member
"Fresh from the Bakery"
Join Date: Dec 13, 2011
Location:
Posts: 10
Dunc2403 said:
Please, never leave these forums.
And you know, you sound like someone who could code their own CS editor.

Um... This is RuneLancer. I've only registered to inquire about Sue's Workshop in the context of a hack I'm working on (http://forum.gensokyo.org/index.php?topic=1471.0) - I'm not really sticking around. Sorry... ;)

Happy hacking!
 
Dec 14, 2011 at 4:36 AM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2857
Age: 34
Pronouns: he/him
OriginalSinner said:
Um... This is RuneLancer. I've only registered to inquire about Sue's Workshop in the context of a hack I'm working on (http://forum.gensokyo.org/index.php?topic=1471.0) - I'm not really sticking around. Sorry...
Well bugger me I thought there was something fishy about that name and posting style :) You know your old account is still active right?

SP took a break for a while but is now actively working on SW again and is I think not too far off having a new version completed (as you can see on page 22-ish). It's rather amazing how far CS hacking has come since you left... much like the whole site in general ;)

This is great. I hope more old members keep popping up, even if it's only for a day at a time.
 
Dec 14, 2011 at 12:14 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Completely offtopic:
Did Endless Saga ever get finished?
 
Dec 14, 2011 at 2:13 PM
Junior Member
"Fresh from the Bakery"
Join Date: Dec 13, 2011
Location:
Posts: 10
Quick amendment to my earlier post.

004047C7 C6 41 01 00 mov byte ptr [ecx+01],00

This is the modification to make. My earlier modification deactivates writing to the exe but requires making changes to map headers manually. This one deactivates the check for an expanded exe (but will still wreck the hell out of your exe if you need to add maps - you're on your own there!). Fixes pretty much everything.

(Mind you, Sue's is UPX-packed. You'll have to take care of that before making any alterations to the exe itself. That, or use a debugger and make the change at run-time whenever you need to use Sue's on an exe you've expanded yourself.)

Just thought I'd bring this fix full-circle before taking my leave. ;)
 
Dec 19, 2011 at 1:15 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 33
Pronouns: he/him
The problem is that I have to write the source entirely from scratch, since Prof. Eich didn't give me his source code and I'm rewriting it completly using Visual Basic .NET, which is very simular to Visual C# in terms of speed, coding style, execution etc. The original SW was coded with Borland C++.
My problem is that I have no idea about PE standards at the moment so it's pretty hard to code the "adding maps" part. It's hard to find the information I need in the internet and the stuff I could find wasn't very easy to understand. If someone can provide me the necessary information, it would speed up the development process really much.

Also, I have been working on graphic stuff and it's a pain in the arse - pretty frustrating. But that's only one reason why the development slowed down a bit, I have to work on other projects too and I still go to school, so I don't have too much free time to offer for SW.
Anyway, I posted some while ago that SW will work with projects rather than loading editing exe files directly, so you don't have to worry about these map header bugs anymore.

Also, hi Runelancer o;
 
Dec 19, 2011 at 10:29 PM
Senior Member
"Huzzah!"
Join Date: Dec 7, 2011
Location: Australia. In Bob Katter's secret techno-dungeon.
Posts: 206
Age: 33
Pronouns: he/him
It's bizzare how Sue's Workshop 0.3A has a readme that practically screams 'I'm going to destroy your mod', then turns out to be rock solid, and largely bug free. Cave Editor, on the other hand, is absolutely hideous, but pretends to be polished. One of life's great mysteries...
 
Back
Top