Skip to content

Commit

Permalink
초기 커밋.
Browse files Browse the repository at this point in the history
  • Loading branch information
Asteria authored and Asteria committed Jun 7, 2023
1 parent bee1c9a commit f1f01cc
Show file tree
Hide file tree
Showing 701 changed files with 258,292 additions and 0 deletions.
107 changes: 107 additions & 0 deletions FileManhattan.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileManhattan", "FileManhattan\FileManhattan.csproj", "{AE99C645-86EE-4C26-BB87-F2889D763685}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ManhattanNative", "ManhattanNative\ManhattanNative.vcxproj", "{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "cryptopp870\cryptlib.vcxproj", "{C39F4B46-6E89-4074-902E-CA57073044D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DLL-Import Debug|Any CPU = DLL-Import Debug|Any CPU
DLL-Import Debug|x64 = DLL-Import Debug|x64
DLL-Import Debug|x86 = DLL-Import Debug|x86
DLL-Import Release|Any CPU = DLL-Import Release|Any CPU
DLL-Import Release|x64 = DLL-Import Release|x64
DLL-Import Release|x86 = DLL-Import Release|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AE99C645-86EE-4C26-BB87-F2889D763685}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Debug|x64.ActiveCfg = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Debug|x64.Build.0 = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Debug|x86.ActiveCfg = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Debug|x86.Build.0 = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Debug|Any CPU.Build.0 = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Debug|x64.ActiveCfg = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Debug|x64.Build.0 = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Debug|x86.ActiveCfg = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Debug|x86.Build.0 = Debug|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Release|Any CPU.ActiveCfg = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Release|Any CPU.Build.0 = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Release|x64.ActiveCfg = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Release|x64.Build.0 = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Release|x86.ActiveCfg = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.DLL-Import Release|x86.Build.0 = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Release|Any CPU.Build.0 = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Release|x64.ActiveCfg = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Release|x64.Build.0 = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Release|x86.ActiveCfg = Release|Any CPU
{AE99C645-86EE-4C26-BB87-F2889D763685}.Release|x86.Build.0 = Release|Any CPU
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Debug|Any CPU.ActiveCfg = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Debug|Any CPU.Build.0 = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Debug|x64.ActiveCfg = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Debug|x64.Build.0 = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Debug|x86.ActiveCfg = Debug|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Debug|x86.Build.0 = Debug|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Debug|Any CPU.ActiveCfg = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Debug|Any CPU.Build.0 = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Debug|x64.Build.0 = Debug|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Debug|x86.ActiveCfg = Debug|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Debug|x86.Build.0 = Debug|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Release|Any CPU.ActiveCfg = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Release|Any CPU.Build.0 = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Release|x64.ActiveCfg = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Release|x64.Build.0 = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Release|x86.ActiveCfg = Release|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.DLL-Import Release|x86.Build.0 = Release|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Release|Any CPU.ActiveCfg = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Release|Any CPU.Build.0 = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Release|x64.ActiveCfg = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Release|x64.Build.0 = Release|x64
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Release|x86.ActiveCfg = Release|Win32
{DBD717A3-ADF2-4A0E-AAFA-99A8510291A6}.Release|x86.Build.0 = Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|Any CPU.ActiveCfg = Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|Any CPU.Build.0 = Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|x64.ActiveCfg = Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|x64.Build.0 = Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|x86.ActiveCfg = Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|x86.Build.0 = Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|Any CPU.ActiveCfg = DLL-Import Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|Any CPU.Build.0 = DLL-Import Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|x64.ActiveCfg = DLL-Import Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|x64.Build.0 = DLL-Import Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|x86.ActiveCfg = DLL-Import Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|x86.Build.0 = DLL-Import Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|Any CPU.ActiveCfg = DLL-Import Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|Any CPU.Build.0 = DLL-Import Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|x64.ActiveCfg = DLL-Import Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|x64.Build.0 = DLL-Import Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|x86.ActiveCfg = DLL-Import Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|x86.Build.0 = DLL-Import Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Any CPU.ActiveCfg = Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Any CPU.Build.0 = Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|x64.ActiveCfg = Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|x64.Build.0 = Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|x86.ActiveCfg = Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5686B31B-360B-41BE-84E4-B1E0089FFDC6}
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions FileManhattan/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Application x:Class="FileManhattan.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FileManhattan"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
35 changes: 35 additions & 0 deletions FileManhattan/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.IO;
using System.Windows;
using System.Threading;
using FileManhattan.Modules;

namespace FileManhattan
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public Mutex mtx;
protected override async void OnStartup(StartupEventArgs e)
{
if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\ManhattanNative.dll"))
{
MessageBox.Show("ManhtattanNative.dll이 존재하지 않습니다.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
Shutdown();
}

bool flagMutex;
mtx = new Mutex(true, "FILEMANHATTAN", out flagMutex);
if (!flagMutex)
{
MessageBox.Show("FileManhattan이 이미 실행중입니다.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
Shutdown();
}

await PhysicalDiskInfo.GetPhysicalDiskInformationAsync();
base.OnStartup(e);
}
}
}
11 changes: 11 additions & 0 deletions FileManhattan/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Reflection;
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
54 changes: 54 additions & 0 deletions FileManhattan/Converter/CryptoSettingsConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.Globalization;
using System.Windows.Data;
using FileManhattan.Enums;

namespace FileManhattan.Converter
{
public class CryptoSettingsConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
bool IsEncrypt = System.Convert.ToBoolean(values[0]);
bool IsRemoveAfter = System.Convert.ToBoolean(values[1]);
RemoveAlgorithm Mode = (RemoveAlgorithm)values[2];

string result;
if (IsEncrypt)
result = "암호화";
else
result = "복호화";

if (IsEncrypt && IsRemoveAfter)
{
result += " + 원본 삭제 ";

switch (Mode)
{
case RemoveAlgorithm.NormalDelete:
result += "일반 삭제 (SSD)";
break;
case RemoveAlgorithm.ThreePass:
result += "3회 덮어쓰기 - DoD 5220.22-M (E)";
break;
case RemoveAlgorithm.SevenPass:
result += "7회 덮어쓰기 - DoD 5220.22-M (ECE)";
break;
case RemoveAlgorithm.ThirtyFivePass:
result += "35회 덮어쓰기 - 피터 거트만 알고리즘";
break;
default:
result += "1회 덮어쓰기 - 랜덤 데이터";
break;
}
}

return result;
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
30 changes: 30 additions & 0 deletions FileManhattan/Converter/DataSizeConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Globalization;
using System.Windows.Data;

namespace FileManhattan.Converter
{
public class DataSizeConverter : IValueConverter
{
private readonly string[] sizeSuffixes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double size = System.Convert.ToDouble(value);
int suffixIndex = 0;

while (size >= 1024 && suffixIndex < sizeSuffixes.Length - 1)
{
size /= 1024;
suffixIndex++;
}

return string.Format("{0:0.#} {1}", size, sizeSuffixes[suffixIndex]);
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
40 changes: 40 additions & 0 deletions FileManhattan/Converter/DiskRemoveSettingsConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Globalization;
using System.IO;
using System.Windows.Data;
using FileManhattan.Enums;

namespace FileManhattan.Converter
{
public class DiskRemoveSettingsConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
DriveInfo driveInfo = (DriveInfo)values[0];
DiskRemoveMethod diskRemoveMethod = (DiskRemoveMethod)values[1];
bool wipeMFT = System.Convert.ToBoolean(values[2]);
bool wipeClusterTip = System.Convert.ToBoolean(values[3]);

string result;
if (diskRemoveMethod == DiskRemoveMethod.FreeSpace)
{
result = "드라이브 빈공간 삭제";
if (wipeMFT) result += " + MFT 빈공간 덮어쓰기";
if (wipeClusterTip) result += " + 클러스터 팁 덮어쓰기";
}
else
{
result = "드라이브 전체 삭제";
}

result += $" ({driveInfo.Name})";

return result;
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
42 changes: 42 additions & 0 deletions FileManhattan/Converter/RemoveFileSettingsConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Globalization;
using System.Windows.Data;
using FileManhattan.Enums;

namespace FileManhattan.Converter
{
public class RemoveSettingsConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
RemoveAlgorithm mode = (RemoveAlgorithm)value;

string result;
switch (mode)
{
case RemoveAlgorithm.NormalDelete:
result = "일반 삭제 (SSD)";
break;
case RemoveAlgorithm.ThreePass:
result = "3회 덮어쓰기 - DoD 5220.22-M (E)";
break;
case RemoveAlgorithm.SevenPass:
result = "7회 덮어쓰기 - DoD 5220.22-M (ECE)";
break;
case RemoveAlgorithm.ThirtyFivePass:
result = "35회 덮어쓰기 - 피터 거트만 알고리즘";
break;
default:
result = "1회 덮어쓰기 - 랜덤 데이터";
break;
}

return result;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
12 changes: 12 additions & 0 deletions FileManhattan/Enums/CryptoResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace FileManhattan.Enums
{
public enum CryptoResult
{
SUCCESS,
WRONG_FILE,
WRONG_PASSWORD,
INPUT_NOT_EXISTS,
OUTPUT_NOT_CREATABLE,
EXCEPTION
}
}
8 changes: 8 additions & 0 deletions FileManhattan/Enums/DiskRemoveMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace FileManhattan.Enums
{
public enum DiskRemoveMethod
{
FreeSpace,
EntirePartition,
}
}
11 changes: 11 additions & 0 deletions FileManhattan/Enums/RemoveAlgorithm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace FileManhattan.Enums
{
public enum RemoveAlgorithm
{
OnePass,
ThreePass,
SevenPass,
ThirtyFivePass,
NormalDelete
}
}
11 changes: 11 additions & 0 deletions FileManhattan/Enums/RemoveClusterTipResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace FileManhattan.Enums
{
public enum RemoveClusterTipResult
{
SUCCESS,
INVALID_HANDLE,
SEEK_FAILED,
WRITE_FAILED,
EXCEPTION
}
}
Loading

0 comments on commit f1f01cc

Please sign in to comment.