-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96fdbdc
commit 3f709f0
Showing
53 changed files
with
607 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using NCMDump.Core; | ||
|
||
namespace NCMDump.CLI | ||
{ | ||
public class Application | ||
{ | ||
public static NCMDumper Dumper = new(); | ||
|
||
public static void Main(params string[] args) | ||
{ | ||
int depth = 0; | ||
if (args.Length == 0) | ||
{ | ||
if (OperatingSystem.IsWindows()) | ||
{ | ||
Console.WriteLine("Drag [*.ncm] file or directory on exe to start..."); | ||
Console.WriteLine("./ncmdump.exe <file_or_dir1> [<file_or_dir2> ... <file_or_dirN>]"); | ||
} | ||
if (OperatingSystem.IsLinux()) | ||
{ | ||
Console.WriteLine("./ncmdump <file_or_dir1> [<file_or_dir2> ... <file_or_dirN>]"); | ||
} | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
foreach (string path in args) | ||
{ | ||
if (new DirectoryInfo(path).Exists) | ||
{ | ||
WalkThrough(new DirectoryInfo(path)); | ||
} | ||
else if (new FileInfo(path).Exists) | ||
{ | ||
Console.Write($"Dumping: {new FileInfo(path).FullName} ......"); | ||
if (Dumper.Convert(path)) Console.WriteLine("OK"); | ||
else Console.WriteLine("Fail"); | ||
Console.WriteLine(); | ||
} | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine(ex.Message); | ||
} | ||
|
||
Console.Write("Press Enter to Exit..."); | ||
Console.ReadLine(); | ||
return; | ||
|
||
void WalkThrough(DirectoryInfo dir) | ||
{ | ||
depth++; | ||
if (depth > 16) | ||
{ | ||
depth--; | ||
return; | ||
} | ||
Console.WriteLine("DIR: " + dir.FullName); | ||
foreach (DirectoryInfo d in dir.GetDirectories()) | ||
{ | ||
WalkThrough(d); | ||
} | ||
foreach (FileInfo f in dir.EnumerateFiles("*.ncm")) | ||
{ | ||
Console.Write($"Dumping: {f.FullName} ......"); | ||
if (Dumper.Convert(f.FullName)) Console.WriteLine("OK"); | ||
else Console.WriteLine("...Fail"); | ||
} | ||
|
||
Console.WriteLine(); | ||
depth--; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace NCMDump.Core | ||
{ | ||
public interface IRC4_NCM_Stream : IDisposable | ||
{ | ||
public bool CanRead { get; } | ||
public bool CanSeek { get; } | ||
public bool CanWrite { get; } | ||
public long Length { get; } | ||
public long Position { get; set; } | ||
|
||
public long Seek(long offset, SeekOrigin origin); | ||
|
||
public int Read(byte[] buffer, int offset, int count); | ||
|
||
public int Read(Span<byte> buffer); | ||
|
||
public Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken); | ||
|
||
public ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace NCMDumpCore | ||
namespace NCMDump.Core | ||
{ | ||
public class MetaInfo | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.