Gundam Battle: Gunpla Warfare .arc (Android)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
ral7b
Posts: 2
Joined: Wed Sep 25, 2019 5:15 pm

Gundam Battle: Gunpla Warfare .arc (Android)

Post by ral7b »

Play Store:
https://play.google.com/store/apps/deta ... oent.gb_en

Hi, I need help with extracting models from this game. I've tried other scripts sadly none of them can open the .arc file :oops:

Sample:
https://mega.nz/#!TBhUQAaY!3i91OSXytyX5 ... bgl5O3Om1k
Last edited by ral7b on Sat Sep 28, 2019 3:55 am, edited 2 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Gundam Battle Gunpla Warfare .arc (Android)

Post by aluigi »

The DFL file only contains the list of files in the archive folder.
The arc files are archives, "ARCC" header, but their content seems obfuscated probably with blowfish.
Don't have ways to know key/algorithm without working on the game (I can't now).
09williamsad
Posts: 16
Joined: Sun Dec 22, 2019 3:28 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by 09williamsad »

More samples https://mega.nz/#F!PT4wnIja!w1qy0KrBcqI2w9u0ubiueg

Additionally I looked for audio files, there are voices and music files which were just renamed oggs https://mega.nz/#F!ePxixA6S!melMgMO4Q1jQiCIXtN0IhA
Could not find any sound effects so I think they are in the arc archives.
ral7b
Posts: 2
Joined: Wed Sep 25, 2019 5:15 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by ral7b »

the ch folder might contain the mobile suits since the game wiki has pics of each suit & the image has the same file name as the files in ch folder.

i like the shop & mission bgm. thanks for uploading them
Pentium
Posts: 9
Joined: Wed Aug 28, 2019 1:34 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by Pentium »

Can someone look at this game now?

Here some fresh .arc samples
https://drive.google.com/file/d/1CgssdS ... sp=sharing

I also have almost all files uploaded as a folder
https://drive.google.com/drive/folders/ ... sp=sharing
Pentium
Posts: 9
Joined: Wed Aug 28, 2019 1:34 pm

Re: Gundam Battle Gunpla Warfare .arc (Android)

Post by Pentium »

aluigi wrote:The DFL file only contains the list of files in the archive folder.
The arc files are archives, "ARCC" header, but their content seems obfuscated probably with blowfish.
Don't have ways to know key/algorithm without working on the game (I can't now).

Can you please look at this now? Or at least put in plans for the future? =)
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by chrrox »

Possible code for blowfish.
https://pastebin.com/JpMQy4DA

Code: Select all

/* rJson::load(MtStream&) */

bool __thiscall rJson::load(rJson *this,MtStream *param_1)

{
  uint uVar1;
  uchar *puVar2;
  uchar *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  bool bVar7;
  MtDataReader aMStack1240 [24];
  MtMemoryStream aMStack1216 [24];
  MtDataReader aMStack1192 [4];
  int *local_4a4;
  MtDataWriter aMStack1168 [808];
  MtCipher aMStack360 [320];
  int iStack40;
 
  iStack40 = (int)__stack_chk_guard;
  MtDataReader::MtDataReader(aMStack1192,param_1,0x1000);
  uVar1 = (**(code **)(*local_4a4 + 0x48))();
  puVar2 = (uchar *)(**(code **)(**(int **)(MtMemory::mpInstance + 0x128) + 0x1c))
                              (*(int **)(MtMemory::mpInstance + 0x128),uVar1,0x10);
  puVar3 = (uchar *)(**(code **)(**(int **)(MtMemory::mpInstance + 0x128) + 0x1c))
                              (*(int **)(MtMemory::mpInstance + 0x128),uVar1 + 0x400,0x10);
  MtDataReader::read(aMStack1192,puVar2,uVar1);
  MtCipher::MtCipher(aMStack360);
  MtCipher::setKeyString(aMStack360,"VMmpt7L9vQE8");
  MtCipher::initializeBF(aMStack360);
  MtCipher::decryptBF(aMStack360,puVar2,puVar3,uVar1);
  MtMemoryStream::MtMemoryStream(aMStack1216,puVar3,uVar1,3);
  MtDataReader::MtDataReader(aMStack1240,(MtStream *)aMStack1216,0x1000);
  iVar4 = MtDataReader::readU32(aMStack1240);
  iVar5 = MtDataReader::readU32(aMStack1240);
  MtDataReader::readU32(aMStack1240);
  if (iVar4 == 0x4e4f534a) {
    MtDataWriter::MtDataWriter(aMStack1168,(MtStream *)aMStack1216,uVar1,0x1000);
    *(undefined4 *)(puVar3 + 4) = 0;
    iVar4 = MtCRC::getCRC(puVar3,uVar1,0xffffffff);
    if (iVar4 != iVar5) {
      MtDebug::crashLog((MtDebug *)MtDebug::mInstance,
                                               
                        "C:\\app\\jenkins\\workspace\\guns_android_na\\BNE\\client\\App\\AndroidGUNSBoot\\guns\\src\\resource\\json\\rJson.cpp"
                        ,0x9d,"E",&DAT_01380819);
    }
    else {
      iVar6 = MtDataReader::getPosition(aMStack1240);
      MtString::operator=((MtString *)(this + 0xa0),(char *)(puVar3 + iVar6));
      (**(code **)(**(int **)(MtMemory::mpInstance + 0x128) + 0x28))
                (*(int **)(MtMemory::mpInstance + 0x128),puVar2);
      (**(code **)(**(int **)(MtMemory::mpInstance + 0x128) + 0x28))
                (*(int **)(MtMemory::mpInstance + 0x128),puVar3);
    }
    bVar7 = iVar4 == iVar5;
    MtDataWriter::~MtDataWriter(aMStack1168);
  }
  else {
    MtDebug::crashLog((MtDebug *)MtDebug::mInstance,
                                           
                      "C:\\app\\jenkins\\workspace\\guns_android_na\\BNE\\client\\App\\AndroidGUNSBoot\\guns\\src\\resource\\json\\rJson.cpp"
                      ,0x93,"E",&DAT_013807e1);
    bVar7 = false;
  }
  MtDataReader::~MtDataReader(aMStack1240);
  MtMemoryStream::~MtMemoryStream(aMStack1216);
  MtCipher::~MtCipher(aMStack360);
  MtDataReader::~MtDataReader(aMStack1192);
  if ((int)__stack_chk_guard != iStack40) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return bVar7;
}



Code: Select all

/* MtCipher::MtCipher() */

MtCipher * __thiscall MtCipher::MtCipher(MtCipher *this)

{
  undefined4 uVar1;
  MtBigInt *this_00;
  MtBigInt *this_01;
  MtBigInt aMStack232 [64];
  MtBigInt aMStack168 [64];
  MtBigInt aMStack104 [68];
  int local_24;
 
  this_01 = (MtBigInt *)(this + 0xc);
  local_24 = (int)__stack_chk_guard;
  this_00 = (MtBigInt *)(this + 0x4c);
  *(undefined ***)this = &PTR_~MtCipher_01526180;
  MtBigInt::MtBigInt(this_01);
  MtBigInt::MtBigInt(this_00);
  MtBigInt::MtBigInt((MtBigInt *)(this + 0x8c));
  MtBigInt::MtBigInt((MtBigInt *)(this + 0xcc));
  setKeyString(this,"mofumofu capcom(^-^)");
  MtBigInt::MtBigInt(aMStack104,"0x0001bed0dbf11fc0420c3d83");
  __aeabi_memcpy(this_01,aMStack104,0x40);
  MtBigInt::MtBigInt(aMStack104,"0x000064aa206d48ff5be4a9c3");
  __aeabi_memcpy(this_00,aMStack104,0x40);
  MtBigInt::MtBigInt(aMStack104,"0x00026063");
  __aeabi_memcpy((MtBigInt *)(this + 0xcc),aMStack104,0x40);
  MtBigInt::MtBigInt(aMStack168,this_00);
  MtBigInt::operator*(aMStack104,SUB41(this_01,0));
  __aeabi_memcpy((MtBigInt *)(this + 0x8c),aMStack104,0x40);
  MtBigInt::MtBigInt(aMStack232,this_00);
  MtBigInt::operator*(aMStack104,SUB41(this_01,0));
  uVar1 = MtBigInt::getUsedByteSize(aMStack104);
  *(undefined4 *)(this + 0x10c) = uVar1;
  *(undefined4 *)(this + 0x110) = 0;
  *(undefined4 *)(this + 0x114) = 0;
  if ((int)__stack_chk_guard != local_24) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return this;
}
Last edited by chrrox on Wed Dec 02, 2020 12:41 pm, edited 1 time in total.
Pentium
Posts: 9
Joined: Wed Aug 28, 2019 1:34 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by Pentium »

chrrox wrote:Possible code for blowfish.
[/code]

One guy actually told me, that this could be xored encrypted
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by chrrox »

You can try following this code
https://gitlab.com/svanheulen/mhff/-/bl ... ds/arcc.py
or info on this post
viewtopic.php?t=1684


Code: Select all

cQuickSortFilter * __thiscall cQuickSortFilter::cQuickSortFilter(cQuickSortFilter *this)

{
  undefined4 *puVar1;
  int iVar2;
 
  cQuickSavedata::cQuickSavedata((cQuickSavedata *)this,"PCr7RXW09R2rRmDy",10);
  iVar2 = 0x27;
  puVar1 = (undefined4 *)(this + 0x10);
  *(undefined ***)this = &PTR_~cQuickSortFilter_014eba34;
  do {
    puVar1[-1] = &PTR_~FilterData_014eba84;
    *puVar1 = 0;
    puVar1[1] = 0;
    puVar1[2] = &PTR_~MtObject_014ebab0;
    __aeabi_memclr4(puVar1 + 3,0x6c);
    iVar2 = iVar2 + -1;
    puVar1 = puVar1 + 0x1f;
  } while (iVar2 != 0);
  initDefaultSort(this);
  initDefaultFilter(this);
  *(uint *)(this + 0x98) = *(uint *)(this + 0x98) | 1;
  *(uint *)(this + 0x114) = *(uint *)(this + 0x114) | 1;
  *(uint *)(this + 0x950) = *(uint *)(this + 0x950) | 1;
  cQuickSavedata::load((cQuickSavedata *)this);
  return this;
}


cQuickSortFilter * __thiscall cQuickSortFilter::cQuickSortFilter(cQuickSortFilter *this)

{
  undefined4 *puVar1;
  int iVar2;
 
  cQuickSavedata::cQuickSavedata((cQuickSavedata *)this,"PCr7RXW09R2rRmDy",10);
  iVar2 = 0x27;
  puVar1 = (undefined4 *)(this + 0x10);
  *(undefined ***)this = &PTR_~cQuickSortFilter_014eba34;
  do {
    puVar1[-1] = &PTR_~FilterData_014eba84;
    *puVar1 = 0;
    puVar1[1] = 0;
    puVar1[2] = &PTR_~MtObject_014ebab0;
    __aeabi_memclr4(puVar1 + 3,0x6c);
    iVar2 = iVar2 + -1;
    puVar1 = puVar1 + 0x1f;
  } while (iVar2 != 0);
  initDefaultSort(this);
  initDefaultFilter(this);
  *(uint *)(this + 0x98) = *(uint *)(this + 0x98) | 1;
  *(uint *)(this + 0x114) = *(uint *)(this + 0x114) | 1;
  *(uint *)(this + 0x950) = *(uint *)(this + 0x950) | 1;
  cQuickSavedata::load((cQuickSavedata *)this);
  return this;
}
Pentium
Posts: 9
Joined: Wed Aug 28, 2019 1:34 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by Pentium »

chrrox wrote:You can try following this code
https://gitlab.com/svanheulen/mhff/-/bl ... ds/arcc.py
or info on this post
viewtopic.php?t=1684

̶I̶'̶m̶ ̶a̶ ̶n̶o̶o̶b̶ ̶l̶i̶k̶e̶ ̶a̶ ̶c̶o̶o̶k̶ ̶w̶h̶o̶ ̶i̶s̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶a̶s̶s̶e̶m̶b̶l̶e̶ ̶a̶ ̶n̶u̶c̶l̶e̶a̶r̶ ̶r̶e̶a̶c̶t̶o̶r̶,̶ ̶c̶a̶n̶ ̶y̶o̶u̶ ̶e̶x̶p̶l̶a̶i̶n̶ ̶i̶n̶ ̶m̶o̶r̶e̶ ̶d̶e̶t̶a̶i̶l̶ ̶w̶h̶a̶t̶ ̶n̶e̶e̶d̶s̶ ̶t̶o̶ ̶b̶e̶ ̶d̶o̶n̶e̶ ̶w̶i̶t̶h̶ ̶t̶h̶i̶s̶,̶ ̶i̶f̶ ̶i̶t̶'̶s̶ ̶n̶o̶t̶ ̶d̶i̶f̶f̶i̶c̶u̶l̶t̶ ̶f̶o̶r̶ ̶y̶o̶u̶?̶ ̶I̶ ̶u̶n̶d̶e̶r̶s̶t̶a̶n̶d̶ ̶a̶b̶o̶u̶t̶ ̶m̶t̶m̶o̶b̶i̶l̶e̶-̶t̶o̶o̶l̶s̶ ̶a̶n̶d̶ ̶ ̶a̶r̶c̶c̶.̶p̶y̶,̶ ̶b̶u̶t̶ ̶d̶o̶n̶'̶t̶ ̶k̶n̶o̶w̶ ̶h̶o̶w̶ ̶t̶o̶ ̶r̶u̶n̶ ̶t̶h̶e̶m̶.̶

Edit. Maybe I'm completely noob, but I think tools and scripts for capcom .arc are not suitable for banco .arc
Pentium
Posts: 9
Joined: Wed Aug 28, 2019 1:34 pm

Re: Gundam Battle: Gunpla Warfare .arc (Android)

Post by Pentium »

Well, game have same engine as kamen rider city wars, and according to this thread viewtopic.php?t=5153 it is impossible to extract.
Gundam breaker btw have ARC archives, instead of using zips with nonextractable models.
Maybe they used archives with blowfish instead of nonextractable models to simplify work for developers to update the game, I don't know.
For now I lost all motivation, good luck to those who will try to encript this. I'll keep the files on gdrive.