Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Modder4869 committed Aug 27, 2023
1 parent 051b7f1 commit 0674350
Show file tree
Hide file tree
Showing 5 changed files with 566 additions and 0 deletions.
25 changes: 25 additions & 0 deletions HoloModels.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HoloModels", "HoloModels\HoloModels.csproj", "{DEB4B5BA-95D1-4B56-973B-CF925C622C70}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DEB4B5BA-95D1-4B56-973B-CF925C622C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEB4B5BA-95D1-4B56-973B-CF925C622C70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEB4B5BA-95D1-4B56-973B-CF925C622C70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEB4B5BA-95D1-4B56-973B-CF925C622C70}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AB2C6C54-EDE0-4D74-9010-F852EF65BC04}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions HoloModels/HoloModels.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
56 changes: 56 additions & 0 deletions HoloModels/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.IO;
using static Utils.Rijndael;

class Program
{
private static byte[]? iv;

static void Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("Usage: HoloModels.exe <input_folder> <output_folder>");
return;
}

string inputFolder = args[0];
string outputFolder = args[1];

byte[] key = new byte[] { 145, 153, 81, 152, 6, 193, 94, 191, 35, 38, 33, 254, 47, 248, 64, 46, 119, 119, 58, 136, 217, 184, 28, 35, 62, 11, 204, 188, 149, 49, 129, 181 };
foreach (string encryptedFilePath in Directory.GetFiles(inputFolder))
{
string decryptedFilePath = Path.Combine(outputFolder, Path.GetFileNameWithoutExtension(encryptedFilePath));
Directory.CreateDirectory(outputFolder);
byte[] encryptedData;
using (FileStream encryptedFileStream = new FileStream(encryptedFilePath, FileMode.Open, FileAccess.Read))
{
iv = new byte[32];
encryptedFileStream.Read(iv, 0, iv.Length);
encryptedFileStream.Seek(0, SeekOrigin.Begin);
encryptedData = new byte[encryptedFileStream.Length];
encryptedFileStream.Read(encryptedData, 0, encryptedData.Length);
}

try
{
byte[] decryptedData = DecryptData(encryptedData, key, iv, BlockSize.Block256, KeySize.Key256, EncryptionMode.ModeCBC);

// Check if the decrypted data is not empty before writing it
if (decryptedData.Length > 32)
{
File.WriteAllBytes(decryptedFilePath, decryptedData[32..]);
Console.WriteLine($"Decryption completed for {Path.GetFileName(encryptedFilePath)}. Decrypted data saved in: {decryptedFilePath}");
}
else
{
Console.WriteLine($"Decryption failed for {Path.GetFileName(encryptedFilePath)}. Decrypted data is empty.");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error during decryption for {Path.GetFileName(encryptedFilePath)}: {ex.Message}");
}
}
}
}
8 changes: 8 additions & 0 deletions HoloModels/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"HoloModels": {
"commandName": "Project",
"commandLineArgs": "D:\\Users\\ASUS\\Downloads\\jp.Gugenka.Holomodels_1141_aab_apksos.com\\jp.Gugenka.Holomodels\\homod\\test\\TextAsset \"aaaaaaa\""
}
}
}
Loading

0 comments on commit 0674350

Please sign in to comment.