nfsu / nfs Goto Github PK
View Code? Open in Web Editor NEWIs a tool created for rom hacking, it stands for Nintendo File System (Utils) and can quickly read and interpret nds files such as NARC, NCLR, NCGR, etc.
License: MIT License
Is a tool created for rom hacking, it stands for Nintendo File System (Utils) and can quickly read and interpret nds files such as NARC, NCLR, NCGR, etc.
License: MIT License
NFSU creates a runtime error which disallows me to run it. Please try removing your own PATH variables and check if you're missing something.
Resource loading or using something else like including it in the exe
NSCR
Like nds_rom_editor
Hello, i want to make a romhacking tool using this to handle read a writes to the rom file.
I was thinking this is library so i tried to run your example as:
#include "NFS-master/NFS/FileSystem.h"
#include <iostream>
int main()
{
std::cout << "name: ";
std::string filename;
std::cin >> filename;
Buffer buf = readFile(filename);
try
{
nfs::NDS nds = nfs::NType::readNDS(buf);
}
catch (std::exception e)
{
printf("%s\n", e.what());
}
deleteBuffer(&buf);
std::cin.clear();
std::cin.ignore(32767, '\n');
std::cin.get();
}
using: g++ -o test.exe main.cpp -I C:\Users\***\Desktop\nitrotest\NFS-master\NFS
but got about 72 compile errors, all from "Iterators.h", "TypeStruc.h", "NTypes2.h".
Seeing the source files with qt and all makes me thing this is a tool but you present this repo as a lib, i am so confused, i don't even sure what files i should #include in my code to work with this or if this works with GCC.
note: I don't have Visual Studio installed.
To be able to revert things that were added or removed by accident.
I think it could be cool if you can see a tree of changes so if you wanna go back to a certain revision you can.
Maybe you can also add a 'stable release' button that removes branches from the tree to avoid cluttering the project file.
Hi,
i'm using visual studio 2015 version 14 to complie the code,got 8 errors
error messages :
Severity Code Description Project File Line Suppression State
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFS c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFS c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162
template<typename Front, typename ...Back>
inline constexpr unsigned int TypeStruct<Front, Back...>::size()
{
return SizeTypes<Front, Back...>;
}
its strange
Maybe only narcs allow compression in them? Or there might be an indicator to save having to call decompress even if they don't allow it
The following would be great:
This is the code:
#include "filesystem.h"
int main()
{
Buffer buf = Buffer::read("test.nds");
nfs::NDS *nds = (nfs::NDS*) buf.ptr;
nfs::FileSystem fs(nds);
nfs::NARC &narc = fs.get<nfs::NARC>(*fs["fielddata/eventdata/zone_event.narc"]);
nfs::Archive arc(narc); //error here
}
For some reason i can't step into nfs::Archive arc(narc);
to see what exactly happens, but looks like btafb.size != btaf.files * 8
in archive.cpp evaluates to true and throws EXCEPTION("Archive BTAF didn't match format");
.
I checked for these values in the main function:
Looks like you want to check if the FAT size correspond to the number of files but buffer.size
only holds the properties of the FAT, not the FAT itself.
Archive::Archive(NARC &narc) {
BTAF &btaf = narc.at<0>();
Buffer btafb = narc.get<0>();
if (btafb.size != btaf.files * 8)
EXCEPTION("Archive BTAF didn't match format");
...
The commit function should actually recompress it and check using the aligned file size instead of file size as well as update the real file size (in the ROM) when it did change it.
Apparently bitflags are a thing in C; which also work in C++17. This means that instead of doing template magic, the compiler can handle it for us. The ux and u1 types can be removed.
u32 bits2 : 2;
u32 bits1 : 1;
u32 bits3 : 3;
u32 bits : 26;
This means the problem with structs that have different sizes can easily be fixed. It also means that the CPSR for ARM emulation could be perfectly emulated without a hassle:
u32 negative : 1;
u32 zero : 1;
u32 carry : 1;
u32 overflow : 1;
u32 saturation : 1;
u32 thumbIT0 : 2;
u32 jazelle : 1;
u32 pad0 : 4;
u32 condition: 4;
u32 thumbIT1 : 6;
u32 useBigEndian : 1;
u32 asyncAbort : 1;
u32 disableIRQ : 1;
u32 disableFIRQ : 1;
u32 thumbMode : 1;
u32 one : 1;
u32 systemMode : 4; //USR, FIQ, IRQ, SVC, MON, ABT, HYP, UND, SYS
When the featureset is up to par, merge into main
For example; 0.NCLR and 1.NCGR should be bundled into 1 resource. You should be able to press a button to bundle them and move them into a virtual file system that can be saved alongside the project file. This can then be transferred to other people to make reverse engineering easy.
This line:
nfs::NARC &narc = fs.get<nfs::NARC>(*fs["fielddata/eventdata/zone_event.narc"]);
Causes this compile error:
In file included from include/filesystem.h:2,
from src/main.cpp:3:
include/archive.h: In instantiation of 'T& nfs::Archive::get(nfs::ArchiveObject&) [with T = nfs::GenericResource<1129464142, nfs::BTAF, nfs::BTNF, nfs::GMIF>]':
include/filesystem.h:107:28: required from 'T& nfs::FileSystem::get(nfs::ArchiveObject&) [with T = nfs::GenericResource<1129464142, nfs::BTAF, nfs::BTNF, nfs::GMIF>]'
include/filesystem.h:102:33: required from 'T& nfs::FileSystem::get(nfs::FileSystemObject&) [with T = nfs::GenericResource<1129464142, nfs::BTAF, nfs::BTNF, nfs::GMIF>]'
src/main.cpp:13:80: required from here
include/archive.h:67:15: error: no matching function for call to 'std::exception::exception(const char [53])'
throw std::exception("Archive Couldn't cast; variables aren't of same type");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8.1.1/exception:38,
from /usr/include/c++/8.1.1/stdexcept:38,
from /usr/include/c++/8.1.1/array:39,
from include/generic.h:2,
from include/templatemagic.h:2,
from include/genericresource.h:2,
from include/ntypes.h:2,
from include/resourcehelper.h:2,
from include/archive.h:2,
from include/filesystem.h:2,
from src/main.cpp:3:
/usr/include/c++/8.1.1/bits/exception.h:63:5: note: candidate: 'std::exception::exception()'
exception() _GLIBCXX_USE_NOEXCEPT { }
^~~~~~~~~
/usr/include/c++/8.1.1/bits/exception.h:63:5: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/8.1.1/bits/exception.h:60:9: note: candidate: 'constexpr std::exception::exception(const std::exception&)'
class exception
^~~~~~~~~
/usr/include/c++/8.1.1/bits/exception.h:60:9: note: no known conversion for argument 1 from 'const char [53]' to 'const std::exception&'
changing std::exception
for std::runtime_error
by example, fixes the error.
i am in linux and using gcc 8.1.1
Game code is a c8[4] but no null terminator is added after the 4 chars before displaying it in InfoWindow.
Make sure that all textures that are bound to renderers are cleaned out before reloading a new rom.
Debug works, but Release doesn't. (Probably template stuff)
SDAT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.