feat(profile): more bc routines

This commit is contained in:
phaneron 2025-03-06 16:40:31 -05:00
parent 1e6fb307de
commit fb267a5683
35 changed files with 818 additions and 2959 deletions

View file

@ -41,7 +41,7 @@ enum Blizzard__File__Operation {
num_operations
};
#define FS_OP(N) bool (*f_##N)(Blizzard__File__Filesystem* fs, System_File__Stacked__FileParms* parms)
#define FS_OP(N) bool (*N)(Blizzard__File__Filesystem* fs, System_File__Stacked__FileParms* parms)
// 0x7C bytes = 4 + 4 + (29 * 4)
struct Blizzard__File__Filesystem {

View file

@ -0,0 +1,22 @@
#ifndef BC_FILE_INFO_H
#define BC_FILE_INFO_H
#include "bc/time/timestamp.h"
DECLARE_STRUCT(Blizzard__File__FileInfo);
struct Blizzard__File__FileInfo {
char* name;
uint32_t unk04;
// uint32_t unk08;
// uint32_t unk0C;
uint64_t size; // 08
uint32_t attributes;
Blizzard__Time__Timestamp creationTime;
Blizzard__Time__Timestamp lastWriteTime;
Blizzard__Time__Timestamp lastAccessTime;
int32_t exists;
int32_t normal;
};
#endif

View file

@ -0,0 +1,15 @@
#ifndef BC_FILE_PROCESS_DIR_H
#define BC_FILE_PROCESS_DIR_H
DECLARE_STRUCT(Blizzard__File__ProcessDirParms);
struct Blizzard__File__ProcessDirParms {
const char* dir;
const char* item;
void* param;
bool isdir;
};
typedef bool (*Blizzard__File__ProcessDirCallback)(const Blizzard__File__ProcessDirParms* parms);
#endif

View file

@ -1,10 +1,19 @@
#ifndef BC_FILE_STREAM_H
#define BC_FILE_STREAM_H
#include "bc/file/info.h"
DECLARE_STRUCT(Blizzard__File__StreamRecord);
struct Blizzard__File__StreamRecord {
void* handle;
void* filehandle;
uint32_t flags;
bool haveinfo;
uint32_t unk0C;
Blizzard__File__FileInfo info;
int32_t* unk48;
char* name; // name is a pointer to &filehandle (0x00) + sizeof(StreamRecord)
// extra buffer that holds the actual data of name
};
#endif

View file

@ -0,0 +1,11 @@
#ifndef BC_LOCK_DO_ONCE_H
#define BC_LOCK_DO_ONCE_H
DECLARE_STRUCT(Blizzard__Lock__DoOnceData);
struct Blizzard__Lock__DoOnceData {
bool done;
int32_t atomic;
};
#endif

View file

@ -0,0 +1,15 @@
#ifndef BC_STRING_QUICK_NATIVE_PATH_H
#define BC_STRING_QUICK_NATIVE_PATH_H
#define BC_STRING_QUICK_NATIVE_PATH(N) \
typedef struct Blizzard__String__QuickNativePath_##N Blizzard__String__QuickNativePath_##N; \
struct Blizzard__String__QuickNativePath_##N { \
uint32_t length; \
char* path; \
char buffer[N]; \
}
BC_STRING_QUICK_NATIVE_PATH(300);
BC_STRING_QUICK_NATIVE_PATH(1024);
#endif

View file

@ -1,10 +1,35 @@
#ifndef BC_SYSTEM_FILE_STACKED_H
#define BC_SYSTEM_FILE_STACKED_H
#include "system/types.h"
#include "bc/file/stream.h"
#include "bc/file/info.h"
#include "bc/file/processdir.h"
DECLARE_STRUCT(System_File__Stacked__FileParms);
struct System_File__Stacked__FileParms {
uint32_t offset;
// the offset of the file operation
// inside Blizzard::File::Filesystem
uint32_t op; //0x0
// name/path to a file or directory
char* name; //0x4
char* newname; // 0x8
Blizzard__File__StreamRecord* file; // 0xC
Blizzard__File__FileInfo* info;
uint32_t extra[17]; // 0x10
uint32_t flags;
void* data; //
uint32_t count;
int64_t offset;
uint32_t unk__;
char* buffer;
int32_t buffersize;
bool unkbool1;
bool unkbool2;
void* dirwalkparam;
Blizzard__File__ProcessDirCallback dirwalkcallback;
uint32_t extra3[2];
};
#endif

View file

@ -0,0 +1,6 @@
#ifndef BC_TIME_TIMESTAMP_H
#define BC_TIME_TIMESTAMP_H
typedef int64_t Blizzard__Time__Timestamp;
#endif