It is currently 30 Apr 2025, 02:14
   
Text Size

Information pending...

Moderator: CCGHQ Admins

Re: Information pending...

Postby wybielacz » 23 May 2015, 11:15

spirolone wrote:Almost two months has passed since my last post: I'm sorry, I thought it would have been more easy to understand a Zed archive! :(
But, finally, I think I understood how it works and now I can extract a file from archive!!! :mrgreen: :mrgreen: :mrgreen:
Could you share the info how to extract the ZED archive?

In the past days i just started to analyze the game myself since i pretty much created every deck possible with the cards that are currently in game. Now i want to use the cards that are only available to the AI.
I found the following info. You don't need to pack the content into ZED files, the game loads signed WAD files just fine. I used the files from Magic 2014 which are signed and the game loaded them. I suppose that we only need a WAD signature check bypass like for Magic 2014 and it should be good to go.

Here is a PoC: Magic 2014 personas in Magic 2015 ;)
More PoC: Silvers from Magic 2014 working without any problems in 2015!
Attachments
proof2.png
proof.png
wybielacz
 
Posts: 12
Joined: 23 May 2015, 11:07
Has thanked: 0 time
Been thanked: 2 times

Re: Information pending...

Postby spirolone » 23 May 2015, 12:11

wybielacz wrote:Could you share the info how to extract the ZED archive?

In the past days i just started to analyze the game myself since i pretty much created every deck possible with the cards that are currently in game. Now i want to use the cards that are only available to the AI.
I found the following info. You don't need to pack the content into ZED files, the game loads signed WAD files just fine. I used the files from Magic 2014 which are signed and the game loaded them. I suppose that we only need a WAD signature check bypass like for Magic 2014 and it should be good to go.

Here is a PoC: Magic 2014 personas in Magic 2015 ;)
More PoC: Silvers from Magic 2014 working without any problems in 2015!
Nice! :D

I can try to explain what operations I do to extract a file from zed archive, but I think it's better I try to make a Java program to automatise the procedure. I hope I can write a program that converts a zed archive in a standard zip archive... :mrgreen:
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Information pending...

Postby wybielacz » 23 May 2015, 12:23

spirolone wrote:Nice! :D

I can try to explain what operations I do to extract a file from zed archive, but I think it's better I try to make a Java program to automatise the procedure. I hope I can write a program that converts a zed archive in a standard zip archive... :mrgreen:
That would be cool. Is it possible to convert a zip file back to ZED?

More 2014 content in M2015 ;)
Attachments
proof3.png
wybielacz
 
Posts: 12
Joined: 23 May 2015, 11:07
Has thanked: 0 time
Been thanked: 2 times

Re: Information pending...

Postby thefiremind » 23 May 2015, 12:46

wybielacz wrote:You don't need to pack the content into ZED files, the game loads signed WAD files just fine.
I guessed that myself: by running the executable in a debugger, I understood that it scans the game directory for both ZED and WAD files. Too bad it wants them signed... I was hoping it didn't, because I messed with a ZED file long ago (can't remember what I hex-edited inside it) and the game tried to load it anyway. Maybe WAD files need signature but ZED files don't? Or maybe the signature check doesn't depend on the whole file content (as it would depend for a CRC or similar checks)?

Anyway, congratulations to spirolone! I'm really looking forward to see if it's possible to add an arbitrarily large number of cards to the collection as soon as we have full access to the data. Even if the upcoming game (Duels Origins) screws us over again with new and improved forms of protection, 2015 would still be a very good platform to mod, assuming that we can add cards and let players build their own decks with them.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby wybielacz » 23 May 2015, 13:09

thefiremind wrote:I guessed that myself: by running the executable in a debugger, I understood that it scans the game directory for both ZED and WAD files. Too bad it wants them signed... I was hoping it didn't, because I messed with a ZED file long ago (can't remember what I hex-edited inside it) and the game tried to load it anyway. Maybe WAD files need signature but ZED files don't? Or maybe the signature check doesn't depend on the whole file content (as it would depend for a CRC or similar checks)?
As far as i saw, the ZED files are encrypted with RSA. That means the public key which is in the .exe can only decrypt those archives. The private key which WoTC has is used to encrypt those archives. Unless someone doesn't leak the private key there is no possibility for us to create custom ZED files which the game can load.

I see 2 possibilities here:
1. Patch the game like 2014 and disable the WAD signature check. We can use then the good old WAD files.
2. Patch the game like the Chinese did to simply load all the data from the "Content" directory.
wybielacz
 
Posts: 12
Joined: 23 May 2015, 11:07
Has thanked: 0 time
Been thanked: 2 times

Re: Information pending...

Postby spirolone » 28 May 2015, 00:22

I'm happy to say I finished my Java Zed-To-Zip Converter!!! :mrgreen: :mrgreen: :mrgreen:

It loads "DATA_000.ZED" file from current folder and creates a standard zip file named "DATA_000.zip".
Attachments
ZedToZip.zip
(5.79 KiB) Downloaded 437 times
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Information pending...

Postby Xander9009 » 28 May 2015, 00:24

spirolone wrote:I'm happy to say I finished my Java Zed-To-Zip Converter!!! :mrgreen: :mrgreen: :mrgreen:

It loads "DATA_000.ZED" file from current folder and creates a standard zip file named "DATA_000.zip".
That is fantastic news!
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Information pending...

Postby Xander9009 » 28 May 2015, 01:58

It doesn't seem to work on my end. It could be that I have the 3DM version. I won't be buying 2015 until it can be modded.

The zed file I have is 335,984,168 bytes.
The zip files produced is 692,960 bytes.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Information pending...

Postby Tejahn » 28 May 2015, 03:58

Video Screens.PNG
Video Screens

Textures.PNG
Textures
Frontend.PNG
Frontend
Data_All_Platforms.PNG
Data_All_Platforms
Zed Unzipped.PNG
Zed Unzipped


FIRST OF ALL, THANK YOU SPIROLONE!!!

Xander9009, it's working for me. Everything is loading properly. I'll do some more extensive test and post my findings. I did discover that some keywords use their own .LOL file now (Not sure if that's always been the case). All art is loading as well.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Information pending...

Postby Xander9009 » 28 May 2015, 04:44

That's fine. Since we may not be able to repack them into zed files, it won't actually matter. It really just matters that it's working at all so that we can see and understand the folder structure and access all of the files. Since we can apparently use wad files, the last step should be for someone who can to create another wad signature check disabler and we'll be able to mod, right?
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Information pending...

Postby Tejahn » 28 May 2015, 05:01

So it seems. And I'm just glad to study the new structure. I'll experiment with the 'Content' folder method some more tomorrow to see if it will accept some actual non-cosmetic changes.

EDIT: I have a question regarding file types. What software is used to open .BZN, .CNT, .IMG, .MDL, .MT2, and .MTL files?
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Information pending...

Postby wybielacz » 28 May 2015, 06:40

spirolone wrote:I'm happy to say I finished my Java Zed-To-Zip Converter!!! :mrgreen: :mrgreen: :mrgreen:

It loads "DATA_000.ZED" file from current folder and creates a standard zip file named "DATA_000.zip".
Works great! Really good work. Thanks.

Now there is one more piece of the puzzle left. Someone knows if Rick still comes to the this forum? His last login was like almost a year ago :/ If he could port his wad signature check disabler to Magic 2015 then i guess we good are to go!
wybielacz
 
Posts: 12
Joined: 23 May 2015, 11:07
Has thanked: 0 time
Been thanked: 2 times

Re: Information pending...

Postby thefiremind » 28 May 2015, 08:34

Tejahn wrote:EDIT: I have a question regarding file types. What software is used to open .BZN, .CNT, .IMG, .MDL, .MT2, and .MTL files?
I remember having opened CNT with a hex-editor when I had to make my own wither badge (with some help from kevlahnota), but you can actually open any file with a hex-editor, the problem is if you can make something out from what you see afterwards... :P Other than that, I have no idea.

I'm going to try the zed-to-zip tool right now.
EDIT: It works great! =D>

Xander9009 wrote:It doesn't seem to work on my end. It could be that I have the 3DM version. I won't be buying 2015 until it can be modded.

The zed file I have is 335,984,168 bytes.
The zip files produced is 692,960 bytes.
That's strange, the ZED file should be the same one anyway. I'll try to convert the expansion packs (of course the program needs a little modification so that it can accept any file name) and see if I encounter any problem. If I don't, then it means the program is "universal" enough to handle any encrypted ZED file.

EDIT 2: Unfortunately, the tool can only convert DATA_000.
For DATA_010 it gives a Java heap space error on
Code: Select all
localFileData = new byte[localFileCompSize];
For DATA_020 and following ones it gives an ArrayOutOfBoundsException on
Code: Select all
System.arraycopy(centralDir, pt+46, localFileHeader, 30, localFileNameLen);
I guess some of the hard-coded values are actually different in different ZED files.

EDIT 3: For those who are curious to see, I pasted the decompilable LOL contents in the 2015 section on the wiki.
Last edited by thefiremind on 29 May 2015, 13:55, edited 2 times in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Information pending...

Postby spirolone » 28 May 2015, 11:37

thefiremind wrote:...
I'll try to convert the expansion packs (of course the program needs a little modification so that it can accept any file name) and see if I encounter any problem. If I don't, then it means the program is "universal" enough to handle any encrypted ZED file.

EDIT 2: Unfortunately, the tool can only convert DATA_000.
For DATA_010 it gives a Java heap space error on
Code: Select all
localFileData = new byte[localFileCompSize];
For DATA_020 and following ones it gives an ArrayOutOfBoundsException on
Code: Select all
System.arraycopy(centralDir, pt+46, localFileHeader, 30, localFileNameLen);
I guess some of the hard-coded values are actually different in different ZED files.
Ops... sorry, my fault! A stupid bug in my code: it worked for DATA_000 only cause one specific byte was "00"... :oops:
Here is corrected version! :mrgreen:
Attachments
ZedToZip.zip
(5.79 KiB) Downloaded 421 times
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Information pending...

Postby thefiremind » 28 May 2015, 11:55

I confirm that now it converts any ZED file I have. Great work! =D>

The structure of the ZED files 020, 021 and 022 seem easy enough when their only purpose is to add cards to the collection, although the necessity of repeating all the cards' code in a "booster" XML still seems like a waste to me. The question is: assuming that we can either find out how to make new ZED files ourselves (can't the process be reversed?) or bypass the signature check for WAD files, can we add an arbitrarily large number of cards then?

EDIT: Oh, I was almost forgetting: this is ZedToZip modified by me. All the credit still goes to spirolone, I just made a little modification so that it accepts the ZED file path as argument. Extract the contents in any directory you want, edit run.bat with Notepad and write the desired file path, then run run.bat. If it can't find java.exe, it means that Java is not in your Windows PATH environment variable; how to put it there depends on the version of Windows you're using (on Windows 8.1 it's control panel -> system -> advanced settings -> environment variables, then you have to find where java.exe is in your computer and add its path - without the file name - to the Path variable in the lower list).
Attachments
ZedToZip_thefiremind.zip
(6.61 KiB) Downloaded 618 times
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

PreviousNext

Return to 2015

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 2 guests

Login Form