kwsch / pkNX

Pokémon (Nintendo Switch) ROM Editor & Randomizer
https://projectpokemon.org/home/forums/topic/48647-pknx-nintendo-switch-rom-editor-randomizer/
GNU General Public License v3.0
352 stars 108 forks source link

Error when trying to open the texts "common" and "scrtips" #86

Closed dderek closed 4 years ago

dderek commented 4 years ago

Error displayed when trying to open text entries, "common". very similar error when trying to export the "scripts" to a txt file

System.Reflection.TargetInvocationException HResult=0x80131604 Message=Uma exceção foi acionada pelo destino de uma chamada. Source=mscorlib StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at pkNX.WinForms.Controls.EditorBase.<>c__DisplayClass11_0.b__0(Object s, EventArgs e) in C:\Users\Derek\Source\Repos\pkNX5\pkNX.WinForms\MainEditor\EditorProvider.cs:line 37 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at pkNX.WinForms.Program.Main() in C:\Users\Derek\Source\Repos\pkNX5\pkNX.WinForms\Program.cs:line 17

Esta exceção foi gerada originalmente nesta pilha de chamadas: pkNX.Structures.TextFile.TextFile(byte[], pkNX.Structures.TextConfig, bool) em TextFile.cs pkNX.WinForms.TextContainer.GetLines(int) em TextContainer.cs pkNX.WinForms.TextEditor.ExportTextFile(string, bool, pkNX.WinForms.TextContainer) em TextEditor.cs pkNX.WinForms.TextEditor.B_Export_Click(object, System.EventArgs) em TextEditor.cs System.Windows.Forms.Control.OnClick(System.EventArgs) System.Windows.Forms.Button.OnClick(System.EventArgs) System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs) System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message, System.Windows.Forms.MouseButtons, int) System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message) System.Windows.Forms.ButtonBase.WndProc(ref System.Windows.Forms.Message) ... [Pilha de Chamadas Truncada] Exceção interna 1: Exception: Invalid initial key! Not 0?

kwsch commented 4 years ago

Invalid initial key means the text file is not decryptable ; are you sure that everything was dumped correctly?

dderek commented 4 years ago

in fact, I don't know, however, when the file extraction error occurs, hactool simply doesn't even extract it.

sora10pls commented 4 years ago

If you’re extracting the game update with hactool, you need both the base game NCA as well as the update NCA.

dderek commented 4 years ago

yes, and that's exactly what i did, i had it extracted using the base nca and the update nca, using the titlekey of the update

dderek commented 4 years ago

so much so that the program itself opens, it just isn't opening some functions like "common" and "script"

sora10pls commented 4 years ago

I’ve done several tests a few days ago and hactool always properly extracted contents + had the right filecount. I would rule this out as not a pkNX bug and recommend you try both dumping and extracting again with the latest hactool (1.4.0).

Keep in mind you can generate an NCA directly from your SD Card using hactool if you have your SD seed, you can find a tutorial on that on GBAtemp. Has worked fine for me a number of times.

dderek commented 4 years ago

I will try, I appreciate the information