Open canplx opened 1 month ago
Same here. And later I can't recompile it with npdmtool of switch-tools.
Same here.
Their error comes from the fact that they mindlessly copy pasted stuff from readme without understanding that they are supposed to replace those brackets with proper names. [Name]
and [Output Folder]
are placeholders. So either you too don't understand what you are doing, or this error is not the same.
And later I can't recompile it with npdmtool of switch-tools.
It doesn't extract all informations.
Same here.
Their error comes from the fact that they mindlessly copy pasted stuff from readme without understanding that they are supposed to replace those brackets with proper names.
[Name]
and[Output Folder]
are placeholders. So either you too don't understand what you are doing, or this error is not the same.
if your referring the the [Name] and [Output Folder] what I typed out isn't literally that, I just put that there so I wouldn't have to type the entire full names of my folders and user profile.
Also showing an example of how to properly type out the command would be nice.
Same here.
Their error comes from the fact that they mindlessly copy pasted stuff from readme without understanding that they are supposed to replace those brackets with proper names.
[Name]
and[Output Folder]
are placeholders. So either you too don't understand what you are doing, or this error is not the same.if your referring the the [Name] and [Output Folder] what I typed out isn't literally that, I just put that there so I wouldn't have to type the entire full names of my folders and user profile.
Also showing an example of how to properly type out the command would be nice.
hactool -t npdm --json=output.json main.npdm
any other option to decompress, edit and compress npdm? Concretly I need to modify a main.npdm and I haven't found anything on the internet. I'm really desperate, and editing with HxD is not an option.
Dunno what you want to achieve, but you can basically use my template I am using and it should work as long as you properly fill name, title_id, main_thread_stack_size and system_resource_size. The last one is not extracted by hactool, it's stored at 0x14 offset (in some games it's 0)
https://github.com/masagrator/SleepLoggerEx/blob/main/config.json
another "issue" related to npdm functionality, it cannot properly read the .npdm of compiled binaries with the latest version of switch-tools.
It'll read the following with hactool -t npdm --json=output.json hbl.npdm
}, {
"type": "debug_flags",
"value": {
"allow_debug": false,
"force_debug": false
}
}]
instead of
{
"type": "debug_flags",
"value": {
"allow_debug": false,
"force_debug_prod": false,
"force_debug": true
}
},
when compiling https://github.com/borntohonk/nx-hbloader/blob/master/hbl.json#L245-L252
side note: if https://github.com/Atmosphere-NX/hac2l was ready to compile / had binaries that'd probably(?) solve this? (It didn't compile when i tried recently)
@borntohonk that's actually wrong output anyway, retail game will always have allow_debug set to true, while everything else set to false
HBL is not a game. https://github.com/Atmosphere-NX/Atmosphere/commit/0c4ae5573153166e6eb026cc0da1bb41d77e194b#diff-8f4f075aef2c24447ccda4c26924401ac8ee494eb948d971e1116e8df73bda07R433
/* 19.0.0+ disallows more than one flag set; we are always DebugMode for kernel, so ForceDebug is the most powerful/flexible flag to set. */
kac[i] = CapabilityDebugFlags::Encode(false, false, true);
as for hac2l, which is supposed to be a replacement to this version of hactool;
Building nx_release
make[1]: Entering directory '/build/Atmosphere-NX/Atmosphere/tools/hac2l'
make[3]: '/build/Atmosphere-NX/Atmosphere/libraries/libstratosphere/lib/nintendo_nx_arm64_armv8a/release/libstratosphere.a' is up to date.
Checked library.
make[2]: *** No rule to make target '/build/Atmosphere-NX/Atmosphere/tools/hac2l/out/nintendo_nx_arm64_armv8a/release/hac2l.kip', needed by 'all'. Stop.
make[1]: *** [/build/Atmosphere-NX/Atmosphere/tools/hac2l/tool.mk:80: all] Error 2
make[1]: Leaving directory '/build/Atmosphere-NX/Atmosphere/tools/hac2l'
make: *** [Makefile:39: nx_release] Error 2
changing Atmosphere-NX/Atmosphere/tools/hac2l/tool.mk
from:
%.kip : %.elf
to:
instead progresses it to another error, which by changing Atmosphere-NX/Atmosphere/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_nca_file_system_driver.hpp
class NcaFileSystemDriver private/public if condition to:
public:
struct StorageContext {
will make it compile further, but ultimately error
another "issue" related to npdm functionality, it cannot properly read the .npdm of compiled binaries with the latest version of switch-tools.
fix for that: https://github.com/borntohonk/hactuah/commit/54ba34e94b09a5043a60f24c5880a2a69a1fe272
hactool -t npdm --json=output.json main.npdm
as for hac2l, which is supposed to be a replacement to this version of hactool;
Building nx_release make[1]: Entering directory '/build/Atmosphere-NX/Atmosphere/tools/hac2l' make[3]: '/build/Atmosphere-NX/Atmosphere/libraries/libstratosphere/lib/nintendo_nx_arm64_armv8a/release/libstratosphere.a' is up to date. Checked library. make[2]: *** No rule to make target '/build/Atmosphere-NX/Atmosphere/tools/hac2l/out/nintendo_nx_arm64_armv8a/release/hac2l.kip', needed by 'all'. Stop. make[1]: *** [/build/Atmosphere-NX/Atmosphere/tools/hac2l/tool.mk:80: all] Error 2 make[1]: Leaving directory '/build/Atmosphere-NX/Atmosphere/tools/hac2l' make: *** [Makefile:39: nx_release] Error 2
changing
Atmosphere-NX/Atmosphere/tools/hac2l/tool.mk
from: %.kip : %.elf to: #%.kip : %.elfinstead progresses it to another error, which by changing
Atmosphere-NX/Atmosphere/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_nca_file_system_driver.hpp
class NcaFileSystemDriver private/public if condition to:public: struct StorageContext {
will make it compile further, but ultimately error
I can compile it fine on windows, I cloned the git into Atmosphere tests folder.
Don't edit tool.mk, go to the makefile and change the second line from: all: nx_release to all: win_x64_release
Then you can compile with mingw64.exe
The built exe ends up at around about 40mb so I used upx packer to compress it down to about 10mb.
I've uploaded the built exe here - https://github.com/mrdude2478/New-Binaries
Why pack it and not strip it? A stripped hac2l is like 600kb.
all: nx_release to all: win_x64_release
Similarly it does compile on linux_x64 with dependencies (such as libjpeg-dev, binutils-dev) on debian unstable, which also when stripped is ~600kb
Why pack it and not strip it? A stripped hac2l is like 600kb.
I stripped it and it makes it small. I forgot to do that when I compiled it :-), I'm an idiot.
Currently have a main.nmpd from a game and have placed the file into the same folder as hactool.exe, and only using a PC with no switch directory. I downloaded last hactool.exe release and used this command:
C:\Users\ [Name] \OneDrive\Desktop\hactool\hactool.exe -k C:\Users\ [Name] \AppData\Roaming\keys\prod.keys -t npdm --json=file C:\Users\ [Name] \OneDrive\Desktop\ [Output Folder]
And recieve the following error:
I wouldn't be surprised if I made an error somewhere, or if this isn't a option with my current setup.