ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Wed May 23, 2018 3:01 pm

All times are UTC




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Mon Feb 12, 2018 9:44 pm 
User avatar

Joined: Sun Aug 17, 2014 7:27 pm
Posts: 1046
Game: http://store.steampowered.com/app/49514 ... inja_STORM
Image

Someone tool to decrypt EN files or export_import for all?


Attachments:
.exe.rar [2.98 MiB]
Downloaded 50 times
[PC] EN encrypted.rar [349.62 KiB]
Downloaded 49 times
[PC] CH decrypted.rar [196.53 KiB]
Downloaded 64 times
[PS3] files.rar [207.63 KiB]
Downloaded 35 times
Top
   
PostPosted: Sun Feb 18, 2018 12:08 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 759
PseudoCode, a1 > Buffer, a2 > Size

Code:
__int64 __fastcall sub_140510790(__int64 a1, signed int a2)
{
  __int64 v3; // r10
  signed int v4; // edi
  signed int v5; // esi
  signed int v6; // ebp
  unsigned int v7; // ebx
  char *v8; // r9
  signed int v9; // er11
  int v10; // ecx
  __int64 v11; // rdx
  __int64 v12; // rax
  char v13; // cl
  unsigned int v15; // [rsp+20h]

  v3 = a1;
  v4 = 357500045;
  v5 = 45339085;
  v6 = 1134809849;
  v7 = 1635685890;
  if ( a2 > 0 )
  {
    v8 = (char *)&v15 - a1;
    do
    {
      v9 = a2;
      v10 = v4 ^ (v4 << 11);
      v4 = v5;
      v5 = v6;
      v6 = v7;
      v7 ^= v10 ^ ((v10 ^ (v7 >> 11)) >> 8);
      if ( a2 > 4 )
        v9 = 4;
      v15 = v7;
      v11 = v9;
      if ( v9 > 0 )
      {
        v12 = v3;
        do
        {
          v13 = v8[v12++];
          *(_BYTE *)(v12 - 1) ^= v13;
          --v11;
        }
        while ( v11 );
      }
      a2 -= v9;
      v3 += 4i64;
      v8 -= 4;
    }
    while ( a2 > 0 );
  }
  return 0i64;
}


Top
   
PostPosted: Sun Feb 18, 2018 7:21 pm 
User avatar

Joined: Sun Aug 17, 2014 7:27 pm
Posts: 1046
Welcome back Ekey! :) Can you write a utility?


Attachments:
File comment: [PC] EN encrypted
others .xfbin.rar [3.91 MiB]
Downloaded 25 times
Top
   
PostPosted: Mon Feb 19, 2018 9:36 am 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 759
Thanks :). The decrypted xfbin's of the PC version differs from the PS3 version. Seems they compressed. Anyway here test tool.
On files xflst works fine.

Code:
Usage:
xfbin_test menu.xfbin menu.xfbin.dec
xfbin_test menu.xfbin.dec menu.xfbin


Example > option_button00.xflst

Code:
<?xml version="1.0" ?>
<xflst>
  <xfbin name="option_button.xfbin">
Z:\char\x\option\max\steam\option_button00.mdl.xfbin
Z:\char\x\option\tex\steam\option_button03_win.tex.xfbin
Z:\char\x\option\anm\steam\option_button00.anm.xfbin
</xfbin>
<xflst>
</xflst>


Attachments:
xfbin_test.rar [35.41 KiB]
Downloaded 45 times
Top
   
PostPosted: Fri Feb 23, 2018 4:51 pm 
User avatar

Joined: Sun Aug 17, 2014 7:27 pm
Posts: 1046
Thanks a lot Ekey! Double compression? Maybe footer this a header (Confusing encryption CRILAYLA)?

Image


Attachments:
dec and original [PC].rar [642.93 KiB]
Downloaded 22 times
Top
   
PostPosted: Wed Feb 28, 2018 1:04 am 

Joined: Sun Aug 17, 2014 5:50 pm
Posts: 3
This should work, didn't test it on all archives, no errors so far.
Attachment:
CC2_CPK_Decrypter.bms [2.02 KiB]
Downloaded 51 times

Code:
# CyberConnect2 CPK archives
# NARUTO SHIPPUDEN: Ultimate Ninja STORM 1,2,3_HD,4
comtype cpk
idstring "CPK "

endian big
set POS long 0x818
goto POS
get ROFF long
get SOFF long
goto 0x82C
get FILES long
xmath TMP "POS + SOFF"
math POS + ROFF
goto POS

if ROFF == 0x3F
  for i = 0 < FILES
   get PATHOFF long
   callfunction CC2_CPK_Encryption
  next i
else
  set PATHOFF long 0x1A
  for i = 0 < FILES
   callfunction CC2_CPK_Encryption
  next i
endif
 
startfunction CC2_CPK_Encryption
 get NAMEOFF long
 get SIZE long
 get ESIZE long
 get OFFSET longlong
 get DUMMY long
 savepos POS
 math OFFSET + 0x800
 goto OFFSET
 log MEMORY_FILE OFFSET SIZE
 
 get HDR long
 if HDR == 0x8FCF3140 || HDR == 0xF0A20061 || HDR == 0x45CD364B || HDR == 0x82C83B4F

 endian little
 
 set KEY1 long 0x617E9602
 set KEY2 long 0x154F048D
 set KEY3 long 0x154F048D
 set KEY4 long 0x617E9602
 set KEY5 long 0x02B3D1CD
 set KEY6 long 0x43A3D2F9
 
 math XSIZE = SIZE
 
 for j = 0 < SIZE
    math KEY1 u>> 0xB
    math KEY2 u<< 0xB
    math KEY2 & 0xFFFFFFFF
    math KEY2 ^ KEY3
    math KEY3 = KEY5
    math KEY5 = KEY6
    math KEY1 ^ KEY2
    math KEY6 = KEY4
    math KEY1 u>> 0x8
    math KEY4 ^ KEY1
    math KEY4 ^ KEY2
   
   if XSIZE > 4
    math XSIZE - 4
    getvarchr KEYX MEMORY_FILE j long
    math KEYX ^ KEY4
    putvarchr MEMORY_FILE j KEYX long
   else
    for k = 0 < XSIZE
      getvarchr KEYX MEMORY_FILE j byte
      math TMPK = KEY4
      math TMPK & 0xFF
      math KEYX ^ TMPK
      math KEYX & 0xFF
      math KEY4 u>> 0x8
      putvarchr MEMORY_FILE j KEYX byte
      math j + 1
    next k
   endif
   
    math KEY1 = KEY4
    math KEY2 = KEY3
 next j + 4
 endif

 math PATHOFF + TMP
 goto PATHOFF
 getct DirName string 0
 math NAMEOFF + TMP
 goto NAMEOFF
 getct NAME string 0
 
 string DirName += /
 string DirName += NAME

 if ESIZE > SIZE
   clog DirName 0 SIZE ESIZE MEMORY_FILE
 else
   log DirName 0 SIZE MEMORY_FILE
 endif
 
 endian big
 goto POS
endfunction


Top
   
PostPosted: Thu Mar 01, 2018 1:35 am 
User avatar

Joined: Sun Aug 17, 2014 7:27 pm
Posts: 1046
Awesome! Thanks a lot ssh!

Someone tool export/import .xfbin files and encryption back?
Image


Attachments:
xfbin files [PC].rar [1.08 MiB]
Downloaded 32 times
Top
   
PostPosted: Sat Mar 03, 2018 4:34 am 

Joined: Fri Nov 21, 2014 4:03 am
Posts: 327
I already told you that re-encryption does not need for translation patch as far as I remember.

2018.1.12 test
https://blog.naver.com/physics1114/221183270533


Top
   
PostPosted: Sat Mar 03, 2018 7:27 am 

Joined: Fri Nov 21, 2014 4:03 am
Posts: 327
Here is my export Tools. (I already sent it to you through private message on ZoG)
I already made it 2 months ago and Storm 1 Korean translation is almost finished..
But these days I'm busy with my jobs so I don't have enough time to make import tools.

naruto1_export.au3 works on itemtext.bin.xfbin, message.bin.xfbin, message_btl.bin.xfbin
TelopBin_export.au3 works on dioramaTelopBin.xfbin, iaTelopBin.xfbin, movieTelopBin.xfbin, spSkillTelopBin.xfbin

By the way, MissionInfo.bin.xfbin is a mess. My tool only works on PS3 JPN. But it will reads on PC.
For make export tool for PC(MissionInfo.bin), one have to change my source code.


Attachments:
Export Tools.zip [38.71 KiB]
Downloaded 54 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited