Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
1.添加了LICENSE文件。
Browse files Browse the repository at this point in the history
2.新增了从命令行指定文件名功能。
  • Loading branch information
hnidesu committed Apr 4, 2024
1 parent b519cdf commit 77765ae
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "8.1",
"compilerPath": "D:\\mingw64\\bin\\g++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x86"
}
],
"version": 4
}
36 changes: 36 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\output\\main.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "D:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe 生成可执行文件"
}

]

}
67 changes: 67 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"files.associations": {
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"memory": "cpp",
"new": "cpp",
"ostream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"xfacet": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocinfo": "cpp",
"xlocnum": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"regex": "cpp",
"iomanip": "cpp",
"xlocmon": "cpp",
"xloctime": "cpp",
"array": "cpp",
"*.tcc": "cpp",
"cstdarg": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string": "cpp",
"string_view": "cpp",
"sstream": "cpp"
}
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe 生成可执行文件",
"command": "g++.exe",
"args": [
"-masm=intel",
"-g",
"-m32",
"-o",
"${workspaceFolder}\\output\\srpgextractor.exe",
"${workspaceFolder}\\DSRTArchiver.cpp",
"${workspaceFolder}\\Utility.cpp",
"${workspaceFolder}\\main.cpp",
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
}
],
"version": "2.0.0"
}
1 change: 1 addition & 0 deletions DSRTArchiver.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "DSRTArchiver.h"
#include <windows.h>
#include "utility.h"

#define KNOWNFRAGMENTCOUNT 35

const wchar_t* KnownEntryNames[KNOWNFRAGMENTCOUNT]={
Expand Down
1 change: 0 additions & 1 deletion DSRTArchiver.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#include <windows.h>
#include <iostream>
#include <vector>
#include <string>
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 HNIdesu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 11 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
#include "DSRTArchiver.h"
#include "Utility.h"
#include <iostream>
#include <windows.h>

#define TARGETPATH L"E:\\Games\\冒险游戏\\戦姫ルルカver1.1\\data.dts"
#define DECRYPT_KEY_LENGTH 6
const wchar_t DecryptKey[DECRYPT_KEY_LENGTH]={L'k',L'e',L'y',L's',L'e',L't'};

using namespace std;
int main(int argc,char** argv){
DSRTArchiver archiver(TARGETPATH);
if(argc<2){
cout<<"Usage: "<<argv[0]<<" data.dts"<<endl;
cout<<"Example: "<<argv[0]<<" game\\data.dts"<<endl;
return 0;
}
int inputFileNameLength=(int)strlen(argv[1]);
wchar_t* inputFilePath=new wchar_t[inputFileNameLength+1];
inputFilePath[MultiByteToWideChar(GetACP(),0,argv[1],inputFileNameLength,inputFilePath,inputFileNameLength+1)]=L'\0';
DSRTArchiver archiver(inputFilePath);
delete[] inputFilePath;
wchar_t* filepath=new wchar_t[256];
wchar_t* entry_name=new wchar_t[256];
wchar_t* dir_path=new wchar_t[512];
Expand Down
Binary file added output/srpgextractor.exe
Binary file not shown.

0 comments on commit 77765ae

Please sign in to comment.