-
Notifications
You must be signed in to change notification settings - Fork 7
/
MHStories2ARCRepack.py
650 lines (630 loc) · 30.2 KB
/
MHStories2ARCRepack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
import zlib
from pathlib import Path
import os
import struct
import sys
from Crypto.Cipher import Blowfish
fileExts = dict()
key = b"QZHaM;-5:)dV#"
cipher = Blowfish.new(key,Blowfish.MODE_ECB)
def writeUShort(file,val):
file.write(struct.pack("H",val))
def writeUIntToByteArray(array,val):
array.extend(struct.pack("I",val))
def jamcrc(string):
return (zlib.crc32(str(string).encode()) ^ 0xffffffff) & 0x7fffffff
def padToECB(array):
while (len(array) % Blowfish.block_size) != 0:
array.extend([0x00])
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
def endianness_reversal(data):
return b''.join(map(lambda x: x[::-1],chunks(data, 4)))
#there are problems with this approach, but it should work for now
fileExts[".btb"] = jamcrc("rBattleBinary")
fileExts[".bccmd"] = jamcrc("rBattleCutCmdData")
fileExts[".bsset"] = jamcrc("rBattleSelectSetData")
fileExts[".afpd"] = jamcrc("rAgingFieldPatrolDataNative")
fileExts[".cut"] = jamcrc("rTalkDemoCut")
fileExts[".tsnd"] = jamcrc("rTalkDemoSound")
fileExts[".work"] = jamcrc("rTalkDemoWorkOriginInfo")
fileExts[".pos"] = jamcrc("rTalkDemoObjInitPos")
fileExts[".fedad"] = jamcrc("rFieldEnemyDefaultAifsmDataNaitive")
fileExts[".fci"] = jamcrc("rFieldConnectionInfoNative")
fileExts[".fpi"] = jamcrc("rFieldPartsInfoNative")
fileExts[".fpl"] = jamcrc("rFieldPartsLayoutNative")
fileExts[".ts"] = jamcrc("rTraceSonarNative")
fileExts[".fpos"] = jamcrc("rFieldPlacementObjectSetNative")
fileExts[".fco"] = jamcrc("rFieldCamOption")
fileExts[".dai"] = jamcrc("rDungeonInfoListNative")
fileExts[".fntl"] = jamcrc("rFieldNpcNekoTaxiList")
fileExts[".fol"] = jamcrc("rFieldObjectList")
fileExts[".fcr"] = jamcrc("rFieldCamera")
fileExts[".occ2"] = jamcrc("rOccluder2Native")
fileExts[".idd"] = jamcrc("rInstanceDrawDistance")
fileExts[".idcol"] = jamcrc("rIDColor")
fileExts[".ipr"] = jamcrc("rInstancePlacement")
fileExts[".pmc"] = jamcrc("rPlayerMoveConfigData")
fileExts[".sgs"] = jamcrc("rSoundGuiSe")
fileExts[".spoc"] = jamcrc("rSoundParamOffsetControl")
fileExts[".pts"] = jamcrc("rSoundPelTiedSe")
fileExts[".sar"] = jamcrc("rSoundAreaReverb")
fileExts[".sss"] = jamcrc("rSoundSystemSetting")
fileExts[".sptl"] = jamcrc("rSoundPronounceList")
fileExts[".ejpd"] = jamcrc("rEnaJoinProgressDataNative")
fileExts[".klpd"] = jamcrc("rKizunaLvProgressDataNative")
fileExts[".rjpd"] = jamcrc("rReusJoinProgressDataNative")
fileExts[".fdi"] = jamcrc("rFieldDirectionInfoNative")
fileExts[".abbt"] = jamcrc("rAgingBtlBuddyTableNative")
fileExts[".abest"] = jamcrc("rAgingBtlEnemySetTableNative")
fileExts[".abst"] = jamcrc("rAgingBtlStageTableNative")
fileExts[".acb"] = jamcrc("rAgingCheckBuddyNative")
fileExts[".acela"] = jamcrc("rAgingCheckEnaLayArmorNative")
fileExts[".acna"] = jamcrc("rAgingCheckNaviAccesoryNative")
fileExts[".acpa"] = jamcrc("rAgingCheckPlArmorNative")
fileExts[".acwp"] = jamcrc("rAgingCheckWeaponNative")
fileExts[".aft"] = jamcrc("rAgingFieldTableNative")
fileExts[".cctib"] = jamcrc("rCheatCheckTableItemBattleNative")
fileExts[".cctbw"] = jamcrc("rCheatCheckTableWeaponBowNative")
fileExts[".cctgn"] = jamcrc("rCheatCheckTableWeaponGunNative")
fileExts[".bdkc"] = jamcrc("rDoubleKizunaCameraOffsetNative")
fileExts[".bdkmc"] = jamcrc("rDoubleKizunaMonsterConditionNative")
fileExts[".bdkm"] = jamcrc("rDoubleKizunaMonsterOffsetNative")
fileExts[".bdkd"] = jamcrc("rDoubleKizunaSchedulerPathNative")
fileExts[".acdd"] = jamcrc("rActionCommandDelayTimeDataNative")
fileExts[".asp"] = jamcrc("rAnimationSecondParamNative")
fileExts[".cdi"] = jamcrc("rGuiClearedDungeonItemParamNative")
fileExts[".gcol"] = jamcrc("rGuiColorDataNative")
fileExts[".gfad"] = jamcrc("rGuiFadeDataNative")
fileExts[".ghbp"] = jamcrc("rGuiHatchBabyParamNative")
fileExts[".gmdc"] = jamcrc("rGuiModelDrawCameraParamNative")
fileExts[".gmdw"] = jamcrc("rGuiModelDrawWindowParamNative")
fileExts[".gmmp"] = jamcrc("rGuiMonsterModelParamNative")
fileExts[".gmvp"] = jamcrc("rGuiMultiVsPlayerParamNative")
fileExts[".gnpc"] = jamcrc("rGuiNpcModelParamNative")
fileExts[".gpm"] = jamcrc("rGuiParamNative")
fileExts[".grcb"] = jamcrc("rGuiRiderCardBuddyParamNative")
fileExts[".gspp"] = jamcrc("rGuiStatusPlayerParamNative")
fileExts[".gtbp"] = jamcrc("rGuiTraditionBuddyParamNative")
fileExts[".gwmp"] = jamcrc("rGuiWeaponModelParamNative")
fileExts[".aic"] = jamcrc("rAchievementIconNative")
fileExts[".cic"] = jamcrc("rCommandIconNative")
fileExts[".isd"] = jamcrc("rIconStatusDataNative")
fileExts[".iic"] = jamcrc("rItemIconNative")
fileExts[".mic"] = jamcrc("rMonsterIconNative")
fileExts[".sic"] = jamcrc("rSkillIconNative")
fileExts[".drmd"] = jamcrc("rDramaMessageDataNative")
fileExts[".fcmd"] = jamcrc("rFieldCommonMessageDataNative")
fileExts[".grmd"] = jamcrc("rGameMessageDataNative")
fileExts[".ntlkd"] = jamcrc("rNpcMessageDataNative")
fileExts[".tlkd"] = jamcrc("rTalkMessageDataNative")
fileExts[".okbd"] = jamcrc("rOptionKeyConfigButtonDataNative")
fileExts[".okd"] = jamcrc("rOptionKeyConfigDataNative")
fileExts[".okkd"] = jamcrc("rOptionKeyConfigKeyboardDataNative")
fileExts[".lad"] = jamcrc("rOptionLanguageDataNative")
fileExts[".opd"] = jamcrc("rOptionParamDataNative")
fileExts[".osd"] = jamcrc("rOptionSettingDataNative")
fileExts[".agt"] = jamcrc("rAmiiboGiftNative")
fileExts[".bbcnd"] = jamcrc("rBattleBuddyConditionDataNative")
fileExts[".bccam"] = jamcrc("rBattleCmdCameraDataNative")
fileExts[".bcige"] = jamcrc("rBattleCmdIgnoreEnemyDataNative")
fileExts[".behi"] = jamcrc("rBattleEffHitInfoDataNative")
fileExts[".bemct"] = jamcrc("rBattleEnemyMCTblNative")
fileExts[".bert"] = jamcrc("rBattleEventResourceDataNative")
fileExts[".berd"] = jamcrc("rBattleEventResultDataNative")
fileExts[".bet"] = jamcrc("rBattleEventTblNative")
fileExts[".bmcd"] = jamcrc("rBattleMorphChangeDataNative")
fileExts[".bmcnd"] = jamcrc("rBattleMorphConditionDataNative")
fileExts[".bnft"] = jamcrc("rBattleNavirouFsmTableNative")
fileExts[".bnmt"] = jamcrc("rBattleNavirouMessageNative")
fileExts[".bnst"] = jamcrc("rBattleNavirouSetTableNative")
fileExts[".bnut"] = jamcrc("rBattleNavirouUniqueNative")
fileExts[".bptcnd"] = jamcrc("rBattlePartsConditionDataNative")
fileExts[".bcatData"] = jamcrc("rBCATAppDataNative")
fileExts[".bbc"] = jamcrc("rBingoBonusCategoryNative")
fileExts[".bfofd"] = jamcrc("rBreakFieldObjectDataNative")
fileExts[".bdbcm"] = jamcrc("rBuddyBtlMCDataNative")
fileExts[".chcl"] = jamcrc("rCharaCustomLogDataNative")
fileExts[".crd"] = jamcrc("rCharaRemakeTicketDataNative")
fileExts[".dgd"] = jamcrc("rDemoGalleryDataNative")
fileExts[".dcc"] = jamcrc("rDifficultyConvertCountNative")
fileExts[".dcgf"] = jamcrc("rDifficultyConvertGameFlagNative")
fileExts[".dlcData"] = jamcrc("rDLCAppDataNative")
fileExts[".dlcView"] = jamcrc("rDLCViewDataNative")
fileExts[".dclt"] = jamcrc("rDungeonChestLotTableNative")
fileExts[".dcd"] = jamcrc("rDungeonContainsDataNative")
fileExts[".dcp"] = jamcrc("rDungeonCreatePatternNative")
fileExts[".demd"] = jamcrc("rDungeonEggMonsterDataNative")
fileExts[".defd"] = jamcrc("rDungeonEnemyFixedDataNative")
fileExts[".deh"] = jamcrc("rDungeonEnemyHomingDataNative")
fileExts[".deloc"] = jamcrc("rDungeonEnemyLocatorDataNative")
fileExts[".deld"] = jamcrc("rDungeonEnemyLotDataNative")
fileExts[".dnrd"] = jamcrc("rDungeonNestRarenessDataNative")
fileExts[".eup"] = jamcrc("rEggUniquePatternDataNative")
fileExts[".ecr"] = jamcrc("rEnvCreatureDataNative")
fileExts[".exfd"] = jamcrc("rExpeditionFieldDataNative")
fileExts[".expl"] = jamcrc("rExpeditionPolicyDataNative")
fileExts[".esd"] = jamcrc("rExpeditionSlotNumDataNative")
fileExts[".fldamb"] = jamcrc("rFieldAmbientDataNative")
fileExts[".fpd"] = jamcrc("rFieldPartsDataNative")
fileExts[".fldpn"] = jamcrc("rFieldPartsNameDataNative")
fileExts[".fldsky"] = jamcrc("rFieldSkyDataNative")
fileExts[".flds"] = jamcrc("rFieldSpotDataNative")
fileExts[".fdcd"] = jamcrc("rFixedDungeonConfigDataNative")
fileExts[".fgt"] = jamcrc("rFortuneGiftNative")
fileExts[".grset"] = jamcrc("rGeneRandomSetNative")
fileExts[".tgb"] = jamcrc("rGiftBuddyTableNative")
fileExts[".tge"] = jamcrc("rGiftEggTableNative")
fileExts[".fnd"] = jamcrc("rGuiFontDataNative")
fileExts[".gfld"] = jamcrc("rGuiFontLanguageDataNative")
fileExts[".ltd"] = jamcrc("rGuiLocalizeTextureDataNative")
fileExts[".msgm"] = jamcrc("rGuiMessageDataNative")
fileExts[".gwm"] = jamcrc("rGuiWorldMapNative")
fileExts[".hbt"] = jamcrc("rHabitatDataNative")
fileExts[".hdu"] = jamcrc("rHardDungeonUIDataNative")
fileExts[".heb"] = jamcrc("rHatchEggBonusDataNative")
fileExts[".ecd"] = jamcrc("rEditCameraDataNative")
fileExts[".ecp"] = jamcrc("rEditColorPresetDataNative")
fileExts[".eed"] = jamcrc("rEditEyeShapeDataNative")
fileExts[".efd"] = jamcrc("rEditFaceShapeDataNative")
fileExts[".ehd"] = jamcrc("rEditHairstyleDataNative")
fileExts[".emad"] = jamcrc("rEditMakeupTypeDataNative")
fileExts[".emod"] = jamcrc("rEditMouthShapeDataNative")
fileExts[".epd"] = jamcrc("rEditParamDataNative")
fileExts[".evd"] = jamcrc("rEditVoiceTypeDataNative")
fileExts[".ldd"] = jamcrc("rLinkedDungeonDataNative")
fileExts[".macd"] = jamcrc("rMelynxShopAccessoryDataNative")
fileExts[".mard"] = jamcrc("rMelynxShopArmorDataNative")
fileExts[".msp"] = jamcrc("rMelynxShopDataNative")
fileExts[".mwd"] = jamcrc("rMelynxShopWeaponDataNative")
fileExts[".mrnd"] = jamcrc("rMenuRiderNoteDataNative")
fileExts[".mtnscl"] = jamcrc("rModTextureNoScaleDataNative")
fileExts[".mas"] = jamcrc("rMonsterAdditionalShowTableNative")
fileExts[".mbi"] = jamcrc("rMonsterBaseInfoDataNative")
fileExts[".ses"] = jamcrc("rMHSoundEmitter")
fileExts[".mss"] = jamcrc("rMHSoundSequence")
fileExts[".aser"] = jamcrc("rSoundAttributeSe")
fileExts[".engr"] = jamcrc("rSoundEngine")
fileExts[".engr.xml"] = jamcrc("rSoundEngineXml")
fileExts[".egvr"] = jamcrc("rSoundEngineValue")
fileExts[".mser"] = jamcrc("rSoundMotionSe")
fileExts[".ssqr"] = jamcrc("rSoundSequenceSe")
fileExts[".sscr"] = jamcrc("rSoundSimpleCurve")
fileExts[".smxr.xml"] = jamcrc("rSoundSubMixerXml")
fileExts[".smxr"] = jamcrc("rSoundSubMixer")
fileExts[".smxr"] = jamcrc("uSoundSubMixer::CurrentSubMixer")
fileExts[".mpt"] = jamcrc("rMonsterPartsTableNative")
fileExts[".ngt"] = jamcrc("rNavirouGuideDataNative")
fileExts[".nft"] = jamcrc("rNpc2dFaceTexTableNative")
fileExts[".nasmd"] = jamcrc("rNpcAirouSetMotionDataNative")
fileExts[".nlad"] = jamcrc("rNpcLayeredArmorDataNative")
fileExts[".nsmd"] = jamcrc("rNpcSetMotionDataNative")
fileExts[".ntrp"] = jamcrc("rNpcTalkResourceDataNative")
fileExts[".ntz"] = jamcrc("rNpcTalkZoneNative")
fileExts[".pte"] = jamcrc("rPotEffectDataNative")
fileExts[".ptl"] = jamcrc("rPotLevelDataNative")
fileExts[".pto"] = jamcrc("rPotOfferingDataNative")
fileExts[".ptp"] = jamcrc("rPotPrayingDataNative")
fileExts[".tppcc"] = jamcrc("rPresetParamCharaCustomNative")
fileExts[".tppls"] = jamcrc("rPresetParamLearningSkillSetNative")
fileExts[".tppo"] = jamcrc("rPresetParamOtomonNative")
fileExts[".tppog"] = jamcrc("rPresetParamOtomonGeneNative")
fileExts[".rndr"] = jamcrc("rRiderNoteDataRushNative")
fileExts[".rst"] = jamcrc("rRideSkillTableNative")
fileExts[".skc"] = jamcrc("rSkillCalcNative")
fileExts[".wss"] = jamcrc("rSkillSetDataNative")
fileExts[".scd"] = jamcrc("rStableCapacityDataNative")
fileExts[".scf"] = jamcrc("rStatusChangeFlagsNative")
fileExts[".sdt"] = jamcrc("rStatusDataNative")
fileExts[".sqd"] = jamcrc("rStoryQuestDataNative")
fileExts[".sqdf"] = jamcrc("rStoryQuestDefineNative")
fileExts[".sqccd"] = jamcrc("rSubQuestConditionDataNative")
fileExts[".suqd"] = jamcrc("rSubQuestDataRenewNative")
fileExts[".svd"] = jamcrc("rSubQuestVeilDataNative")
fileExts[".sntt"] = jamcrc("rSubstituteNpcTblNative")
fileExts[".smr"] = jamcrc("rSummaryDataNative")
fileExts[".tdmspk"] = jamcrc("rTalkDemoDefineDataNative")
fileExts[".tcn"] = jamcrc("rTrialCleanNativeDataNative")
fileExts[".tad"] = jamcrc("rTutorialArrowDataNative")
fileExts[".tld"] = jamcrc("rTutorialLockDataNative")
fileExts[".vsitemset"] = jamcrc("rVsItemSetDataNative")
fileExts[".vsprize"] = jamcrc("rVsPrizeDataNative")
fileExts[".vsrule"] = jamcrc("rVsRuleDataNative")
fileExts[".sdc"] = jamcrc("rSoundDemoControlNative")
fileExts[".sdec"] = jamcrc("rSoundDemoEnvControlNative")
fileExts[".sdsc"] = jamcrc("rSoundDemoSeControlNative")
fileExts[".sgo"] = jamcrc("rSoundGuiOperationNative")
fileExts[".siet"] = jamcrc("rSoundInfoSeNative")
fileExts[".siets"] = jamcrc("rSoundInfoStreamNative")
fileExts[".samd"] = jamcrc("rSoundArchiveDataNative")
fileExts[".sad"] = jamcrc("rSoundArmorDataNative")
fileExts[".sbsd"] = jamcrc("rSoundBattleStageDataNative")
fileExts[".sbsdef"] = jamcrc("rSoundBattleStageDefineNative")
fileExts[".sbmd"] = jamcrc("rSoundBgmMonsterDataNative")
fileExts[".sftd"] = jamcrc("rSoundFootstepDataNative")
fileExts[".sfcbd"] = jamcrc("rSoundFSMCommandBgmDataNative")
fileExts[".sfcsd"] = jamcrc("rSoundFSMCommandSeDataNative")
fileExts[".smd"] = jamcrc("rSoundMonsterDataNative")
fileExts[".smed"] = jamcrc("rSoundMonsterEnvironmentalDataNative")
fileExts[".smkd"] = jamcrc("rSoundMonsterKizunaDataNative")
fileExts[".snad"] = jamcrc("rSoundNpcAirouDataNative")
fileExts[".snd"] = jamcrc("rSoundNpcDataNative")
fileExts[".sod"] = jamcrc("rSoundObjectDataNative")
fileExts[".ssv"] = jamcrc("rSoundSceneVolumeNative")
fileExts[".swd"] = jamcrc("rSoundWeaponDataNative")
fileExts[".snvpd"] = jamcrc("rSoundNpcVoicePathDataNative")
fileExts[".spvpd"] = jamcrc("rSoundPlayerVoicePathDataNative")
fileExts[".ulm"] = jamcrc("rUnlockMixDataNative")
fileExts[".ulp"] = jamcrc("rUnlockProgressDataNative")
fileExts[".uls"] = jamcrc("rUnlockScriptDataNative")
fileExts[".fpc"] = jamcrc("rFacialPartsComboNative")
fileExts[".fpctl"] = jamcrc("rFacialPartsControl")
fileExts[".omg"] = jamcrc("rObjectModelAttachGroupNative")
fileExts[".omi"] = jamcrc("rObjectModelAttachInfoNative")
fileExts[".omas"] = jamcrc("rObjectModelAttachSetData")
fileExts[".mlka"] = jamcrc("rMonsterLookAtParamNative")
fileExts[".kofb"] = jamcrc("rKizunaStoneOfsNative")
fileExts[".wko"] = jamcrc("rWeaponKindOfsNative")
fileExts[".tex"] = jamcrc("uSceneCapture::rCaptureTexture")
fileExts[".ext"] = jamcrc("cInstancingResource")
fileExts[".cctas"] = jamcrc("rCheatCheckTableAccSkillNative")
fileExts[".ccta"] = jamcrc("rCheatCheckTableArmorNative")
fileExts[".cctb"] = jamcrc("rCheatCheckTableBuddyNative")
fileExts[".cctbf"] = jamcrc("rCheatCheckTableBuddyFlagNative")
fileExts[".cctg"] = jamcrc("rCheatCheckTableGeneNative")
fileExts[".cctna"] = jamcrc("rCheatCheckTableNaviAccNative")
fileExts[".cctr"] = jamcrc("rCheatCheckTableRangeNative")
fileExts[".ccthm"] = jamcrc("rCheatCheckTableWeaponHamNative")
fileExts[".ccthu"] = jamcrc("rCheatCheckTableWeaponHueNative")
fileExts[".cctwo"] = jamcrc("rCheatCheckTableWeaponOneNative")
fileExts[".cctwt"] = jamcrc("rCheatCheckTableWeaponTwoNative")
fileExts[".badt"] = jamcrc("rBattleArenaDLCTableNative")
fileExts[".batt"] = jamcrc("rBattleArenaTrialTableNative")
fileExts[".bte"] = jamcrc("rBattleNaviTextEventNative")
fileExts[".bseff"] = jamcrc("rBattleStatusEffectNative")
fileExts[".bvspp"] = jamcrc("rBattleVsPorchPresetNative")
fileExts[".ditemp"] = jamcrc("rDLCItemTableNative")
fileExts[".dtnmt"] = jamcrc("rDLCRegionTnmntTableNative")
fileExts[".dsuqd"] = jamcrc("rDLCSubQuestDataNative")
fileExts[".dvsrule"] = jamcrc("rDLCVsRuleTableNative")
fileExts[".ecpd"] = jamcrc("rEnemyCameraParamNative")
fileExts[".lshpd"] = jamcrc("rLimitedShopDataNative")
fileExts[".lshppd"] = jamcrc("rLimitedShopPlaceDataNative")
fileExts[".lpd"] = jamcrc("rLinkPrizeDataNative")
fileExts[".mcr"] = jamcrc("rMedalCompRewardNative")
fileExts[".mectd"] = jamcrc("rMonsterEnumConversionTableNative")
fileExts[".nad"] = jamcrc("rNavirouAccessoryDataNative")
fileExts[".nstera"] = jamcrc("rNestEggReviewANative")
fileExts[".nsterb"] = jamcrc("rNestEggReviewBNative")
fileExts[".nstmsg"] = jamcrc("rNestMessageNative")
fileExts[".ocpd"] = jamcrc("rOtomonCameraParamNative")
fileExts[".pmrd"] = jamcrc("rPostmanRewardDataNative")
fileExts[".srcd"] = jamcrc("rStaffRollCutDataNative")
fileExts[".wmmd"] = jamcrc("rWorldMapMaskDataNative")
fileExts[".tdvs"] = jamcrc("rTalkDemoViewSpriteDataNative")
fileExts[".arp"] = jamcrc("rArmorParamNative")
fileExts[".dlc"] = jamcrc("rDLCTableNative")
fileExts[".mdl"] = jamcrc("rMedalDataListNative")
fileExts[".mbcd"] = jamcrc("rMyhouseBoxCameraDataNative")
fileExts[".stb"] = jamcrc("rStoryTalkBalloonNative")
fileExts[".wpp"] = jamcrc("rWeaponParamNative")
fileExts[".bef"] = jamcrc("rBattleEnemyFileNative")
fileExts[".cndp"] = jamcrc("rConditionPriorityDataNative")
fileExts[".ghlt"] = jamcrc("rGatherLevelTableNative")
fileExts[".lsnl"] = jamcrc("rLimitedShopNpcList")
fileExts[".mbd"] = jamcrc("rMonsterBookDataNative")
fileExts[".tpp"] = jamcrc("rPresetParamNative")
fileExts[".tppe"] = jamcrc("rPresetParamEquipNative")
fileExts[".tppi"] = jamcrc("rPresetParamItemNative")
fileExts[".tppp"] = jamcrc("rPresetParamPlayerNative")
fileExts[".skf"] = jamcrc("rSkillFlagNative")
fileExts[".dat"] = jamcrc("rAppMovie")
fileExts[".wmv"] = jamcrc("rAppMovieIntermediate")
fileExts[".cps"] = jamcrc("rCardPose")
fileExts[".rdp"] = jamcrc("rRideParamNative")
fileExts[".scl"] = jamcrc("rSequenceCameraList")
fileExts[".rnmd"] = jamcrc("rResourceNameForDevNative")
fileExts[".cfid"] = jamcrc("rChestItemTableDataNative")
fileExts[".gstd"] = jamcrc("rGatherSetTableDataNative")
fileExts[".fppar"] = jamcrc("rFldPlParam_ARNative")
fileExts[".fppgr"] = jamcrc("rFldPlParam_GRNative")
fileExts[".fppnr"] = jamcrc("rFldPlParam_NRNative")
fileExts[".fppwr"] = jamcrc("rFldPlParam_WRNative")
fileExts[".acd"] = jamcrc("rAccessoryDataNative")
fileExts[".acr"] = jamcrc("rAccessoryRareNative")
fileExts[".acs"] = jamcrc("rAccessorySkillNative")
fileExts[".ard"] = jamcrc("rArmorDataNative")
fileExts[".bat"] = jamcrc("rBattleArenaTableNative")
fileExts[".bcmr"] = jamcrc("rBattleCommonResourceNative")
fileExts[".bes"] = jamcrc("rBattleEnemySetNative")
fileExts[".bemt"] = jamcrc("rBattleEnemyTblNative")
fileExts[".bemtp"] = jamcrc("rBattleEnemyTblPlanNative")
fileExts[".bnt"] = jamcrc("rBattleNpcTblNative")
fileExts[".bplt"] = jamcrc("rBattlePlayerTblNative")
fileExts[".brsb"] = jamcrc("rBattleResultBonusNative")
fileExts[".bstr"] = jamcrc("rBattleStageResourceNative")
fileExts[".bwpt"] = jamcrc("rBattleWeaponTblNative")
fileExts[".bfd"] = jamcrc("rBroilerFlavorDataNative")
fileExts[".bdypa"] = jamcrc("rBuddyPathDataNative")
fileExts[".bdypl"] = jamcrc("rBuddyPlanDataNative")
fileExts[".sce"] = jamcrc("rCallingEncountDataNative")
fileExts[".cnd"] = jamcrc("rConditionNameDataNative")
fileExts[".dmd"] = jamcrc("rDemoDataNative")
fileExts[".dfd"] = jamcrc("rDemoFlagDataNative")
fileExts[".ebc"] = jamcrc("rEggBaseColorDataNative")
fileExts[".eepd"] = jamcrc("rEncntEnemyPartyNative")
fileExts[".eshd"] = jamcrc("rEquiprShopDataNative")
fileExts[".fasa"] = jamcrc("rFieldAISetActNative")
fileExts[".fask"] = jamcrc("rFieldAISetKindNative")
fileExts[".fedpa"] = jamcrc("rFieldEnemyPathDataNative")
fileExts[".fedpl"] = jamcrc("rFieldEnemyPlanDataNative")
fileExts[".fhd"] = jamcrc("rFieldHuntingDataNative")
fileExts[".fmpd"] = jamcrc("rFieldMotionPackageDataNative")
fileExts[".fnmd"] = jamcrc("rFieldNpcMotionNative")
fileExts[".fpm"] = jamcrc("rFieldPlayerMotionDataNative")
fileExts[".fsfd"] = jamcrc("rFieldSetFlagDataNative")
fileExts[".fofd"] = jamcrc("rFurattoFieldDataNative")
fileExts[".fotd"] = jamcrc("rFurattoTrendDataNative")
fileExts[".gfd"] = jamcrc("rGalleryFlagDataNative")
fileExts[".gcd"] = jamcrc("rGatherCommentDataNative")
fileExts[".ged"] = jamcrc("rGeneEditNative")
fileExts[".glt"] = jamcrc("rGeneLottingNative")
fileExts[".gcd"] = jamcrc("rGeneralCountDataNative")
fileExts[".gfd"] = jamcrc("rGeneralFlagDataNative")
fileExts[".gtb"] = jamcrc("rGeneTableNative")
fileExts[".itm"] = jamcrc("rItemDataNative")
fileExts[".mix"] = jamcrc("rItemMixNative")
fileExts[".mqsd"] = jamcrc("rMainQuestDataNative")
fileExts[".mmk"] = jamcrc("rMapMarkerNative")
fileExts[".mkr"] = jamcrc("rMarkerDataNative")
fileExts[".matd"] = jamcrc("rMaterialDataNative")
fileExts[".asd"] = jamcrc("rMergeStreamDataNative")
fileExts[".mxf"] = jamcrc("rMixFlagNative")
fileExts[".mrt"] = jamcrc("rMonsterRankTableNative")
fileExts[".nsd"] = jamcrc("rNekoTaxiStationDataNative")
fileExts[".nhap"] = jamcrc("rNestHappeningNative")
fileExts[".nhapp"] = jamcrc("rNestHappeningProbNative")
fileExts[".nasl"] = jamcrc("rNpcAirouSetResourceLogDataNative")
fileExts[".npsl"] = jamcrc("rNpcSetResourceLogDataNative")
fileExts[".rcd"] = jamcrc("rReactionCommentDataNative")
fileExts[".rnd"] = jamcrc("rRiderNoteDataNative")
fileExts[".rnld"] = jamcrc("rRiderNoteLargeCategoryDataNative")
fileExts[".rnpd"] = jamcrc("rRiderNotePageDataNative")
fileExts[".rnsd"] = jamcrc("rRiderNoteSmallCategoryDataNative")
fileExts[".rntd"] = jamcrc("rRiderNoteThumbnailDataNative")
fileExts[".sdm"] = jamcrc("rShortDemoDataNative")
fileExts[".skt"] = jamcrc("rSkillTableNative")
fileExts[".schd"] = jamcrc("rStChapDataNative")
fileExts[".sed"] = jamcrc("rStEpiDataNative")
fileExts[".scod"] = jamcrc("rStoryCountDataNative")
fileExts[".std"] = jamcrc("rStoryDataNative")
fileExts[".stfd"] = jamcrc("rStoryFlagDataNative")
fileExts[".spcd"] = jamcrc("rStPrComDataNative")
fileExts[".sqcd"] = jamcrc("rSubQuestCountDataNative")
fileExts[".sqfd"] = jamcrc("rSubQuestFlagDataNative")
fileExts[".ssed"] = jamcrc("rSubStEpiDataNative")
fileExts[".sycd"] = jamcrc("rSystemCountDataNative")
fileExts[".tdmact"] = jamcrc("rTalkDemoActorDataNative")
fileExts[".tdmcmd"] = jamcrc("rTalkDemoCommandDataNative")
fileExts[".tdmd"] = jamcrc("rTalkDemoDataNative")
fileExts[".tdmeff"] = jamcrc("rTalkDemoEffectDataNative")
fileExts[".tdmfc"] = jamcrc("rTalkDemoFaceDataNative")
fileExts[".tdmmot"] = jamcrc("rTalkDemoMotionDataNative")
fileExts[".tdmpos"] = jamcrc("rTalkDemoPoseDataNative")
fileExts[".tdms"] = jamcrc("rTalkDemoScript")
fileExts[".tid"] = jamcrc("rTalkInfoDataNative")
fileExts[".tmd"] = jamcrc("rTalkMsgDataNative")
fileExts[".tstd"] = jamcrc("rTalkSelectDataNative")
fileExts[".wpd"] = jamcrc("rWeaponDataNative")
fileExts[".fgd"] = jamcrc("rFieldGateDataNative")
fileExts[".fslm"] = jamcrc("rMHFSMList")
fileExts[".wpdt"] = jamcrc("rWipeData")
fileExts[".btat"] = jamcrc("rBattleAtkNative")
fileExts[".fbd"] = jamcrc("rFieldBuddyMotionDataNative")
fileExts[".fld"] = jamcrc("rFieldDataNative")
fileExts[".fesd"] = jamcrc("rFieldEnemySetDataNative")
fileExts[".fisd"] = jamcrc("rFieldIngredientSetDataNative")
fileExts[".fmd"] = jamcrc("rFieldMotionDataNative")
fileExts[".fosd"] = jamcrc("rFieldOrnamentSetDataNative")
fileExts[".fprd"] = jamcrc("rFieldPredatorDataNative")
fileExts[".fssd"] = jamcrc("rFieldSchedulerSetDataNative")
fileExts[".mrd"] = jamcrc("rMonsterRaceDataNative")
fileExts[".ntk"] = jamcrc("rNpcTalkNative")
fileExts[".shp"] = jamcrc("rShopDataNative")
fileExts[".sfd"] = jamcrc("rSystemFlagDataNative")
fileExts[".tlk"] = jamcrc("rTalkDataNative")
fileExts[".pec"] = jamcrc("rProofEffectColorControl")
fileExts[".pel"] = jamcrc("rProofEffectList")
fileExts[".psl"] = jamcrc("rProofEffectMotSequenceList")
fileExts[".pep"] = jamcrc("rProofEffectParamScript")
fileExts[".cmdt"] = jamcrc("rCameraData")
fileExts[".clc"] = jamcrc("rColorLinkColor")
fileExts[".cli"] = jamcrc("rColorLinkInfo")
fileExts[".ccinfo"] = jamcrc("rConditionChangeInfo")
fileExts[".dpd"] = jamcrc("rDollPartsDisp")
fileExts[".gar"] = jamcrc("rGroundAdjustment")
fileExts[".mea"] = jamcrc("rModelEasyAnime")
fileExts[".mip"] = jamcrc("rModelInPath")
fileExts[".mpd"] = jamcrc("rMonsterPartsDisp")
fileExts[".npd"] = jamcrc("rNavirouPartsDisp")
fileExts[".pvi"] = jamcrc("rPartsVisibleInfo")
fileExts[".spll"] = jamcrc("rSchedulerPreLoadList")
fileExts[".swp"] = jamcrc("rShadowParamNative")
fileExts[".vjr"] = jamcrc("rVirtualJoint")
fileExts[".wgi"] = jamcrc("rWeaponGimmickInfo")
fileExts[".wofb"] = jamcrc("rWeaponOfsForBodyNative")
fileExts[".ext"] = jamcrc("cResource")
fileExts[".mod"] = jamcrc("rModel")
fileExts[".lmt"] = jamcrc("rMotionList")
fileExts[".tex"] = jamcrc("rTexture")
fileExts[".sbc"] = jamcrc("rCollision")
fileExts[".gway"] = jamcrc("rAIWayPointGraph")
fileExts[".sdl"] = jamcrc("rScheduler")
fileExts[".arc"] = jamcrc("rArchive")
fileExts[".ctc"] = jamcrc("rCnsTinyChain")
fileExts[".chn"] = jamcrc("rChain")
fileExts[".ccl"] = jamcrc("rChainCol")
fileExts[".fsm"] = jamcrc("rAIFSM")
fileExts[".fsl"] = jamcrc("rAIFSMList")
fileExts[".cdt"] = jamcrc("rAIConditionTree")
fileExts[".lcm"] = jamcrc("rCameraList")
fileExts[".gui"] = jamcrc("rGUI")
fileExts[".rtex"] = jamcrc("rRenderTargetTexture")
fileExts[".e2d"] = jamcrc("rEffect2D")
fileExts[".gfd"] = jamcrc("rGUIFont")
fileExts[".gii"] = jamcrc("rGUIIconInfo")
fileExts[".gst"] = jamcrc("rGUIStyle")
fileExts[".gmd"] = jamcrc("rGUIMessage")
fileExts[".dwm"] = jamcrc("rDeformWeightMap")
fileExts[".swm"] = jamcrc("rSwingModel")
fileExts[".vib"] = jamcrc("rVibration")
fileExts[".srqr"] = jamcrc("rSoundRequest")
fileExts[".stqr"] = jamcrc("rSoundStreamRequest")
fileExts[".scsr"] = jamcrc("rSoundCurveSet")
fileExts[".sdsr"] = jamcrc("rSoundDirectionalSet")
fileExts[".equr"] = jamcrc("rSoundEQ")
fileExts[".revr"] = jamcrc("rSoundReverb")
fileExts[".scvr.xml"] = jamcrc("rSoundCurveXml")
fileExts[".sdcr.xml"] = jamcrc("rSoundDirectionalCurveXml")
fileExts[".sbkr"] = jamcrc("rSoundBank")
fileExts[".sprr"] = jamcrc("rSoundPhysicsRigidBody")
fileExts[".spsr"] = jamcrc("rSoundPhysicsSoftBody")
fileExts[".spjr"] = jamcrc("rSoundPhysicsJoint")
fileExts[".mfx"] = jamcrc("rShader2")
fileExts[".is"] = jamcrc("rImplicitSurface")
fileExts[".ext"] = jamcrc("rMovie")
fileExts[".mem.wmv"] = jamcrc("rMovieOnMemory")
fileExts[".wmvd"] = jamcrc("rMovieOnDisk")
fileExts[".mem.wmv"] = jamcrc("rMovieOnMemoryInterMediate")
fileExts[".wmvd"] = jamcrc("rMovieOnDiskInterMediate")
fileExts[".stex"] = jamcrc("rSceneTexture")
fileExts[".gr2"] = jamcrc("rGrass2")
fileExts[".gr2s"] = jamcrc("rGrass2Setting")
fileExts[".occ"] = jamcrc("rOccluder")
fileExts[".isc"] = jamcrc("rISC")
fileExts[".sky"] = jamcrc("rSky")
fileExts[".stc"] = jamcrc("rStarCatalog")
fileExts[".cld"] = jamcrc("rCloud")
fileExts[".ext"] = jamcrc("rSoundSourcePC")
fileExts[".xsew"] = jamcrc("rSoundSourceMSADPCM")
fileExts[".sngw"] = jamcrc("rSoundSourceOggVorbis")
fileExts[".efl"] = jamcrc("rEffectList")
fileExts[".sbch"] = jamcrc("rCollisionHeightField")
fileExts[".ik"] = jamcrc("rCnsIK")
fileExts[".spkg"] = jamcrc("rShaderPackage")
fileExts[".sch"] = jamcrc("rShaderCache")
fileExts[".mrl"] = jamcrc("rMaterial")
fileExts[".sssr.xml"] = jamcrc("rSoundSpeakerSetXml")
fileExts[".obc"] = jamcrc("rCollisionObj")
fileExts[".grs"] = jamcrc("rGrass")
fileExts[".ext"] = jamcrc("rConstraint")
fileExts[".lat"] = jamcrc("rCnsLookAt")
fileExts[".ean"] = jamcrc("rEffectAnim")
fileExts[".efs"] = jamcrc("rEffectStrip")
fileExts[".vts"] = jamcrc("rVertices")
fileExts[".nls"] = jamcrc("rNulls")
fileExts[".ais"] = jamcrc("rAI")
fileExts[".splr"] = jamcrc("rSoundPhysicsList")
fileExts[".fca"] = jamcrc("rFacialAnimation")
fileExts[".mst"] = jamcrc("rMetaSet")
fileExts[".mst.xml"] = jamcrc("rMetaSetXml")
fileExts[".tik"] = jamcrc("rCnsTinyIK")
fileExts[".scnl"] = jamcrc("rCnsScaleNormalize")
fileExts[".lim"] = jamcrc("rCnsRotateLimit")
fileExts[".mtx"] = jamcrc("rCnsMatrix")
fileExts[".jof"] = jamcrc("rCnsJointOffset")
fileExts[".par"] = jamcrc("rCnsParent")
fileExts[".pan"] = jamcrc("rCnsParentN")
fileExts[".eye"] = jamcrc("rCnsLookAtEyeball")
fileExts[".gpt"] = jamcrc("rGraphPatch")
fileExts[".grw"] = jamcrc("rGrassWind")
fileExts[".hul"] = jamcrc("rConvexHull")
fileExts[".geo2"] = jamcrc("rGeometry2")
fileExts[".geo3"] = jamcrc("rGeometry3")
fileExts[".srt"] = jamcrc("rSerial")
fileExts[".dsc"] = jamcrc("rDynamicSbc")
fileExts[".geog"] = jamcrc("rGeometry2Group")
def getExtension(hash):
if hash in fileExts:
return fileExts[hash]
else:
return int("0x"+hash.replace(".",""),16)
def exportString(array,string):
nullsize = 128 - len(string)
array.extend(string.encode('utf-8'))
for i in range(nullsize):
array.extend([0x00])
def appendArrayToOffset(array,offset):
while len(array) < offset:
array.extend([0x00])
class Entry:
def __init__(self,name,extHash,compSize,decompSize,buffer):
self.name = name
self.extHash = extHash
self.compSize = compSize
self.decompSize = decompSize
self.buffer = buffer
def setOffset(self, offset):
self.offset = offset
class LogEntry:
def __init__(self,path,index):
self.path = path
self.index = index
def writeArchive(importPath,outFile):
if not os.path.exists(importPath+"orderlog.txt"):
print("Log file not present!")
return 0
logfile = open(importPath+"orderlog.txt",'r')
logentries = []
lineIndex = 0
for line in logfile:
path = line.replace("\n","")
logentries.append(LogEntry(path,lineIndex))
lineIndex += 1
logfile.close()
fileCount = len(logentries)
outFile.write(b'ARCC') #just go ahead and write it out to the encrypted version
writeUShort(outFile,7)
writeUShort(outFile,fileCount)
fileDec = bytearray()
entries = []
for entry in logentries:
name = entry.path.split(".")
namePath = name[0]
extHash = getExtension("."+name[1])
print(namePath)
fullPath = importPath + "/" + entry.path
inFile = open(fullPath,'rb')
uBuffer = inFile.read()
decompSize = len(uBuffer)
buffer = zlib.compress(uBuffer)
buffer = bytearray(buffer)
while (len(buffer) % 8) != 0:
buffer.extend([0x00])
compSize = len(buffer)
entries.insert(entry.index,Entry(namePath,extHash,compSize,decompSize,buffer))
currentOff = (8 + (fileCount * 0x90)) + (32768- ((8 + (fileCount * 0x90)) % 32768 )) #basically, just make sure it's far from the header
startingOff = currentOff
for entry in entries:
exportString(fileDec,entry.name)
writeUIntToByteArray(fileDec,entry.extHash)
writeUIntToByteArray(fileDec,entry.compSize)
writeUIntToByteArray(fileDec, ((entry.decompSize) + 0x40000000))
writeUIntToByteArray(fileDec, currentOff)
entry.setOffset(currentOff)
currentOff += entry.compSize
#print(startingOff)
appendArrayToOffset(fileDec,startingOff-8) #8 bytes already present in the file
for entry in entries:
fileDec.extend(entry.buffer)
padToECB(fileDec)
fileEnc = bytearray()
fileEnc.extend(endianness_reversal(cipher.encrypt(endianness_reversal(fileDec))))
outFile.write(fileEnc)
outFile.close()
if __name__ == "__main__":
for i, arg in enumerate(sys.argv):
if i > 0:
writeArchive(arg+"/",open(os.path.dirname(arg)+"/"+os.path.basename(arg)+"-new.arc",'wb'))