📄 ndsdump.cpp
字号:
#include <fstream>#include "ndshead.h"inline unsigned intnlpo2(unsigned int x){ if(x&(x-1)) { // If we're not already a power of 2 x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); x |= (x >> 8); x |= (x >> 16); return(x+1); // Return next power up } return x; // Otherwise, stick with what we have}int main(int argc, char **argv){ if(argc < 2) { printf("Usage: ndsdump <file to dump>\n"); return 1; } std::ifstream input(argv[1], std::ios::binary); input.seekg(0, std::ios::end); u32 ROMsize = input.tellg(); input.seekg(0, std::ios::beg); u8 *ROM = new u8[nlpo2(ROMsize)]; input.read((char*)ROM, ROMsize); input.close(); NDShead header(ROM); header.print(); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -