Drag and drop encrypted files to decrypt.
Last active
July 3, 2023 15:40
-
-
Save akintos/04e2494c62184d2d4384078b0511673b to your computer and use it in GitHub Desktop.
'Yu-Gi-Oh! Master Duel' TextAsset decryption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Compression; | |
static void Main(string[] args) | |
{ | |
byte[] data = File.ReadAllBytes("CARD_Name"); | |
Xor(data); | |
using (MemoryStream ms = new MemoryStream(data)) | |
using (DeflateStream ds = new DeflateStream(ms, CompressionMode.Decompress)) | |
using (FileStream fs = File.Create("CARD_Name.dec")) | |
{ | |
ms.Position = 2; | |
ds.CopyTo(fs); | |
} | |
} | |
static void Xor(byte[] data) | |
{ | |
const byte m_iCryptoKey = 0xB3; | |
for (int i = 0; i < data.Length; i++) | |
{ | |
byte v = (byte)((i + m_iCryptoKey + 0x23D) * m_iCryptoKey); | |
v ^= (byte)(i % 7); | |
data[i] ^= v; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zlib | |
m_iCryptoKey = 0xB3 | |
with open("CARD_Name", "rb") as f: | |
data = bytearray(f.read()) | |
for i in range(len(data)): | |
v = i + m_iCryptoKey + 0x23D | |
v *= m_iCryptoKey | |
v ^= i % 7 | |
data[i] ^= v & 0xFF | |
with open("CARD_Name.dec", "wb") as f: | |
f.write(zlib.decompress(data)) |
That's odd, the crypto key 0x23F works for me for the files CARD_Desc, CARD_Indx and CARD_Name. Which file are you trying to decrypt?
That's odd, the crypto key 0x23F works for me for the files CARD_Desc, CARD_Indx and CARD_Name. Which file are you trying to decrypt?
I've deleted all the files and tried again, and it's working now. Thank you
hello everyone, Can anyone tell me what is CARD_Genre file, i desc but when i use hex to check i can't read the file. Thanks for your reading
p/s also can anyone tell me how can find the rarity card file? Thanks for your reading
The crypto key has changed again with the latest update: 0x25F
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New crypto key for Master Duel v1.4.1: 0x23F