mirror of
https://github.com/rvtr/TwlToolsRED.git
synced 2025-10-31 06:41:18 -04:00
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@564 7061adef-622a-194b-ae81-725974e89856
74 lines
2.0 KiB
C++
74 lines
2.0 KiB
C++
|
|
#ifndef CHECKER_H_
|
|
#define CHECKER_H_
|
|
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "types.h"
|
|
#include "nitro_romheader.h"
|
|
#include "banner.h"
|
|
#include "entry.h"
|
|
|
|
typedef struct
|
|
{
|
|
u8 entry_name_length:7; // ファイル名の長さ (0-127)
|
|
u8 entry_type :1; // ファイルエントリの場合は 0
|
|
} EntryInfo;
|
|
|
|
typedef enum
|
|
{
|
|
PRINT_LEVEL_0 = 0,
|
|
PRINT_LEVEL_1,
|
|
PRINT_LEVEL_2
|
|
} PrintLevel;
|
|
|
|
|
|
class Checker
|
|
{
|
|
private:
|
|
bool initialized;
|
|
FILE* gfp;
|
|
FILE* mfp;
|
|
void* gBuf;
|
|
void* mBuf;
|
|
u32 buffer_size;
|
|
ROM_FNTDir fntBuf[4096];
|
|
void* dirTableBuf;
|
|
|
|
public:
|
|
void Initialize( FILE* myGfp, FILE* myMfp, void* myGbuf, void* myMbuf, u32 size);
|
|
|
|
/* ヘッダを読むだけ */
|
|
bool LoadHeader( void* gHeaderBuf, void* mHeaderBuf);
|
|
|
|
/* ROMの特定領域に差がないかどうか調べる */
|
|
bool Diff( u32 g_offset, u32 g_size, u32 m_offset, u32 m_size, bool isDataOnly, PrintLevel print_enable);
|
|
|
|
void Finalize( void);
|
|
|
|
/* ROMのバナー領域に対して Diff をかける */
|
|
void AnalyzeBanner( RomHeader* gHeaderBuf, RomHeader* mHeaderBuf);
|
|
|
|
/* Overlayテーブルに登録されている各ファイルに対して Diff をかける */
|
|
void AnalyzeOverlay( RomHeader* gHeaderBuf, RomHeader* mHeaderBuf);
|
|
|
|
/* FNT と FAT を解析して、各ファイルに対して Diff をかける */
|
|
bool AnalyzeFNT( RomHeader* headerBuf, FILE* fp, Entry* entry, PrintLevel print_enable);
|
|
bool FindEntry( u32 fnt_offset, u16 entry_id, RomHeader* headerBuf, FILE* fp, Entry* entry, u16 parent_id, PrintLevel print_enable);
|
|
void FindAllocation( u16 entry_id, RomHeader* headerBuf, FILE* fp, Entry* entry, PrintLevel print_enable);
|
|
|
|
void CheckAllEntries( Entry* gEntry, Entry* mEntry);
|
|
|
|
/* ROM内のBMPファイルを全て切り出して出力する */
|
|
void ExportGenuineBmpFiles( Entry* gEntry, PrintLevel print_enable);
|
|
|
|
|
|
|
|
u32 GetOctValue( char* hex_char);
|
|
void FindAccessLogFile( Entry* entry, FILE* lfp);
|
|
|
|
};
|
|
|
|
#endif
|