resonance 1.0.1
Loading...
Searching...
No Matches
filelog.h File Reference
#include <fstream>
Include dependency graph for filelog.h:

Go to the source code of this file.

Functions

void InitFileIOLog (char *pszPath)
 Open the file log.
void CloseFileIOLog ()
 Close the file log, if it is open.
void PrintToFileIOLog (const char *pszText)
 Write one line to the file log, if it is open.

Variables

constexpr int kFileLogPathSize = 0x40
 Bytes of logfilename.
std::fstream gFileIOLog
 The log of the files the file layer opens.
int bFileLogging
 Non-zero while gFileIOLog is open.
char logfilename [kFileLogPathSize]
 The path gFileIOLog was opened on.

Function Documentation

◆ InitFileIOLog()

void InitFileIOLog ( char * pszPath)

Open the file log.

The path is recorded in logfilename and the file is opened for output. No call site exists.

Parameters
pszPathThe path of the log file.
Ghidra address:
NTSC-U/C: 0x0047ddf0
Ghidra address:
PAL: 0x004bbac8

◆ CloseFileIOLog()

void CloseFileIOLog ( )

Close the file log, if it is open.

HxScript's memlog_term binding calls it at 0x00155e0c.

Ghidra address:
NTSC-U/C: 0x0047de48
Ghidra address:
PAL: 0x004bbb20

◆ PrintToFileIOLog()

void PrintToFileIOLog ( const char * pszText)

Write one line to the file log, if it is open.

No call site exists. FileOpen() expands the same body inline.

Parameters
pszTextThe line, without its line break.
Ghidra address:
NTSC-U/C: 0x0047de88
Ghidra address:
PAL: 0x004bbb60

Variable Documentation

◆ kFileLogPathSize

int kFileLogPathSize = 0x40
constexpr

Bytes of logfilename.

The next initialised data begins 0x40 bytes after the buffer, which bounds it. No routine in the image tests the length of a path it copies in.

◆ gFileIOLog

std::fstream gFileIOLog
extern

The log of the files the file layer opens.

The file layer's translation unit constructs it in its static initialiser at 0x0047dc18. The ios virtual base sits at +0x70. FileOpen() at 0x0047c9c0 writes a line to the output side for every file it opens while the log is open. It is distinct from the allocation log behind g_szMemLogPath.

Ghidra address:
NTSC-U/C: 0x006ee280
Ghidra address:
PAL: 0x00731ca0

◆ bFileLogging

int bFileLogging
extern

Non-zero while gFileIOLog is open.

Ghidra address:
NTSC-U/C: 0x006ee320
Ghidra address:
PAL: 0x00731d40

◆ logfilename

char logfilename[kFileLogPathSize]
extern

The path gFileIOLog was opened on.

FileOpen() compares every path it opens against this one and does not log the log file itself.

Ghidra address:
NTSC-U/C: 0x006ee378
Ghidra address:
PAL: 0x00731d98