Page 1 of 4

DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 03:42
by Rick
Tools (code & binaries):

http://svn.gib.me/public/duels/
http://svn.gib.me/builds/duels/

Note that the usage of Gibbed.Duels.Unpack.exe and Gibbed.Duels.Pack.exe has changed, they offer more functionality, I suggest you read their new usage.

Pack now defaults to version 0x202, so if you are using my tools for earlier versions of the game (2012 and 2010), you will need to specify --wv 0x201 (or --wad-version=0x202).

WAD files with version 0x202 have special data in the header now -- which is typically a copy of HEADER.XML found deeper in the file tree, When unpacking with Unpack, this is stored in the root directory of an unpacked WAD in @header.xml, and Pack will automatically read this file too.

WAD signature check disabling:

You have two options,

Patch memory address 0x0060C630 to B0 01 C3 (original is 55 8B EC) to disable the check.

Or you can use my dynamic patcher wrapper DLL which will handle this for you automatically. Drop the DLL into the game directory alongside DotP_D13.exe. Do not overwrite d3dx9_43.dll in any system directories!

As a side effect, the game will now boot up much faster since it doesn't have to hash every WAD with SHA256 on startup.

If you have any comments, questions, etc for my tools or the wrapper DLL, feel free to ask here (that's why I made a new thread, anyway).

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 05:10
by MisterBenn
What is that, 4 days all in? That's good going Rick.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 05:32
by Rick
MisterBenn wrote:What is that, 4 days all in? That's good going Rick.
There were minimal changes in 0x202, I just wanted to do a code cleanup and have something to disable the WAD signature check before I released anything, and I've been busy lately, if I hadn't this would have been up on the same day as the game. :)

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 08:08
by pcastellazzi
Compression is not working properly.

Code: Select all
Unhandled Exception: System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Gibbed.IO.StreamHelpers.WriteFromStream(Stream stream, Stream input, Int64 size, Int32 buffer)
   at Gibbed.Duels.Pack.Program.Main(String[] args)

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 08:14
by pcastellazzi
Another bug. --wad-header never found HEADER.XML, not matter what path i use. It only works with @header.xml in the default location.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 08:55
by thefiremind
I tried unpacking and repacking of the same WAD by dropping the WAD on the unpacker and the resulting directory on the packer, and it seems it did all right. The final WAD is bigger than the original, maybe because you are still not using any compression, but that's not a problem.

I think you want to know that your DLL is not compatible with the THETA version of the game: the game doesn't start and a message says "Failed to hook steam_api.dll". :P

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 09:09
by Rick
pcastellazzi wrote:Compression is not working properly.

Code: Select all
Unhandled Exception: System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at Gibbed.IO.StreamHelpers.WriteFromStream(Stream stream, Stream input, Int64 size, Int32 buffer)
   at Gibbed.Duels.Pack.Program.Main(String[] args)
Oops. I had rewritten some code there and forgot to test compression, it's fixed in r5.

pcastellazzi wrote:Another bug. --wad-header never found HEADER.XML, not matter what path i use. It only works with @header.xml in the default location.
What path were you giving? If it's a relative path, it's relative to the base directory you gave to pack, not the current directory.

IE:

Gibbed.Duels.Pack.exe --wad-header=myheader.xml Deck_Test_ST Deck_Test_ST.wad

Will make it look for .\Deck_Test_ST\myheader.xml, not .\myheader.xml

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 16:24
by pcastellazzi
Rick wrote:What path were you giving? If it's a relative path, it's relative to the base directory you gave to pack, not the current directory.
My bad.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 17:31
by GamerXYZ0
Great :D

Since I barely ever touch the command prompt, do I use it right like this? I open CMD, drag the pack program in it, then I press space and type (without quotation marks) "--wad-header=HEADER.xml", then another space, then I drag the unpacked wad in it, then a space, then I drag the unpacked wad once again in it and add .wad behind it.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 17:46
by sumomole
THX!
Successfully transplanted the deck of D12, And then make the new cards.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 24 Jun 2012, 20:15
by GamerXYZ0
An edited Data_Core.WAD appears to cause the game to crash on startup. I've tried without compression, and with compression.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 25 Jun 2012, 01:35
by kevlahnota
thanks for the tools rick :D

additional info if you have theta version(for dynamic patcher wrapper DLL to work).

1) hexedit dotp_13.exe and find/search storm_api, rename it to steam_api

2) rename storm_api.dll to steam_api.dll (theta uses storm_api)

3) put rick's d3dx9_43.dll to the game directory.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 25 Jun 2012, 02:20
by Rick
GamerXYZ0 wrote:An edited Data_Core.WAD appears to cause the game to crash on startup. I've tried without compression, and with compression.
Can you tell me exactly how you're repacking? I explicitly tried this and it worked fine.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 25 Jun 2012, 03:49
by GamerXYZ0
I still do it the same way: "I open CMD, drag the pack program in it, then I press space and type (without quotation marks) "--wad-header=HEADER.XML", then another space, then I drag the unpacked wad in it, then a space, then I drag the unpacked wad once again in it and add .WAD behind it."

Only with compression, I first press space and type (without quotation marks) "--compress" (and then space, --wad-header etcetera). It produces a file of (almost) the same file size (without compression much bigger of course).

I only changed 1 thing in the file: in the CONFIGS folder I edited DIFFICULTY_SETTINGS.XML, setting everything to as good as lvl 10 has (I did this in the previous DotP games as well). I always do that because there are many signs of the AI having rigged draws on Planeswalker difficulty: like this, I can play on Planeswalkers difficulty without rigged draws, as lower difficulties won't suffer from misplays on purpose.

Oh, and I just tried dragging HEADER.XML instead of typing it, to ensure it uses the right one, but the result was the same: crash on startup.

P.s. I don't know if it's part of the problem, but before, I edited Deck_0011_ST to make Nicol Bolas's deck available by changing never_available="true" in always_available="true", which according to Firemind worked fine for the DLC decks. But Bolas's deck wasn't unlocked. Perhaps because that .wad got corrupted or anything as well? Unfortunately, I can't test with the DLC decks, as I stupidly had overwritten the original Data_Core.WAD when I had dragged and dropped the new version (so: no copy in garbage bin), and I don't have the download saved on my PC.

Re: DotP 2013 - Tools & WAD signature check disabling

PostPosted: 25 Jun 2012, 04:15
by n00854180t
As part of an effort to enable the Nicol Bolas deck in my game I removed the 'never_available="true"' line from the Nicol Bolas deck and repacked it, which causes it to show up in the Deck Manager. However, it appears locked. To see if I could fix this I decided to add an unlock line for the deck to one of the Campaign battles.

Unfortunately something really weird happens when I use the repacked Data_Core.WAD file. To be sure the issue can be reproduced, here's the line I added in the file Data_Core_unpacked\DATA_CORE\DATA_ALL_PLATFORMS\CAMPAIGN\CAMPAIGN1.XML:

Code: Select all
<unlock deck="DECK_NICOL_BOLAS" />
Right after this line for the Nicol Bolas fight:

Code: Select all
<unlock promo="nicol_bolas_one" gamer_pic="2"/>
(Bah I can't get a screenshot of it apparently, it just grabs the stuff behind the game.)

In any case, normally the campaign menu is like this (with \/ denoting which is selected):

\/
Campaign | Revenge | Planechase | Challenges


After launching the game with the modified and repacked .WAD, the layout looks like this:

\/
Challenges | Planechase | Revenge | Campaign


The actual planes are listed in the normal order, but I can't actually start any games (I can get to the deck menu with the Start Game button, but it just boots me back to the plane menu where you select an encounter/opponent).

It doesn't seem to matter which campaign I put the unlock line in. I'm not sure if just straight repacking it causes the issue.

Here's the command I used to repack it:

Code: Select all
Gibbed.Duels.Pack.exe -c -wv=0x202 Data_Core_unpacked Data_Core.WAD
The issue also occurred regardless of using compression.