GameTableContextMenu.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. using Gtk;
  2. using LibHac;
  3. using LibHac.Account;
  4. using LibHac.Common;
  5. using LibHac.Fs;
  6. using LibHac.Fs.Shim;
  7. using LibHac.FsSystem;
  8. using LibHac.FsSystem.NcaUtils;
  9. using LibHac.Ncm;
  10. using LibHac.Ns;
  11. using Ryujinx.Common.Configuration;
  12. using Ryujinx.Common.Logging;
  13. using Ryujinx.Common.Utilities;
  14. using Ryujinx.HLE.FileSystem;
  15. using System;
  16. using System.Buffers;
  17. using System.Diagnostics;
  18. using System.Globalization;
  19. using System.IO;
  20. using System.Reflection;
  21. using System.Threading;
  22. using static LibHac.Fs.ApplicationSaveDataManagement;
  23. namespace Ryujinx.Ui
  24. {
  25. public class GameTableContextMenu : Menu
  26. {
  27. private readonly ListStore _gameTableStore;
  28. private readonly TreeIter _rowIter;
  29. private readonly VirtualFileSystem _virtualFileSystem;
  30. private readonly BlitStruct<ApplicationControlProperty> _controlData;
  31. private MessageDialog _dialog;
  32. private bool _cancel;
  33. public GameTableContextMenu(ListStore gameTableStore, BlitStruct<ApplicationControlProperty> controlData, TreeIter rowIter, VirtualFileSystem virtualFileSystem)
  34. {
  35. _gameTableStore = gameTableStore;
  36. _rowIter = rowIter;
  37. _virtualFileSystem = virtualFileSystem;
  38. _controlData = controlData;
  39. MenuItem openSaveUserDir = new MenuItem("Open User Save Directory")
  40. {
  41. Sensitive = !Util.IsEmpty(controlData.ByteSpan) && controlData.Value.UserAccountSaveDataSize > 0,
  42. TooltipText = "Open the folder where the User save for the application is loaded"
  43. };
  44. MenuItem openSaveDeviceDir = new MenuItem("Open Device Save Directory")
  45. {
  46. Sensitive = !Util.IsEmpty(controlData.ByteSpan) && controlData.Value.DeviceSaveDataSize > 0,
  47. TooltipText = "Open the folder where the Device save for the application is loaded"
  48. };
  49. MenuItem openSaveBcatDir = new MenuItem("Open BCAT Save Directory")
  50. {
  51. Sensitive = !Util.IsEmpty(controlData.ByteSpan) && controlData.Value.BcatDeliveryCacheStorageSize > 0,
  52. TooltipText = "Open the folder where the BCAT save for the application is loaded"
  53. };
  54. MenuItem manageTitleUpdates = new MenuItem("Manage Title Updates")
  55. {
  56. TooltipText = "Open the title update management window"
  57. };
  58. MenuItem manageDlc = new MenuItem("Manage DLC")
  59. {
  60. TooltipText = "Open the DLC management window"
  61. };
  62. string ext = System.IO.Path.GetExtension(_gameTableStore.GetValue(_rowIter, 9).ToString()).ToLower();
  63. bool hasNca = ext == ".nca" || ext == ".nsp" || ext == ".pfs0" || ext == ".xci";
  64. MenuItem extractRomFs = new MenuItem("Extract RomFS Section")
  65. {
  66. Sensitive = hasNca,
  67. TooltipText = "Exctact the RomFs section present in the main NCA"
  68. };
  69. MenuItem extractExeFs = new MenuItem("Extract ExeFS Section")
  70. {
  71. Sensitive = hasNca,
  72. TooltipText = "Exctact the ExeFs section present in the main NCA"
  73. };
  74. MenuItem extractLogo = new MenuItem("Extract Logo Section")
  75. {
  76. Sensitive = hasNca,
  77. TooltipText = "Exctact the Logo section present in the main NCA"
  78. };
  79. openSaveUserDir.Activated += OpenSaveUserDir_Clicked;
  80. openSaveDeviceDir.Activated += OpenSaveDeviceDir_Clicked;
  81. openSaveBcatDir.Activated += OpenSaveBcatDir_Clicked;
  82. manageTitleUpdates.Activated += ManageTitleUpdates_Clicked;
  83. manageDlc.Activated += ManageDlc_Clicked;
  84. extractRomFs.Activated += ExtractRomFs_Clicked;
  85. extractExeFs.Activated += ExtractExeFs_Clicked;
  86. extractLogo.Activated += ExtractLogo_Clicked;
  87. this.Add(openSaveUserDir);
  88. this.Add(openSaveDeviceDir);
  89. this.Add(openSaveBcatDir);
  90. this.Add(new SeparatorMenuItem());
  91. this.Add(manageTitleUpdates);
  92. this.Add(manageDlc);
  93. this.Add(new SeparatorMenuItem());
  94. this.Add(extractRomFs);
  95. this.Add(extractExeFs);
  96. this.Add(extractLogo);
  97. }
  98. private bool TryFindSaveData(string titleName, ulong titleId, BlitStruct<ApplicationControlProperty> controlHolder, SaveDataFilter filter, out ulong saveDataId)
  99. {
  100. saveDataId = default;
  101. Result result = _virtualFileSystem.FsClient.FindSaveDataWithFilter(out SaveDataInfo saveDataInfo, SaveDataSpaceId.User, ref filter);
  102. if (ResultFs.TargetNotFound.Includes(result))
  103. {
  104. // Savedata was not found. Ask the user if they want to create it
  105. using MessageDialog messageDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, null)
  106. {
  107. Title = "Ryujinx",
  108. Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
  109. Text = $"There is no savedata for {titleName} [{titleId:x16}]",
  110. SecondaryText = "Would you like to create savedata for this game?",
  111. WindowPosition = WindowPosition.Center
  112. };
  113. if (messageDialog.Run() != (int)ResponseType.Yes)
  114. {
  115. return false;
  116. }
  117. ref ApplicationControlProperty control = ref controlHolder.Value;
  118. if (LibHac.Util.IsEmpty(controlHolder.ByteSpan))
  119. {
  120. // If the current application doesn't have a loaded control property, create a dummy one
  121. // and set the savedata sizes so a user savedata will be created.
  122. control = ref new BlitStruct<ApplicationControlProperty>(1).Value;
  123. // The set sizes don't actually matter as long as they're non-zero because we use directory savedata.
  124. control.UserAccountSaveDataSize = 0x4000;
  125. control.UserAccountSaveDataJournalSize = 0x4000;
  126. Logger.PrintWarning(LogClass.Application,
  127. "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games.");
  128. }
  129. Uid user = new Uid(1, 0);
  130. result = EnsureApplicationSaveData(_virtualFileSystem.FsClient, out _, new TitleId(titleId), ref control, ref user);
  131. if (result.IsFailure())
  132. {
  133. GtkDialog.CreateErrorDialog($"There was an error creating the specified savedata: {result.ToStringWithName()}");
  134. return false;
  135. }
  136. // Try to find the savedata again after creating it
  137. result = _virtualFileSystem.FsClient.FindSaveDataWithFilter(out saveDataInfo, SaveDataSpaceId.User, ref filter);
  138. }
  139. if (result.IsSuccess())
  140. {
  141. saveDataId = saveDataInfo.SaveDataId;
  142. return true;
  143. }
  144. GtkDialog.CreateErrorDialog($"There was an error finding the specified savedata: {result.ToStringWithName()}");
  145. return false;
  146. }
  147. private string GetSaveDataDirectory(ulong saveDataId)
  148. {
  149. string saveRootPath = System.IO.Path.Combine(_virtualFileSystem.GetNandPath(), $"user/save/{saveDataId:x16}");
  150. if (!Directory.Exists(saveRootPath))
  151. {
  152. // Inconsistent state. Create the directory
  153. Directory.CreateDirectory(saveRootPath);
  154. }
  155. string committedPath = System.IO.Path.Combine(saveRootPath, "0");
  156. string workingPath = System.IO.Path.Combine(saveRootPath, "1");
  157. // If the committed directory exists, that path will be loaded the next time the savedata is mounted
  158. if (Directory.Exists(committedPath))
  159. {
  160. return committedPath;
  161. }
  162. // If the working directory exists and the committed directory doesn't,
  163. // the working directory will be loaded the next time the savedata is mounted
  164. if (!Directory.Exists(workingPath))
  165. {
  166. Directory.CreateDirectory(workingPath);
  167. }
  168. return workingPath;
  169. }
  170. private void ExtractSection(NcaSectionType ncaSectionType)
  171. {
  172. FileChooserDialog fileChooser = new FileChooserDialog("Choose the folder to extract into", null, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Extract", ResponseType.Accept);
  173. fileChooser.SetPosition(WindowPosition.Center);
  174. int response = fileChooser.Run();
  175. string destination = fileChooser.Filename;
  176. fileChooser.Dispose();
  177. if (response == (int)ResponseType.Accept)
  178. {
  179. Thread extractorThread = new Thread(() =>
  180. {
  181. string sourceFile = _gameTableStore.GetValue(_rowIter, 9).ToString();
  182. Gtk.Application.Invoke(delegate
  183. {
  184. _dialog = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Cancel, null)
  185. {
  186. Title = "Ryujinx - NCA Section Extractor",
  187. Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
  188. SecondaryText = $"Extracting {ncaSectionType} section from {System.IO.Path.GetFileName(sourceFile)}...",
  189. WindowPosition = WindowPosition.Center
  190. };
  191. int dialogResponse = _dialog.Run();
  192. if (dialogResponse == (int)ResponseType.Cancel || dialogResponse == (int)ResponseType.DeleteEvent)
  193. {
  194. _cancel = true;
  195. _dialog.Dispose();
  196. }
  197. });
  198. using (FileStream file = new FileStream(sourceFile, FileMode.Open, FileAccess.Read))
  199. {
  200. Nca mainNca = null;
  201. Nca patchNca = null;
  202. if ((System.IO.Path.GetExtension(sourceFile).ToLower() == ".nsp") ||
  203. (System.IO.Path.GetExtension(sourceFile).ToLower() == ".pfs0") ||
  204. (System.IO.Path.GetExtension(sourceFile).ToLower() == ".xci"))
  205. {
  206. PartitionFileSystem pfs;
  207. if (System.IO.Path.GetExtension(sourceFile) == ".xci")
  208. {
  209. Xci xci = new Xci(_virtualFileSystem.KeySet, file.AsStorage());
  210. pfs = xci.OpenPartition(XciPartitionType.Secure);
  211. }
  212. else
  213. {
  214. pfs = new PartitionFileSystem(file.AsStorage());
  215. }
  216. foreach (DirectoryEntryEx fileEntry in pfs.EnumerateEntries("/", "*.nca"))
  217. {
  218. pfs.OpenFile(out IFile ncaFile, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
  219. Nca nca = new Nca(_virtualFileSystem.KeySet, ncaFile.AsStorage());
  220. if (nca.Header.ContentType == NcaContentType.Program)
  221. {
  222. int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
  223. if (nca.Header.GetFsHeader(dataIndex).IsPatchSection())
  224. {
  225. patchNca = nca;
  226. }
  227. else
  228. {
  229. mainNca = nca;
  230. }
  231. }
  232. }
  233. }
  234. else if (System.IO.Path.GetExtension(sourceFile).ToLower() == ".nca")
  235. {
  236. mainNca = new Nca(_virtualFileSystem.KeySet, file.AsStorage());
  237. }
  238. if (mainNca == null)
  239. {
  240. Logger.PrintError(LogClass.Application, "Extraction failed. The main NCA was not present in the selected file.");
  241. Gtk.Application.Invoke(delegate
  242. {
  243. GtkDialog.CreateErrorDialog("Extraction failed. The main NCA was not present in the selected file.");
  244. });
  245. return;
  246. }
  247. string titleUpdateMetadataPath = System.IO.Path.Combine(_virtualFileSystem.GetBasePath(), "games", mainNca.Header.TitleId.ToString("x16"), "updates.json");
  248. if (File.Exists(titleUpdateMetadataPath))
  249. {
  250. string updatePath = JsonHelper.DeserializeFromFile<TitleUpdateMetadata>(titleUpdateMetadataPath).Selected;
  251. if (File.Exists(updatePath))
  252. {
  253. FileStream updateFile = new FileStream(updatePath, FileMode.Open, FileAccess.Read);
  254. PartitionFileSystem nsp = new PartitionFileSystem(updateFile.AsStorage());
  255. _virtualFileSystem.ImportTickets(nsp);
  256. foreach (DirectoryEntryEx fileEntry in nsp.EnumerateEntries("/", "*.nca"))
  257. {
  258. nsp.OpenFile(out IFile ncaFile, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
  259. Nca nca = new Nca(_virtualFileSystem.KeySet, ncaFile.AsStorage());
  260. if ($"{nca.Header.TitleId.ToString("x16")[..^3]}000" != mainNca.Header.TitleId.ToString("x16"))
  261. {
  262. break;
  263. }
  264. if (nca.Header.ContentType == NcaContentType.Program)
  265. {
  266. patchNca = nca;
  267. }
  268. }
  269. }
  270. }
  271. int index = Nca.GetSectionIndexFromType(ncaSectionType, mainNca.Header.ContentType);
  272. IFileSystem ncaFileSystem = patchNca != null ? mainNca.OpenFileSystemWithPatch(patchNca, index, IntegrityCheckLevel.ErrorOnInvalid)
  273. : mainNca.OpenFileSystem(index, IntegrityCheckLevel.ErrorOnInvalid);
  274. FileSystemClient fsClient = _virtualFileSystem.FsClient;
  275. string source = DateTime.Now.ToFileTime().ToString().Substring(10);
  276. string output = DateTime.Now.ToFileTime().ToString().Substring(10);
  277. fsClient.Register(source.ToU8Span(), ncaFileSystem);
  278. fsClient.Register(output.ToU8Span(), new LocalFileSystem(destination));
  279. (Result? resultCode, bool canceled) = CopyDirectory(fsClient, $"{source}:/", $"{output}:/");
  280. if (!canceled)
  281. {
  282. if (resultCode.Value.IsFailure())
  283. {
  284. Logger.PrintError(LogClass.Application, $"LibHac returned error code: {resultCode.Value.ErrorCode}");
  285. Gtk.Application.Invoke(delegate
  286. {
  287. _dialog?.Dispose();
  288. GtkDialog.CreateErrorDialog("Extraction failed. Read the log file for further information.");
  289. });
  290. }
  291. else if (resultCode.Value.IsSuccess())
  292. {
  293. Gtk.Application.Invoke(delegate
  294. {
  295. _dialog?.Dispose();
  296. MessageDialog dialog = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, null)
  297. {
  298. Title = "Ryujinx - NCA Section Extractor",
  299. Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
  300. SecondaryText = "Extraction has completed successfully.",
  301. WindowPosition = WindowPosition.Center
  302. };
  303. dialog.Run();
  304. dialog.Dispose();
  305. });
  306. }
  307. }
  308. fsClient.Unmount(source.ToU8Span());
  309. fsClient.Unmount(output.ToU8Span());
  310. }
  311. });
  312. extractorThread.Name = "GUI.NcaSectionExtractorThread";
  313. extractorThread.IsBackground = true;
  314. extractorThread.Start();
  315. }
  316. }
  317. private (Result? result, bool canceled) CopyDirectory(FileSystemClient fs, string sourcePath, string destPath)
  318. {
  319. Result rc = fs.OpenDirectory(out DirectoryHandle sourceHandle, sourcePath.ToU8Span(), OpenDirectoryMode.All);
  320. if (rc.IsFailure()) return (rc, false);
  321. using (sourceHandle)
  322. {
  323. foreach (DirectoryEntryEx entry in fs.EnumerateEntries(sourcePath, "*", SearchOptions.Default))
  324. {
  325. if (_cancel)
  326. {
  327. return (null, true);
  328. }
  329. string subSrcPath = PathTools.Normalize(PathTools.Combine(sourcePath, entry.Name));
  330. string subDstPath = PathTools.Normalize(PathTools.Combine(destPath, entry.Name));
  331. if (entry.Type == DirectoryEntryType.Directory)
  332. {
  333. fs.EnsureDirectoryExists(subDstPath);
  334. (Result? result, bool canceled) = CopyDirectory(fs, subSrcPath, subDstPath);
  335. if (canceled || result.Value.IsFailure())
  336. {
  337. return (result, canceled);
  338. }
  339. }
  340. if (entry.Type == DirectoryEntryType.File)
  341. {
  342. fs.CreateOrOverwriteFile(subDstPath, entry.Size);
  343. rc = CopyFile(fs, subSrcPath, subDstPath);
  344. if (rc.IsFailure()) return (rc, false);
  345. }
  346. }
  347. }
  348. return (Result.Success, false);
  349. }
  350. public Result CopyFile(FileSystemClient fs, string sourcePath, string destPath)
  351. {
  352. Result rc = fs.OpenFile(out FileHandle sourceHandle, sourcePath.ToU8Span(), OpenMode.Read);
  353. if (rc.IsFailure()) return rc;
  354. using (sourceHandle)
  355. {
  356. rc = fs.OpenFile(out FileHandle destHandle, destPath.ToU8Span(), OpenMode.Write | OpenMode.AllowAppend);
  357. if (rc.IsFailure()) return rc;
  358. using (destHandle)
  359. {
  360. const int maxBufferSize = 1024 * 1024;
  361. rc = fs.GetFileSize(out long fileSize, sourceHandle);
  362. if (rc.IsFailure()) return rc;
  363. int bufferSize = (int)Math.Min(maxBufferSize, fileSize);
  364. byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
  365. try
  366. {
  367. for (long offset = 0; offset < fileSize; offset += bufferSize)
  368. {
  369. int toRead = (int)Math.Min(fileSize - offset, bufferSize);
  370. Span<byte> buf = buffer.AsSpan(0, toRead);
  371. rc = fs.ReadFile(out long _, sourceHandle, offset, buf);
  372. if (rc.IsFailure()) return rc;
  373. rc = fs.WriteFile(destHandle, offset, buf);
  374. if (rc.IsFailure()) return rc;
  375. }
  376. }
  377. finally
  378. {
  379. ArrayPool<byte>.Shared.Return(buffer);
  380. }
  381. rc = fs.FlushFile(destHandle);
  382. if (rc.IsFailure()) return rc;
  383. }
  384. }
  385. return Result.Success;
  386. }
  387. // Events
  388. private void OpenSaveUserDir_Clicked(object sender, EventArgs args)
  389. {
  390. string titleName = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[0];
  391. string titleId = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[1].ToLower();
  392. if (!ulong.TryParse(titleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong titleIdNumber))
  393. {
  394. GtkDialog.CreateErrorDialog("UI error: The selected game did not have a valid title ID");
  395. return;
  396. }
  397. SaveDataFilter filter = new SaveDataFilter();
  398. filter.SetUserId(new UserId(1, 0));
  399. OpenSaveDir(titleName, titleIdNumber, filter);
  400. }
  401. private void OpenSaveDir(string titleName, ulong titleId, SaveDataFilter filter)
  402. {
  403. filter.SetProgramId(new TitleId(titleId));
  404. if (!TryFindSaveData(titleName, titleId, _controlData, filter, out ulong saveDataId))
  405. {
  406. return;
  407. }
  408. string saveDir = GetSaveDataDirectory(saveDataId);
  409. Process.Start(new ProcessStartInfo
  410. {
  411. FileName = saveDir,
  412. UseShellExecute = true,
  413. Verb = "open"
  414. });
  415. }
  416. private void OpenSaveDeviceDir_Clicked(object sender, EventArgs args)
  417. {
  418. string titleName = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[0];
  419. string titleId = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[1].ToLower();
  420. if (!ulong.TryParse(titleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong titleIdNumber))
  421. {
  422. GtkDialog.CreateErrorDialog("UI error: The selected game did not have a valid title ID");
  423. return;
  424. }
  425. SaveDataFilter filter = new SaveDataFilter();
  426. filter.SetSaveDataType(SaveDataType.Device);
  427. OpenSaveDir(titleName, titleIdNumber, filter);
  428. }
  429. private void OpenSaveBcatDir_Clicked(object sender, EventArgs args)
  430. {
  431. string titleName = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[0];
  432. string titleId = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[1].ToLower();
  433. if (!ulong.TryParse(titleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong titleIdNumber))
  434. {
  435. GtkDialog.CreateErrorDialog("UI error: The selected game did not have a valid title ID");
  436. return;
  437. }
  438. SaveDataFilter filter = new SaveDataFilter();
  439. filter.SetSaveDataType(SaveDataType.Bcat);
  440. OpenSaveDir(titleName, titleIdNumber, filter);
  441. }
  442. private void ManageTitleUpdates_Clicked(object sender, EventArgs args)
  443. {
  444. string titleName = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[0];
  445. string titleId = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[1].ToLower();
  446. TitleUpdateWindow titleUpdateWindow = new TitleUpdateWindow(titleId, titleName, _virtualFileSystem);
  447. titleUpdateWindow.Show();
  448. }
  449. private void ManageDlc_Clicked(object sender, EventArgs args)
  450. {
  451. string titleName = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[0];
  452. string titleId = _gameTableStore.GetValue(_rowIter, 2).ToString().Split("\n")[1].ToLower();
  453. DlcWindow dlcWindow = new DlcWindow(titleId, titleName, _virtualFileSystem);
  454. dlcWindow.Show();
  455. }
  456. private void ExtractRomFs_Clicked(object sender, EventArgs args)
  457. {
  458. ExtractSection(NcaSectionType.Data);
  459. }
  460. private void ExtractExeFs_Clicked(object sender, EventArgs args)
  461. {
  462. ExtractSection(NcaSectionType.Code);
  463. }
  464. private void ExtractLogo_Clicked(object sender, EventArgs args)
  465. {
  466. ExtractSection(NcaSectionType.Logo);
  467. }
  468. }
  469. }