Jump to content

Compiling Windows BoE Editor


Recommended Posts

Anyone know what Ormus used to compile the BoE Editor, or anyone else compile it themselves and can point me in the right direction? I tried compiling it with DevCPP, but didn't get anywhere.

 

Or if anyone already has a copy of the windows editor with password checking removed, that would be great too.

Link to post
Share on other sites
  • 3 weeks later...

Hey, Lazarus, sorry I haven't been keeping an eye on these topics. I have a windows editor that kinda has password checking removed. You can enter past the password screen without putting in a password and 'view' the scenario but it won't save an edited version. Is this good enough for what you need, or no?

Link to post
Share on other sites

*bump*

 

The editor has been uploaded to my website on the downloads page .

 

I actually found two but I've only used the one. wtfed.exe is what you want. I got it with an entire BLSCNED folder and all it's contents so I'm not sure if there's any altered supporting files that are supposed to be with it. Let me know if it doesn't work for you, I can forward the whole thing.

Link to post
Share on other sites

The two programs mentioned by Jewelz are both Windows 95 vintage.

 

WTFED, this program is a Windows Blades of Exile Scenario Editor that allows you to view the password protected scenarios. No need for knowledge of the password. However to actually save your changes you will still need to know the password.

 

SuprEdit, seems to be just a conventional Windows BoE Scenario Editor. I can’t see any major differences or improvements.

 

Both of these editors are incompatible with the new BoE package by Ormus. The latter has a different file path for the standard graphics used. So you will need to copy the entire BlScenEd folder into the BoE Package before you can use either editor with the Package.

 

In the MS-Dos Edit command, when Line Width = 70

Line 5,629 Column 62, start of the text on the main screen. Here you can alter the name of the program as it appears on the main screen. This is how you can tell one program from another.

 

(Title bar: ?!??!! Now what is going on here?! Normally this is no problem for me. For whatever reason I can’t alter the text on the title bar.)

Link to post
Share on other sites
  • 3 weeks later...

Another approach to passwords is possible now that we have access to the source code. Have someone who knows C read the source and figure out how the program handles the passwords.

 

I think they are recorded in the exs file by the means of "scenario flags", there are nine of them.

They are found at the following locations, when the file has a line width of 70 characters:

Short flag a: 6, 69 - 70

Short flag b: 7, 13 - 14

Short flag c: 36, 45 - 46

Short flag d: 595, 55-56.

Short flag e: 42, 57 - 58

Short flag f: 45, 53 - 54

Short flag g: 449, 23-24.

Short flag h: 509,1-2

Short flag i: 600, 7-8.

 

(Notation format is :

Short flag @: line number, column number-column number.)

 

Here is one example from line 1,319 of the Spiderweb source file tfileio.cpp:

Code:
 short town_s(short flag){	long k = 0;			k = (long) flag;	k = k * k * k;	jl = jl * 54;	jl = jl * 2 + 1234 + k;	k = k + 51;	k = k % 3000;	jl = jl * 2 + 1234 + k;	k = k * scenario.num_towns;	k = k % 10000;	jl = jl * jl + 84 + k;	k = k + 10000;		return (short) k;} 
Link to post
Share on other sites

Why do we need passwords removed anyway?

 

If the scenario has an error there are only two solutions:

  • Use the Debug function
  • Edit the scenario file itself

Both require the use and knowledge of the password.

Hex editing is possible, but it takes more effort.

Link to post
Share on other sites

You kinda just answered your own question there...

 

Personally, I would want passwords removed so I could go in and fix buggy scenarios that I liked. Kistar's Quest for example. I liked it but the bugs kept others away.

 

If I remember right, though... somebody already figured out how to remove passwords on MAC. I thought it was with the wtfedit. Someone refresh my memory please. Who helped me fix Parallel Dimensia and how did they do it?

Link to post
Share on other sites

I just tried to alter the password with the wtfed editor and I got nowhere.

 

Hex editing requires a decryption of the exs file, which I have done using the source code for the editor. I can clean up my notes and you can post them on your site if you like.

 

It is less convenient than just editing but there you go.

Link to post
Share on other sites

As for Lazarus's original post about getting nowhere compiling with Dev-C++, that is the story of my life. I have been unable to compile anything from Spiderweb on the Dev-C++. Perhaps he can email Ormus and ask directly?

 

My notes will have to be made comprehensible to other people. They are based upon the official Spiderweb source code. I will also have to check that they match what you see in the exs file itself. I will include provision for hexadecimal addresses, programs like Hexplorer & are very useful.

 

Edit:

I have uploaded some notes that will enable decryption of an exs file:

http://www.freewebs.com/ishadnha/EXSDecrypts.zip

(Note these are Windows notes. The Mac version has no "unsigned char town_hidden[200],a;", instead it just has "unsigned char town_hidden[200];". I will have to compare the Mac and Windows source code later on.)

 

Edit:

I had to manually copy the address above and then enter it into the location bar before the link worked?!?

Link to post
Share on other sites

If anyone can contact Ormus, as he knows programming, ask him how the password works.

 

Update to the EXS Decrypt file posted above:

36,47 thru 42,26: “Short out_data_size[100][2]”

First column is always just the size of “outdoor_record_type”: 4,146 bytes.

Second column seems to be the sum of the size of all signs and text messages.

 

42,59 thru 44,18: Special Items [50]

A value of 1 means that the Special Item can be used, while a value of 10 means that the party starts the scenario with the item. A value of 11 means that it can be used and the party starts with it.

 

Edit, further update:

44,19 thru 45,48: Special Items Specials [50]

What scenario special is called when the item is used.

Link to post
Share on other sites

If anyone wants to send him an email, these are the details from the profile of Ormus:

Member Status: Apprentice

Member Number: 8738

Registered: May 16, 2007

Posts: 14

Email Address: gkvl@tlen.pl

Location: Poland, Warsaw

Occupation: Student

Homepage: http://info.wsisiz.edu.pl/~kowalsg0/

Birth Date: January 09, 1985

Real Name: Grzegorz Kowalski

Favorite Spiderweb Game: Exile II

Link to post
Share on other sites
  • 3 weeks later...
Quote:
Originally written by Ishad Nha:
If anyone can contact Ormus, as he knows programming, ask him how the password works.
Uhm, I don't know how they work but I will try to if I find some time.

Quote:
Originally written by Celtic Minstrel :
If anyone does email Ormus, tell him to check his private messages.
Just checked! :-)
Link to post
Share on other sites

Problems compiling the source code

 

The home page of Ormus gives the following advice:

Compilation using Dev-CPP IDE

1. Create an empty project

2. In the project options set type of application to Win32 GUI

3. Add "-lwinmm" to linker command line options

4. Add all *.cpp, *.h, *.rc files to the project

5. Compile all

 

This leads to the following messages:

c:\dev-c++\new folder\keydlgs.cpp: In function `void edit_scen_intro_event_filter(short int)':

c:\dev-c++\new folder\keydlgs.cpp:1262: warning: comparison is always false due to limited range of data type

c:\dev-c++\new folder\scenario.cpp: In function `void edit_monst_type_event_filter(short int)':

c:\dev-c++\new folder\scenario.cpp:1271: warning: comparison is always true due to limited range of data type

c:\dev-c++\new folder\scenario.cpp: In function `void edit_monst_abil_event_filter(short int)':

c:\dev-c++\new folder\scenario.cpp:1442: warning: assignment of negative value `-1' to `unsigned char'

g++: c:\dev-c++\new folder\gamedlog.rc: linker input file unused since linking not done

g++: c:\dev-c++\new folder\blades_of_exile_scenario_editor_private.rc: linker input file unused since linking not done

g++: c:\dev-c++\new folder\blscened.rc: linker input file unused since linking not done

g++: c:\dev-c++\new folder\strings.rc: linker input file unused since linking not done

 

I understand point 3 of Ormus's advice to mean:

Further object files or linker options

(separate filenames by spaces):

-lwinmm

Resource files (separate filenames by a semicolon “;”):

rsrc.rc

 

viewThumb.jsp?fileID=34699170&size=thumb

Link to post
Share on other sites
  • 2 weeks later...

April 18 discussion about passwords: a search of The Lyceum turned up the password for Alcritas's scenarios:

"If for some strange reason you'd like to examine any of my old old scenarios, you'll find that the password to all my scenarios is 2652x, where "x" is equal to the sequence of my scenarios. So, for example, Of Good And Evil's password is 26523. I think."

 

"Old News that no one cares about anymore", was the relevant topic.

Link to post
Share on other sites

Compiled list of known passwords:

 

All scenarios by "Drizzt" – 071576. Password found on home page.

"Rubacus", by Leon Lin: 28134.

"Islands of the Wheel": 23457 (best hand in deuce-to-seven lowball)

"Tatterdemalion": akqj10 (as a royal flush, best hand in most forms of poker)

“War on Bigail”: bob

 

 

Scenarios by Alcritas:

 

An Apology: 26527

Falling Stars 26529

Heirs to Theseus 26525

Kalloskagathos 26522

Lamentations 26528

Of Good And Evil: 26523

On A Ship To Algiers 26521

Redemption 26526

Signs and Portents 26521

The Staff of Kayolith 26524

Tomorrow 26522

 

Link to post
Share on other sites
Originally Posted By: Ishad Nha

I understand point 3 of Ormus's advice to mean:
Further object files or linker options
(separate filenames by spaces):
-lwinmm


I meant this:
http://info.wsisiz.edu.pl/~kowalsg0/project_options.png

Could you be more specific what are your problems with compiling the source code? In your post g++ only reported some warnings and information that linking is not done.
Link to post
Share on other sites

 

I may not know the source of my problems because I know precious little about programming.

 

The image below is available if you enter the address manually into your address bar, by copy and paste. (Why won't it link directly? I don't know.)

Project%20Options.bmp

Link to post
Share on other sites

Back to passwords: I have found that there seems to be a pattern to flag b, one of the six flags that you need to calculate to get around the password. If you set the password to 0 and if you then increase the number of towns in the scenario by one: the flag increases by 51.

 

The formula seems to be: flag b = (51*T) + 10,000, where T is the number of towns in the scenario.

 

Lost password solutions:

set flag to zero by calculating the six correct flags

discover password from the formulas

figure out what the formula in the source code means

 

The formula for flag b is given in the source code:

short town_s(short flag)

{

long k = 0;

 

k = (long) flag;

k = k * k * k;

jl = jl * 54;

jl = jl * 2 + 1234 + k;

k = k + 51;

k = k % 3000;

jl = jl * 2 + 1234 + k;

k = k * scenario.num_towns;

k = k % 10000;

jl = jl * jl + 84 + k;

k = k + 10000;

 

return (short) k;

}

 

Edit, For a password of 0:

 

If you have 197, 198 or 199 towns in a scenario the formula for flag b will need to be adjusted?

 

I figure that flag d is a constant 14182.

 

Flag f, here "O" is the product of the outdoors width times the outdoors height. Note: 42*1, 21*2, 14*3 and 6*7 all give a product of 42. It does not matter which is the height and which is the width.

 

1 <= O <= 39

flag f =(80*O)+60,110

 

40 <= O <= 78

flag f =(80*O)+56,986

 

79 <= O <= 100

flag f =(80*O)+53,862

 

Width * Height <= 100. Width is less than 51 and height is less than 51, hence a prime number greater than or equal to 53 can't occur as a valid value of O. (It only has one as a possible cofactor.) Thus 79 won't occur in actual practice.

 

These are the three easy flags to calculate. The other three require a bit more work.

 

If you want to know what all this means, manually copy and paste this into your address bar:

http://www.freewebs.com/ishadnha/EXSDecrypts.zip

 

Edit 2

The three hard flags, (c,e,h) all have the same values for newly created scenarios. They may be easier than I thought. Even if Ormus removes password checking from a new edition of the Editor I will have to persevere with this anyway, it is fascinating.

 

Link to post
Share on other sites

About the passwords: I removed password checking in the game and scenario editor.

 

Originally Posted By: Ishad Nha

Project%20Options.bmp

Hmm, which version of Dev-Cpp is that you're using? Have you tried to compile the sources manually with GCC?

Link to post
Share on other sites

Ishad Nha, password protection is removed in my latest source code and executables of Scenario Editor. Check yourself, files are on my webpage.

 

You have some REALLY ancient version of Dev-C++. Three years ago version 4.9.9.2 (also called "5 beta") was published and you ought to use that one or switch to wxDev-C++.

Link to post
Share on other sites

Hooray, it is too. Jewelz will be pleased, this is what she has long been hoping for.

 

I am downloading wxDec-C++, hopefully this will work. What we really need is Editors that people can customize at will. This will hopefully lead to innovation and diversity.

Link to post
Share on other sites

Ormus:

I tried to compile the BoE savegames encrypt/decrypt utility (C++ source), and I got this:

 

[Linker Error] undefined reference to `__cpu_features_init'

ld returned 1 exit status

C:\Program Files\Dev-Cpp\examples\BoEXOR\Makefile.win [build Error] exe: *** [Output/MingW/Project2.exe] Error 1

 

Do I need to use wxDev_C++ with Ming-W?

Can you upload a compiled version?

 

Link to post
Share on other sites

Ishad Nha, do NOT create new project for encrypt/decrypt. Just open decrypt.cpp in Dev-C++ and compile. Decrypt.cpp is written in plain and simple C++, so you can compile it under any C++ compiler. In case you had problems, you can compile it manually: "g++ -o decrypt.exe decrypt.cpp" (or something like that)

Link to post
Share on other sites

Bizarre, something actually compiled, will the world now come to an end? Strange to see a comprehensible BoE save file.

 

It might be handy if you uploaded compiled Windows and Mac versions for people who are on ISP download limits.

 

(This might give insight into the Saved Item Rectangle problems.)

 

Edit: I compiled the thing manually on the Command Prompt, using the command that Ormus recommended:

"g++ -o decrypt.exe decrypt.cpp". (I first had to change directory to C:\Program Files\Dev-Cpp\bin, this may be a problem on my computer.)

 

The resulting exe is 467Kb, is it including debugging information, if so how to fix the problem?

 

Link to post
Share on other sites
Originally Posted By: "Ishad Nha"
It might be handy if you uploaded compiled Windows and Mac versions for people who are on ISP download limits.

I don't have access to any Mac. People working on Windows can try to use this: http://info.wsisiz.edu.pl/~kowalsg0/decrypt-dm.exe. It's only 22 kB. I've compiled it under Digital Mars C++ Compiler.

Originally Posted By: "Ishad Nha"
The resulting exe is 467Kb, is it including debugging information, if so how to fix the problem?

Yes, it includes debugging info which can be removed by using command-line utility called Strip: "strip decprypt.exe". Resulting file will be around 230 kB in size. If you want smaller file, try using diffrent compiler.
Link to post
Share on other sites

Whole post taken back, I don't know how I missed seeing that link the first time. Anyway, I'm working on it.

 

EDIT: As Ormus said, it required no porting. I guess it works, since after I use it there are some readable strings in the file. I'm putting it up on my BoE Editor page.

Link to post
Share on other sites

It is easy to check if it works properly. Compare the contents of the BoE source file "global.h" with the save file, especially structures like party record type. If the PCs have items you should see the identified and unidentified names of each item. Ditto you should see the names of the PCs. Magic store items and the scenario name are the only other readable strings.

 

Most of the verification can be done by comparing numbers, for example the outdoor coordinates of the party.

 

Edit: what I am saying is that you can create spreadsheets and enter data from the save game files. The first 45,914 places are the scenario flags and the party record structure. I did this and found that the data matched perfectly.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...