XWAHacker GUI available

Any issues with the XWAU or X-Wing Alliance? Please let us know here!
Post Reply

XWAHacker GUI available

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Mon Jan 26, 2015 5:23 pm

Hello,
You can now get a GUI for xwahacker: http://sourceforge.net/projects/xwahack ... p/download
The usual applies: it's barely tested, all kind of things might go wrong, best make at backup etc...
End of important part.
I apologize for its massive size, but for those of you downloading files here a few MB more should hardly matter I guess.
The size is due to Qt being the only GUI toolkit decent enough for me to make only half-horrible UIs (except .Net, but I hate having to install a runtime and it's a pain on Linux).
Also while I have your attention: Note that my code signing key will expire end of June this year.
I am not sure what exactly will happen, ideally you should just get a warning that the certificate has expired and you should not trust it too much. However it is possible Microsoft is stupid and will show some really nasty warning.
Just so you know.
Rant:
There are methods to ensure old signatures remain valid forever and I've used them. However Windows will only accept those if you have a $500 certificate - more than I am going to spend for a hobby. And if security isn't important enough to Microsoft to ensure more reasonable prices I have little reason to take it seriously.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Jan 26, 2015 6:50 pm

Looks good, a bit of a readme wouldn't have gone amiss though :) Just to explain a few things before you actually start applying them

If people aren't familiar with your work and don't want to trawl through the forum looking for answers to what everything does

The resolutions part is pretty much self explanatory, it's the options that are a bit vague
like the fixed Z clear, for the first time user, they haven't a clue what it is or does
force 800x600 - an explanation might be helpful
32 bit (buggy) - ????
no cd check - Yep understand that, but a newby HUH!!
Voice from disc - again I understand, but again the newby, WTF?
starfield off - I guess this turns the starfield off right??, but what if you have the Super Backdrops installed, which use the Dat files for the starfield, instead of in exe stuff, it would appear that this setting doesn't work or does it????? hmmmmmm :)
message loop - not applicable for widows users, but an explanation would be nice.

maybe I'm being nit-picky, I appreciate the work you are doing or what you have done

Could I also ask, would it be possible for a list of all the xwa offsets from and too numbers just mainly the options really and the offsets to to the resolutions, just the offsets, I'm not bothered about what to change the resolutions too as the variants are countless.

personally it'll just makes it easier for me if I knew the offsets

Please :) (flashes eyes), thanks
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Mon Jan 26, 2015 8:30 pm

Thanks, I'l think about better descriptions. I originally though obscure is better than scary complicated ;) . I'd prefer if a readme just wasn't needed for a GUI to be honest.
Though the options part is intended mostly for people who want to play around with it or do exactly what they are told by someone else :D
As to the offsets, easiest might be to just make the changes and then use a tool to compare.
But otherwise look here http://sourceforge.net/p/xwahacker/code ... wahacker.c
E.g. around line 32 the resolutions: {0x10a3dd, 0x10f422, 640, 480}, // 0
First is where you can find width/height, second for FOV and HUD scale.
The options patches around line 311:
[PATCH_16BIT_FB] = {0x1a90a4, 16, 1
patch name, then offset and size to replace.
To map those patch names to the descriptions look just above.
xwa_collections around line 585 might also be relevant.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Jan 26, 2015 9:17 pm

Thanks Reimer that's a great help

and for a readme, I've just noticed on the XWA Hacker website, you already have your readme you could put a link on your gui to this page
http://sourceforge.net/projects/xwahacker/files/
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 27, 2015 1:41 am

Not sure where to post this or who it applies too, either Reimer, JeremyFr or GOG.com

It concerns the PATCH NO CD CHECK I needed the offsets as there was something different with my no cd patch, but didn't know where to look in the exe to check.

As you know the no cd check is to stop this screen appearing in game
gognocd2.jpg
Which it does at Offset 0x12A3E5

from CD CHECK "83 EC 50 84 C0 56 57 75 08 33 C0" to NO CD CHECK = "83 EC 50 84 C0 56 57 33 C0 40 90"

Which are the settings you gave me Reimer and are the same settings GOG applied to there exe

But you still have to start the game with the launcher unless you have the XWA CD in the drive, because if you start the game from XwingAlliance.exe and you don't have an XWA CD in the drive this message box pops up
gognocd.jpg
and you have to click on Cancel or Continue 4 or 5 time before the game starts, which becomes very annoying, because unless GOG has added something I'm assuming GOG'g XWA still runs with all the CPU's.

As far as I know XWA still prefers to run on one core, please correct me if I'm wrong

With the No CD patch I have you can stop the message box appearing

There are a couple of offsets that need changing it incorporates your original offset changes

The offset you start from is

Offset 0x12A3E0 and change

from A0 37 C7 AB 00 83 EC 50 84 C0 56 57 75 08 33 C0 to B8 01 00 00 00 C3 EC 50 84 C0 56 57 33 C0 40 90
and offset 0x12a55e from 75 to EB

And of course don't forget change the HD Voice Patch
Offset = 0x15772E from 75 32 E8 DB to 90 90 E8 DB

this will stop the massage box appearing and you don't have to start XWA from the launcher (Alliance.exe)

You don't have to have an XWA Disc in the drive and you can now launch the game from XwingAlliance.exe, which means you can create or edit a shortcut to use Affinity to run XWA on only one Core

You can look at this thread http://www.xwaupgrade.com/phpBB3008/vie ... 10&t=10594

Or there are 2 ways you can do this

The First Version

Right Click your XWA shortcut : Select properties : Click the Shortcut tab :
Copy and paste the line below into the Target: box replacing whatever is in there.

C:\Windows\System32\cmd.exe /C start "" /affinity 01 "C:\Program Files (x86)\LucasArts\X-Wing Alliance\XwingAlliance.exe" /skipintro

GOG version

C:\Windows\System32\cmd.exe /C start "" /affinity 01 "C:\Program Files (x86)\LucasArts\Star Wars - X-Wing Alliance\XwingAlliance.exe" /skipintro

The Second Version

You will have to download Runfirst unzip it, copy and paste it to your XWA Directory.

Right Click your XWA shortcut : Select properties : Click the Shortcut tab :
Copy and paste the line below into the Target: box replacing whatever is in there.
But this version you can't skip the intro

"C:\Program Files (x86)\LucasArts\X-Wing Alliance\RunFirst.exe" XWingAlliance.exe

GOG Version

"C:\Program Files (x86)\LucasArts\Star Wars - X-Wing Alliance\RunFirst.exe" XWingAlliance.exe
You do not have the required permissions to view the files attached to this post.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Tue Jan 27, 2015 6:06 am

That second dialog box isn't created by the game but by Windows behind its back.
I think that means that your registry entries incorrectly point to your CD drive instead of installation path, which might cause other issues.
Assuming I am right, I think your suggested patch is a bad idea as it would only hide a misconfiguration.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 27, 2015 8:48 am

Here are the registry entries for X-wing Alliance

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LucasArts Entertainment Company LLC\X-Wing Alliance\v1.0]
"Install Path"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance"
"Executable"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance\\ALLIANCE.exe"
"Source Path"="C:"
"CD Path"="C:"
"Analyze Path"="SysCheck.EXE"
"Source Dir"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance"
"JoystickID"="1"
"Version"="2.0"
"InstallType"=dword:00000009
"SoundCard"="TRUE"
"Magic"=dword:00091000
"LastPilot"="DSUCP"

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GOG.com\Games\1421404763]
"PATH"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance"
"GUID"="{746fcafa-6e1a-4622-a350-b7c9cb29e968}"
"BUILD"="8"
"STARTMENU"="Star Wars - X-Wing Alliance"
"STARTMENULINK"="C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\GOG.com\\Star Wars - X-Wing Alliance\\Star Wars - X-Wing Alliance"
"gameID"="1421404763"
"uninstallCommand"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance\\unins000.exe"
"DEPENDSON"=""
"DLC"=""
"GAMENAME"="STAR WARS®: X-Wing Alliance"
"INSTALLDATE"="2015-01-23 09:13:12"
"VER"="2.0.0.8"
"SUPPORTLINK"="star_wars_xwing_alliance"
"GOGGAMEDLL"="goggame-1421404763.dll"
"LANGUAGE"="english"
"SAVEGAMEFOLDER"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance\\"
"LAUNCHPARAM"=""
"LAUNCHCOMMAND"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance\\ALLIANCE.exe "
"EXE"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance\\ALLIANCE.exe"
"EXEFILE"="ALLIANCE.exe"
"WORKINGDIR"="C:\\Program Files (x86)\\LucasArts\\Star Wars - X-Wing Alliance\\"
I placed the disc in Drive M: closed the draw, then ejected the disc

clicked on an unmodified GOG version of XwingAlliance.exe (which we know has actually be modified) then an original unmodified XwingAlliance.exe and the dialogue box pops up but is changed to drive M:
nocd.jpg
You can try it yourself, place your disc in a drive, eject it and if you have an unmodified version of the XwingAlliance.exe click on it, you should see the dialogue box appear, keep clicking the cancel box 5 or 6 time it might load the game then this in-game dialogue box will appear
gognocd2.jpg
If this dialogue box isn't produced by the XwingAlliance.exe then I'll eat Humble Pie :D :D
You do not have the required permissions to view the files attached to this post.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Tue Jan 27, 2015 7:51 pm

I'll think it over, but I don't like including more patches. I'd definitely like to understand what effect it has exactly first.
There is a simple workaround: Open explorer and click on your disk drive. Now you should no longer get these messages. This is probably the same effect that makes it work from the launcher (by accident I presume).
The dialog box is created by Windows when an application tries to open a file on an external disk (floppy, cd, ...) which was recently removed.
See SEM_NOOPENFILEERRORBOX at https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
So whether the dialog is "produced" by xwingalliance.exe depends on whether you consider "trying to open a file" to qualify for "producing a dialog".
I also suspect that this is a bug in XWA, as I believe this issue may have happened with unmodified binaries to people with multiple CD drives if they inserted the CD in the "wrong" one.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Tue Jan 27, 2015 8:29 pm

Ok, so the patch you proposed hacks the GetDriveType check. That is what I had thought about doing and seems reasonable and safe, so I added it.
A new version 2.5 with it is uploaded.
I also uploaded a 0.25 of the GUI with hopefully better description texts.
I decided not to include or reference the readme.txt as it only describes the command-line and that seems useless and confusing to me to have in the GUI-only package.
Maybe I'll write a proper GUI readme at some point, but not now (of course anyone is welcome to contribute).

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 27, 2015 9:38 pm

Took a bit of persuading, but thanks :) plus you not exactly adding a new patch your just extending an existing patch :)

No worries about the readme.

Just tested the GUI and got this error when clicking save and exit
Untitled-3.jpg
You do not have the required permissions to view the files attached to this post.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Tue Jan 27, 2015 10:35 pm

Assertion should be fixed, I uploaded fixed versions with the same file names.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Jan 28, 2015 3:03 pm

Thanks Reimar that works just fine now,

Thanks again for all your hard work :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
ShadowOwl
Cadet 3rd Class
Posts: 33
Joined: Sat Jan 24, 2015 12:47 am

Post by ShadowOwl » Thu Jan 29, 2015 9:29 am

Using the GUI version on the EXE of a fresh GOG install plus XWAUP CP 1.2 (testing) gives me this
https://imgur.com/nWFv7TT
Most likely related to the wireframe model workaround: http://www.xwaupgrade.com/phpBB3008/vie ... 72#p148072

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Jan 29, 2015 11:06 am

That's because you installed GOG and then you installed XWAUCP.

Just install GOG then run XWA Hacker GUI

But there isn't any need to run of change anything with XWA Hacker as the XWAUCP makes all the changes for you. That is the reason you get the error message "File has unsupported modifications" the Modification it is referring to are the offsets found by Jeremy Yes your right about the briefing wireframe, but there are other changes like one that stops Infinite Triangulation, the are changes needed by the New Backgrounds and so no. :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Thu Jan 29, 2015 9:07 pm

Note that the error message only appears if one of the modifications interferes directly with one of the patches in XWAHacker, which means that doing anything risks breaking it in a way that can't be repaired (well, I could skip the check for patches you can't change via the GUI, but that is a bit more difficult).
It is a bit hard to check, but as far as I can tell the briefing wireframe disable patch does not overlap with any of the XWAHacker patches, so it can't be the cause for the message.
For these kind of modifications that overlap with XWHacker ones I'd prefer to have them in XWHacker as well in some way, to be able to handle conflicts at least a bit.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Thu Jan 29, 2015 10:05 pm

I re-uploaded with a new GUI version that only disables the option part so you can still edit the resolutions.
However I'd kind of like this binary or a description of the conflicts so it can be handled properly.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Jan 30, 2015 2:24 am

Great, thanks Reimar. Off topic question for you... Jeremy's patches allow for both true 32-bit high colored textures to be used in DAT images such as DTM's SuperPlanet Backdrops (type 24 format). It also allows for 32 bit-high colored textures applied to Opt models.
However the game engine "dumbs" these colors down to 16-bit, so color quality suffers somewhat.

To clarify, your "32bitmode.bat" patch allows full rendering of 32-bit high-colored textures for "both" .DAT image files (type 24), AND .Opt models, correct ? ( I know there are not any 32-bit high-colored textures on any .opt models right now other than Gank's Frigate2 version).
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Fri Jan 30, 2015 10:38 pm

I can tell you that 32bitmode.bat (and corresponding GUI option) set the framebuffer to use 32 bits/pixel.
Most likely that means that 32 bit textures would be rendered at full quality, however I at least do not know the full render process to be sure there are no other steps involved that might lose precision.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Feb 01, 2015 2:27 am

Thanks. I've been testing a high photo-quality image imported into a DAT file at 4096x4096. Seems the larger the resolution, the better the quality in-game. Changing the scaling factor helps some using either Jeremy's offsets or via AlliED with stretched backdrop's "pixellation" display. But, comparing the native .bmp image in a paint program (color values gradually blend a lot smoother) vs. in game. I haven't tested this DAT on Win8 with new DDraw.dll file, so maybe the results are better than XP Pro platform. Will further test this later. Thanks again.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Sun Feb 01, 2015 11:02 am

If you compare interpolation between pixel values, then your viewer most likely simply uses a different algorithm.
All GPUs only support nearest or linear interpolation as modes. With the Directx 11 renderer adding bicubic would be possible, but it would be a shader-based implementation and too expensive to apply to everything even on modern GPUs.
You should also make sure that mip-mapping is enabled in the game (I remember there is some option related to that).
Once that is done, your graphics driver options to select "level of detail"/"sharpness" of the textures should work, though in the end it is still just a bunch of linear blends.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Mar 13, 2015 8:25 pm

Hi Reimar,

I propose the following patch to remove the behavior of the game which resets the resolution choice by using the resolution width:

Code: Select all

At offset 0x10A431, replace A134AD9100 with E9AE000000.
I think this will remove the need of applying force800mode.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Mar 21, 2015 1:03 pm

Jeremy can you elaborate a bit more on what this offset actually does please :) Thanks
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Sat Mar 21, 2015 3:00 pm

I'll see if I find time to add it, but I think it's not quite the right solution especially considering that with the GUI you currently can't apply patches on the versions many people have.
I think I'd rather just add a warning when people enter two resolutions with the same width that the game might get confused and choose the wrong one.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Mar 21, 2015 5:52 pm

The game sets the resolution based on screenres config.
The resolutions are editable with Xwa Hacker.

The code of the exe looks like that:

Code: Select all

ResolutionIndex = config.screenres;

switch( ResolutionIndex )
{
default:
    ResolutionWidth = 640;
    ResolutionHeight = 480;
    ResolutionIndex = 0;
    break;

case 1:
    ResolutionWidth = 800;
    ResolutionHeight = 600;
    break;

case 2:
    ResolutionWidth = 1024;
    ResolutionHeight = 768;
    break;

case 3:
    ResolutionWidth = 1152;
    ResolutionHeight = 864;
    break;

case 4:
    ResolutionWidth = 1280;
    ResolutionHeight = 1024;
    break;

case 5:
    ResolutionWidth = 1600;
    ResolutionHeight = 1200;
    break;
}
Then the game uses the resolution width to set back the screenres config.

The code of the exe looks like that:

Code: Select all

switch( ResolutionWidth )
{
case 640:
    config.screenres = 0;
    break;

case 800:
    config.screenres = 1;
    break;

case 1024:
    config.screenres = 2;
    break;

case 1152:
    config.screenres = 3;
    break;

case 1280:
    config.screenres = 4;
    break;

case 1600:
    config.screenres = 5;
    break;
}
The exe modifications will disable this switch.

Post Reply