Xenoblade Chronicles X/2 format bible

The Original Forum. Game archives, full of resources. How to open them? Get help here.
User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 194
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 5 times
Been thanked: 125 times
Contact:

Xenoblade Chronicles X/2 format bible

Post by PredatorCZ » Tue Apr 10, 2018 7:59 pm

Topology of list:
  • File Extension
    • Format/usage
    • Can be opened with
Here is list of formats used in XenobladeX
  • .adx
    • ADX ADPCM Audio format
    • VLC
  • .usm
    • CRI Movie 2
    • VGMToolbox/Stream Tools/Video Demultiplexer
  • .cpk
    • CRI Archive
    • VGMToolbox/Extraction Tools/Common Archives
  • .mca
    • Script
  • .eva
    • Script
  • .bdat
    • Binary Data
  • .csvb
    • CSV Binary
  • .sha
    • Shader Container
  • .efb
    • Effect Bundle
  • .epac
    • EFB Container
  • .evpa
    • Container
  • .mdlstm
    • Skeleton path table
  • .motstm
    • Animation Table
  • .motstm_data
    • Animation data container
  • .hkt
    • Havok 2013 binary file
  • .sar
  • .camdo
  • .casmt
  • .camtp
    • CSV Binary
  • .cea
    • CES Container
  • .ces
    • Hash table
  • .efp
    • CSV Binary
  • .cadsys
    • CSV Binary
  • .catex
  • .chr
    • CSV Binary
  • .crv
    • CSV Binary
  • .canvda
    • NVTP Container
  • .canvhe
    • NVMS map related file
  • .casmda
    • Map data container
  • .casmhd
    • DMSM map related file
  • .bmn
    • UI Script/MTXT Container
  • .fnt
    • Font file/MTXT Container
  • .gsh
    • GFX2 Datafile
  • .casfb
    • CSV Binary
  • .caavp
  • .bmv
    • UI Script
  • .caevd
    • Unknown/MTXT Container
  • .caevh
    • Unknown/MTXT Container
  • .calgs
    • SHTM shader container
  • .cashd
    • SHTM shader/ container
  • .acb
    • CRI Sound Bank
    • VGMToolbox/Extraction Tools/Common Archives
And here is list of formats used in Xenoblade 2.
  • .nop
    • Sound Container (opus, adpcm)
  • .webm
    • Video Format
    • VLC
  • .bdat
    • Binary Data
  • .mi
    • Minimap
  • .bnvib
    • Unknownn (Force Feedback curve?)
  • .gcp
    • Camera Paramaters
  • .rimb
    • RimBloom Paramaters
  • .pdb
  • .prm
  • .sb
    • Binary Script
  • .seg
    • Minimap Segment
  • .vpr
    • Particle Parameter
  • .wisty
    • Font
  • .wiefb
    • Effect Bundle
  • .wieab
    • Unknownn (.wiefb related)
  • .eva
    • Camera Effect
  • .evpa
    • EVPA Container
  • .mot
  • .motstm
    • PACK Container (Cutscene animations?)
  • .motdata
    • Data for .motstm
  • .lvl
    • LVLB Script (Gimmick)
  • .wiidcm
    • IDCM Texture
  • .wismt
  • .winvhe
    • NVMS map related file
  • .wismda
    • Map data container
  • .wismhd
    • DMSM map related file
  • .winvda
    • NVDA map Container
  • .wifnt
    • Font
  • .wilay
    • LAHD Texture
  • .uin
    • UI Motion
  • .uio
    • UI Object
  • .wimdo
  • .wiefp
    • CSV Binary
  • .wiswt
    • Basic Container
  • .arc
  • .witex
    • Texture
  • .wishp
    • Shader
  • .witx
    • Texture
  • .csvb
    • CSV Binary
  • .xsp
  • .stp
  • .pad
    • Binary Collection
  • .param
    • Binary Collection
  • .anm
    • Binary Collection
  • .asm
    • Binary Collection
  • .stb
    • Binary Collection
Last edited by PredatorCZ on Mon Apr 23, 2018 7:14 pm, edited 7 times in total.

User avatar
chrrox
Moderator
Posts: 2522
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1252 times

Re: Xenoblade Chronicles 2 arh/ard

Post by chrrox » Wed Apr 11, 2018 12:48 am

is there a decrypted release out there?

User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 194
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 5 times
Been thanked: 125 times
Contact:

Re: Xenoblade Chronicles 2 arh/ard

Post by PredatorCZ » Wed Apr 11, 2018 9:24 am

chrrox wrote:is there a decrypted release out there?
There is hactool decryptor already released. It can extract/decrypt most NSW cartriges.


Here is another script, that will extract SAR Containers from both games.

Code: Select all

# Xenoblade Chronicles sar unpacker
# Author Lukas Cone in 2016-2018
# script for QuickBMS http://quickbms.aluigi.org

get FOURCC long

if FOURCC == 0x31524153   
	endian big
elif FOURCC == 0x53415231
	endian little
else
	cleanexit
endif


get filesize long
get Version long
get FILES long
get OFFSET long
get DataOffset long
get dummy long
get dummy long
getdstring PATH 128

goto OFFSET

for i = 0 < FILES
    get iOffset long
    get iLen long
    get dummy long
    putarray 0 i iOffset
    putarray 1 i iLen
    set _fname PATH
	string _fname + "/"
	if Version > 500 
		getdstring iFname 36
		string _fname + iFname
		goto 48 0 SEEK_CUR
	else
		getdstring iFname 52
		string _fname + iFname
	endif
	putarray 2 i _fname	
next i

for i = 0 < FILES
  getarray iOffset 0 i
  getarray iLen 1 i
  getarray iFname 2 i
  log iFname iOffset iLen
next i   

4g3n75m17h
ultra-n00b
Posts: 2
Joined: Sat Apr 08, 2017 2:49 am

Re: Xenoblade Chronicles X/2 format bible

Post by 4g3n75m17h » Mon Apr 16, 2018 2:56 pm

I am probably just being a bit stupid, but I am having the following problem when I try to extract the bf2.ard/arh archives:

Code: Select all

- open input file D:\NS\QBMS\bf2.arh
- open script D:\NS\QBMS\xenoblade2.txt
- set output folder D:\NS\QBMS\out

  offset           filesize   filename
--------------------------------------
- enter in folder D:\NS\QBMS
- open input file D:\NS\QBMS\bf2.ard

- signature of 1 bytes at offset 0x0000000000000000 doesn't match the one
  expected by the script:

  this one: "a"
  61                                                a

  expected: "0"
  30                                                0

- 0 files found in 0 seconds
  coverage file 0     0%   1          1915120    . offset 0000000000000001
  coverage file 1     0%   0          10957229330 . offset 0000000000000000

Press ENTER or close the window to quit
Any idea what's wrong and how to fix it? The .ard/.arh files are ones that I extracted myself from a Xenoblade 2 .nca using hactool. All other files from that .nca, such as the .webm files, all seem fine. Also, I have used QuickBMS to extract other files before (quite a while ago, I admit) and haven't seen this issue before.

I am using QuickBMS 0.8.4 on Windows 10 Pro 64 Bit, if that makes any difference. Also, already tried running as admin and using compatibility options, but that seemed to make no difference.

I am but a humble 3D modeller with very limited programming knowledge, so any help would be much appreciated! :)

User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 194
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 5 times
Been thanked: 125 times
Contact:

Re: Xenoblade Chronicles X/2 format bible

Post by PredatorCZ » Wed Apr 18, 2018 3:17 pm

4g3n75m17h wrote:I am probably just being a bit stupid, but I am having the following problem when I try to extract the bf2.ard/arh archives:

I am using QuickBMS 0.8.4 on Windows 10 Pro 64 Bit, if that makes any difference. Also, already tried running as admin and using compatibility options, but that seemed to make no difference.
ARH file must have arh1 as signature (fist 4 bytes), when opened with hex editor. Otherwise it's a corrupted file.

4g3n75m17h
ultra-n00b
Posts: 2
Joined: Sat Apr 08, 2017 2:49 am

Re: Xenoblade Chronicles X/2 format bible

Post by 4g3n75m17h » Thu Apr 19, 2018 2:50 am

PredatorCZ wrote:ARH file must have arh1 as signature (fist 4 bytes), when opened with hex editor. Otherwise it's a corrupted file.
That is what makes me curious though. When I open the .arh file with a hex editor, arh1 are the first 4 bytes.

Also, the .ard and .arh files extract perfectly when I use the ‘xenoblade2-research’ tool from ‘Thealexbarney’ on GitHub. I compiled their tool using Visual Studio 2017 Community, ran the extraction command for the .ard and .arh files through CMD using the tool, and all the files were extracted successfully, so I can assume based on that; my .ard and .arh files are not corrupted.

I had these files extracted before I used your script, and was mainly interested in using your script to extract the files again so I could compare the newly extracted files from your script to the already extracted files from the ‘xenoblade2-research’ tool to see if there are any differences before I start trying to figure out how to access the models and textures.

So, that said, assuming my files are not corrupted, I am at a loss as to why your script isn’t working. :( Any ideas about what might be happening?

User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 194
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 5 times
Been thanked: 125 times
Contact:

Re: Xenoblade Chronicles X/2 format bible

Post by PredatorCZ » Fri Apr 20, 2018 4:35 pm

4g3n75m17h wrote:
So, that said, assuming my files are not corrupted, I am at a loss as to why your script isn’t working. :( Any ideas about what might be happening?
The problem is QuickBMS, I'm using version 0.7.7. I tried version 0.8.4 and it showns exact same error. I will try to fix script. I might also figure out those broken filenames.

EDIT:
For some reason they removed IDString "hello" FILEID syntax, looks like they don't give a shit about backwards compatibility, whinch is sad.

EDIT2:
Filenames are using some kinda of Patricia or Radix Tree, my knowlege of this technique is very limited and take some time, so in that case I fixed script, it's edited version is on first post. I also deleted attachemt.

User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 194
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 5 times
Been thanked: 125 times
Contact:

Re: Xenoblade Chronicles X/2 format bible

Post by PredatorCZ » Sat Apr 21, 2018 4:29 pm

Here is a QuickBMS script version 2, that will extract contents of bf2.ard/arh archives. From Xenoblade 2.
Some extracted files will have [%file id%] %filename% names, cause is that script cannot find them in a tree. Cause is unknown.

Make sure that both ard/arh files are in same folder and in quickbms dialog, always select bf2.arh.

Code: Select all

# Xenoblade Chronicles arh/ard unpacker
# Author Lukas Cone in 2018, Version 2
# script for QuickBMS http://quickbms.aluigi.org
# 1st iteration 1:15 hours
# 2nd iteration 40 minutes
endian little
comtype zlib
open FDSE "bf2.ard" 1

idstring 0 "arh1" 

get unk long
get numnodes long
get offset1 long
get size1 long
get offset2 long
get size2 long
get tocoffset long
get numfiles long

filexor "0x33 0xB5 0xE2 0x5D"
GoTo offset1 0 SEEK_SET
get chunksize long
for i = 0 < numfiles
	savepos OFFSET
	get fname string
	putarray 0 i fname
	math OFFSET n OFFSET
	math OFFSET + offset1
	putarray 3 i OFFSET
	get fid long;
next i

GoTo offset2 0 SEEK_SET
set numusednodes long 0
for i = 0 < numnodes
	get id1 SIGNED_LONG
	get id2 SIGNED_LONG
	putarray 1 i id1
	putarray 2 i id2
	if id2 > -1
		putarray 4 numusednodes i
		math numusednodes + 1
	endif
next i
filexor ""



GoTo tocoffset 0 SEEK_SET
for i = 0 < numfiles
	get coffset longlong
	get csize long
	get ucsize long
	get compressed long
	get id long
	getarray Filename01 0 i
	getarray fileoffset 3 i
	strlen filenamelen Filename01
	math Fileend = fileoffset
	math Fileend - filenamelen
	string cstr = ""
	callfunction FindFilename 1
	strlen NAME_LENGTH cstr
	math filenameoffset - fileoffset
	math filenameoffset n filenameoffset
#	print "%filenameoffset%"
	if filenameoffset > 0
		string Filename01 < filenameoffset
	endif
	string cstr + Filename01
	
	if compressed > 0
		GoTo coffset 1 SEEK_SET
		idstring 1 "xbc1" 
		get _numfiles long 1
		get _ucsize long 1
		get _csize long 1
		get _hash long 1
		getdstring _fname 28 1
		savepos OFFSET 1
		if NAME_LENGTH < 1
			string cstr P "[%id%] %_fname%"
		endif
		clog cstr OFFSET csize ucsize 1
	else
		if NAME_LENGTH < 1
			string cstr P "[%id%] %Filename01%"
		endif
		log cstr coffset csize 1
	endif	
next i


startfunction FindFilename
	for g = 0 < numusednodes
		getarray f 4 g
		getarray id1 1 f
		getarray id2 2 f
		if id1 <= fileoffset && id1 > Fileend 
			set filenameoffset SIGNED_LONG id1
#			print "%filenameoffset% %id2%"
			set currentChar SIGNED_LONG f
			callfunction LOOPNODES 1
			string cstr r cstr
#			print "%cstr%"
			break	
		endif
	next g
endfunction

startfunction LOOPNODES
	set cci SIGNED_LONG id2
	getarray id1 1 id2
	getarray id2 2 id2
	math currentChar ^ id1
#	print "%currentChar% %id1% %id2%"
	string _cstr = currentChar
	string cstr + _cstr
	set currentChar SIGNED_LONG cci
#	print "%cstr%"
	if id2 > 0 
		callfunction LOOPNODES 1
	endif
endfunction



DragonScion
ultra-n00b
Posts: 2
Joined: Tue Apr 24, 2018 4:16 am

Re: Xenoblade Chronicles X/2 format bible

Post by DragonScion » Tue Apr 24, 2018 4:21 am

Can't wait until we can extract 3d models

tone
beginner
Posts: 34
Joined: Sun Jul 02, 2017 8:40 pm
Has thanked: 11 times

Re: Xenoblade Chronicles X/2 format bible

Post by tone » Mon May 21, 2018 10:06 am

is there a way to extract data from xci (switch cartridge image)?

LOGCETERA
ultra-n00b
Posts: 4
Joined: Mon May 28, 2018 9:51 am
Has thanked: 2 times

Re: Xenoblade Chronicles X/2 format bible

Post by LOGCETERA » Tue Jul 24, 2018 8:59 am

I've been browsing around in the Xenoblade 2 game files and found a file called tora.bin in the minigames folder. It's got to be the game file to Tiger! Tiger!, right? If so, what could be done with it? Messing around in a text editor didn't get me anywhere... Answers would be kindly appreciated!

ignika98
ultra-n00b
Posts: 1
Joined: Wed Feb 08, 2012 4:09 pm

Re: Xenoblade Chronicles X/2 format bible

Post by ignika98 » Mon Nov 19, 2018 11:26 am

Any way to extract the data from the .casmda files? I'm trying to extract the map model, if that's even possible.

andree
beginner
Posts: 25
Joined: Sun Jul 09, 2017 1:36 pm
Has thanked: 2 times

Re: Xenoblade Chronicles X/2 format bible

Post by andree » Tue Nov 20, 2018 12:14 am

Hey, is it possible to convert .anm files into FBX files or no?

sfc123
n00b
Posts: 14
Joined: Sun Nov 09, 2014 7:25 pm
Has thanked: 1 time

Re: Xenoblade Chronicles X/2 format bible

Post by sfc123 » Mon Jan 07, 2019 2:31 pm

welldone~~ how to export nca from xci?

sfc123
n00b
Posts: 14
Joined: Sun Nov 09, 2014 7:25 pm
Has thanked: 1 time

Re: Xenoblade Chronicles X/2 format bible

Post by sfc123 » Mon Jan 07, 2019 2:34 pm

how to export Xenoblade Chronicles 2 from xci?

Post Reply