I am very new to this whole business so please bear with me.
Goal
My goal is to read JSON data from a game. Since I do not know what kind of information will/will not be useful, here are some of the details:
- It is an obscure mobile game by a Japanese company.
- All the JSON files were under the folder named
binarytableassetsen
(they put eitheren
orjp
at the end of some of their folders).
Examples
Here's an example of one of the said files called battle_pvp_cost.json
.
xxd battle_pvp_cost_2.json > temp.txt
00000000: 1400 0000 6261 7474 6c65 5f70 7670 5f63 ....battle_pvp_c
00000010: 6f73 742e 6a73 6f6e 3701 0000 87ce ef3e ost.json7......>
00000020: 47d6 93a2 656e a265 6ea2 6a70 ceb4 8e44 G...en.en.jp...D
00000030: ecda 0029 789c 8b56 3254 d251 3202 6263 ...)x..V2T.Q2.bc
00000040: 2036 0162 5320 3603 6273 20b6 0062 4b20 6.bS 6.bs ..bK
00000050: 3634 0011 864a b10c 00c6 3707 fdce aca5 64...J....7.....
00000060: d333 29ce befb 0353 c3ce 70da a798 a0ce .3)....S..p.....
00000070: b982 0d5b 00ce 1ab8 1a85 8bce 83dc efb7 ...[............
00000080: 82ce bf39 6750 01ce 1826 94fc 32ce 1ad5 ...9gP...&..2...
00000090: be0d 82ce bf39 6750 02ce 1826 94fc 64ce .....9gP...&..d.
000000a0: 6dd2 8e9b 82ce bf39 6750 03ce 1826 94fc m......9gP...&..
000000b0: d100 c8ce f3b6 1b38 82ce bf39 6750 04ce .......8...9gP..
000000c0: 1826 94fc d101 2cce 84b1 2bae 82ce bf39 .&....,...+....9
000000d0: 6750 05ce 1826 94fc d101 90ce 1db8 7a14 gP...&........z.
000000e0: 82ce bf39 6750 06ce 1826 94fc d101 f4ce ...9gP...&......
000000f0: 6abf 4a82 82ce bf39 6750 07ce 1826 94fc j.J....9gP...&..
00000100: d102 58ce fa00 5713 82ce bf39 6750 08ce ..X...W....9gP..
00000110: 1826 94fc d102 bcce 8d07 6785 82ce bf39 .&........g....9
00000120: 6750 09ce 1826 94fc d103 20ce a15d 25e1 gP...&.... ..]%.
00000130: 82ce bf39 6750 0ace 1826 94fc d103 84ce ...9gP...&......
00000140: d65a 1577 82ce bf39 6750 0bce 1826 94fc .Z.w...9gP...&..
00000150: d103 e800 0000 0000 ........
All of them begins in the same way with a value in the first byte followed by 3 bytes of 0s and then the file name.
Attempts
- I used signsrch suggested by this answer but found 0 signatures.
- I played around with Burp suite decoder, but the output is equally messed up. The smart decode didn't give any output.
- I also found this collection of compression algorithms. Some of them share the characteristic of having some of the data uncompressed like the lzo1x, but none of them seems to have the same amount of special characters. Does this mean there's a layer of obfuscation involved?
If anyone recognises what this is or can point me in the right direction, then I am all ears. Please let me know if there is any more information I can provide to help guide the process. I've tried to put in all the details I think are relevant, but I am new to file decryption and may miss some crucial hints.
Edit
- Opening the file correctly in the first place using a text editor that can handle binary data. [Reading 1] [Reading 2] [Reading 3]
- The files I got were exported from [Tool 1: DevXUnity] and seems to be different from how I see it on the hex viewer within the tool itself (the first hex dump in this question) just as blabb and w s pointed out. I've included a link to the other version of the first example json. [Reading 1] [Tool 2: UnityEX]
- Found some related scripts:
Scripts
Found Parser.Parse(json);
in Json.cs
and tried to mock it up on Unity but the result is incorrect.
Here're the scripts + json files in a shared gdrive.
Call stacks from when the JSON was first referenced:
battle_pvp_costTableAccessor::constructor()
TableAccessorCore::reset(filename="battle_pvp_cost.json", rootKey="battle_pvp_cost")
TableAccessorCore::reset(filename="battle_pvp_cost.json", rootKey="battle_pvp_cost", isResources=false)
// Branch 1
TableAccessor::get2(name="battle_pvp_cost.json")
TableAccessor::load2(name="battle_pvp_cost.json", isResources=false)
TableResources::load2(name="battle_pvp_cost.json", isResources=false)
TableResources::loadTextAssetFormTableAssets(filename="battle_pvp_cost.json")
TextAsset::ContainsAndLoadU5S("battle_pvp_cost.json")(?)
// Branch 2
Handle::getTable(key="battle_pvp_cost")
uint key2 = CRC32.Compute(str="battle_pvp_cost")
ParameterTableProxy::ParameterTable_table(handle=this.Ptr(?), key=key2)
battle_pvp_cost.json
to the question.