Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -upr org/Source.cpp new/Source.cpp
- --- org/Source.cpp 2015-07-28 03:05:22.000000000 +0900
- +++ new/Source.cpp 2021-01-28 00:00:00.000000000 +0900
- @@ -82,6 +82,8 @@ int main(int argc,char *argv[]){
- // コマンドライン解析
- unsigned int count=0;
- char *filenameOut=NULL;
- + bool maskEnabled=true;
- + bool adxDecodeEnabled=true;
- unsigned int ciphKey1=0x207DFFFF;
- unsigned int ciphKey2=0x00B8F21B;
- for(int i=1;i<argc;i++){
- @@ -90,6 +92,8 @@ int main(int argc,char *argv[]){
- case 'o':if(i+1<argc){filenameOut=argv[++i];}break;
- case 'a':if(i+1<argc){ciphKey1=atoi16(argv[++i]);}break;
- case 'b':if(i+1<argc){ciphKey2=atoi16(argv[++i]);}break;
- + case 'd':if(i+1<argc){maskEnabled=false;}break;
- + case 'x':if(i+1<argc){adxDecodeEnabled=false;}break;
- }
- }else if(*argv[i]){
- argv[count++]=argv[i];
- @@ -122,8 +126,8 @@ int main(int argc,char *argv[]){
- printf("%s を分離中...\n",argv[i]);
- DirectoryCreate(filenameOut);
- - clCRID crid(ciphKey1,ciphKey2);
- - if(!crid.Demux(argv[i],filenameOut,true)){
- + clCRID crid(maskEnabled,ciphKey1,ciphKey2);
- + if(!crid.Demux(argv[i],filenameOut,adxDecodeEnabled)){
- printf("Error: 分離に失敗しました。\n");
- }
- diff -upr org/clCRID.cpp new/clCRID.cpp
- --- org/clCRID.cpp 2015-08-02 01:15:54.000000000 +0900
- +++ new/clCRID.cpp 2021-01-28 00:00:00.000000000 +0900
- @@ -61,8 +61,10 @@ char *FixFilename(char *fix_filename,int
- //--------------------------------------------------
- // コンストラクタ
- //--------------------------------------------------
- -clCRID::clCRID(unsigned int ciphKey1,unsigned int ciphKey2):_utf(){
- - InitMask(ciphKey1,ciphKey2);
- +clCRID::clCRID(bool maskEnabled,unsigned int ciphKey1,unsigned int ciphKey2):_utf(),_maskEnabled(maskEnabled){
- + if(maskEnabled){
- + InitMask(ciphKey1,ciphKey2);
- + }
- }
- //--------------------------------------------------
- @@ -197,7 +199,8 @@ bool clCRID::Demux(const char *filename,
- char ext[4];
- FixFilename(fix_filename,_countof(fix_filename),_utf.GetElement(i,"filename")->GetValueString());
- sprintf_s(filename,_countof(filename),"%s\\%s",directory,fix_filename);
- - if(strcmp(GetExtension(ext,_countof(ext),filename),"wav")!=0)strcat_s(filename,_countof(filename),".wav");
- + const char *desiredExt=adxDecode?".wav":".adx";
- + if(strcmp(GetExtension(ext,_countof(ext),filename),desiredExt+1)!=0)strcat_s(filename,_countof(filename),desiredExt);
- fopen_s(&fpAudio,filename,"wb");
- }
- break;
- @@ -214,7 +217,9 @@ bool clCRID::Demux(const char *filename,
- case 0x40534656://@SFV
- {
- if(info.dataType==0){
- - MaskVideo(data,size);
- + if(_maskEnabled){
- + MaskVideo(data,size);
- + }
- if(fpVideo)fwrite(data,size,1,fpVideo);
- }else if(info.dataType==1||info.dataType==3){
- clUTF utf;
- @@ -228,8 +233,16 @@ bool clCRID::Demux(const char *filename,
- case 0x40534641://@SFA
- {
- if(info.dataType==0){
- - MaskAudio(data,size);
- - if(fpAudio)adx.Decode(fpAudio,data,size,sfaAddress);
- + if(_maskEnabled){
- + MaskAudio(data,size);
- + }
- + if(fpAudio){
- + if(adxDecode){
- + adx.Decode(fpAudio,data,size,sfaAddress);
- + }else{
- + fwrite(data,size,1,fpAudio);
- + }
- + }
- sfaAddress+=size;
- }else if(info.dataType==1||info.dataType==3){
- clUTF utf;
- diff -upr org/clCRID.h new/clCRID.h
- --- org/clCRID.h 2015-07-28 02:43:12.000000000 +0900
- +++ new/clCRID.h 2021-01-28 00:00:00.000000000 +0900
- @@ -10,7 +10,7 @@
- //--------------------------------------------------
- class clCRID{
- public:
- - clCRID(unsigned int ciphKey1=0x207DFFFF,unsigned int ciphKey2=0x00B8F21B);
- + clCRID(bool maskEnabled,unsigned int ciphKey1=0x207DFFFF,unsigned int ciphKey2=0x00B8F21B);
- // ロード/開放
- static bool CheckFile(void *data,unsigned int size);
- @@ -43,6 +43,7 @@ private:
- unsigned int r1C; // 不明(0)
- };
- clUTF _utf;
- + bool _maskEnabled;
- unsigned char _videoMask1[0x20];
- unsigned char _videoMask2[0x20];
- unsigned char _audioMask[0x20];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement