mirror of
https://github.com/thunderbrewhq/binana.git
synced 2026-05-05 14:03:51 +00:00
feat(build): implement Clangd support && add lua symbols
This commit is contained in:
parent
6163593844
commit
e79ee08905
78 changed files with 399 additions and 5445 deletions
|
|
@ -1,82 +1,55 @@
|
|||
#ifndef BC_FILE_FILESYSTEM_H
|
||||
#define BC_FILE_FILESYSTEM_H
|
||||
|
||||
#include "bc/systemfile/stacked.h"
|
||||
|
||||
DECLARE_ENUM(Blizzard__File__Operation);
|
||||
#include "system/detect.h"
|
||||
|
||||
DECLARE_STRUCT(Blizzard__File__Filesystem);
|
||||
DECLARE_STRUCT(Blizzard__File__Functions);
|
||||
|
||||
// invented enum
|
||||
enum Blizzard__File__Operation {
|
||||
cd,
|
||||
close,
|
||||
create,
|
||||
cwd,
|
||||
dirwalk,
|
||||
exists,
|
||||
flush,
|
||||
getfileinfo,
|
||||
getfreespace,
|
||||
getpos,
|
||||
getrootchars,
|
||||
isabspath,
|
||||
isreadonly,
|
||||
makeabspath,
|
||||
mkdir,
|
||||
move,
|
||||
copy,
|
||||
open,
|
||||
read,
|
||||
readp,
|
||||
rmdir,
|
||||
setcachemode,
|
||||
seteof,
|
||||
setfileinfo,
|
||||
setpos,
|
||||
unlink,
|
||||
write,
|
||||
writep,
|
||||
shutdown,
|
||||
num_operations
|
||||
typedef uintptr_t offset_in_Blizzard__File__Functions_to_System_File__Stacked__FileFunc;
|
||||
|
||||
#include "bc/systemfile/stacked/filefunc.h"
|
||||
#include "bc/util/offset.h"
|
||||
|
||||
struct Blizzard__File__Functions {
|
||||
System_File__Stacked__FileFunc cd;
|
||||
System_File__Stacked__FileFunc close;
|
||||
System_File__Stacked__FileFunc create;
|
||||
System_File__Stacked__FileFunc cwd;
|
||||
System_File__Stacked__FileFunc dirwalk;
|
||||
System_File__Stacked__FileFunc exists;
|
||||
System_File__Stacked__FileFunc flush;
|
||||
System_File__Stacked__FileFunc getfileinfo;
|
||||
System_File__Stacked__FileFunc getfreespace;
|
||||
System_File__Stacked__FileFunc getpos;
|
||||
System_File__Stacked__FileFunc getrootchars;
|
||||
System_File__Stacked__FileFunc isabspath;
|
||||
System_File__Stacked__FileFunc isreadonly;
|
||||
System_File__Stacked__FileFunc makeabspath;
|
||||
System_File__Stacked__FileFunc mkdir;
|
||||
System_File__Stacked__FileFunc move;
|
||||
System_File__Stacked__FileFunc copy;
|
||||
System_File__Stacked__FileFunc open;
|
||||
System_File__Stacked__FileFunc read;
|
||||
System_File__Stacked__FileFunc readp;
|
||||
System_File__Stacked__FileFunc rmdir;
|
||||
System_File__Stacked__FileFunc setcachemode;
|
||||
System_File__Stacked__FileFunc seteof;
|
||||
System_File__Stacked__FileFunc setfileinfo;
|
||||
System_File__Stacked__FileFunc setpos;
|
||||
System_File__Stacked__FileFunc unlink;
|
||||
System_File__Stacked__FileFunc write;
|
||||
System_File__Stacked__FileFunc writep;
|
||||
System_File__Stacked__FileFunc shutdown;
|
||||
};
|
||||
|
||||
#define FS_OP(N) bool (*N)(Blizzard__File__Filesystem* fs, System_File__Stacked__FileParms* parms)
|
||||
BC_OFFSET_INTO(Blizzard__File__Functions, System_File__Stacked__FileFunc);
|
||||
|
||||
// 0x7C bytes = 4 + 4 + (29 * 4)
|
||||
//
|
||||
struct Blizzard__File__Filesystem {
|
||||
Blizzard__File__Filesystem* base;
|
||||
Blizzard__File__Filesystem* next;
|
||||
|
||||
FS_OP(cd);
|
||||
FS_OP(close);
|
||||
FS_OP(create);
|
||||
FS_OP(cwd);
|
||||
FS_OP(dirwalk);
|
||||
FS_OP(exists);
|
||||
FS_OP(flush);
|
||||
FS_OP(getfileinfo);
|
||||
FS_OP(getfreespace);
|
||||
FS_OP(getpos);
|
||||
FS_OP(getrootchars);
|
||||
FS_OP(isabspath);
|
||||
FS_OP(isreadonly);
|
||||
FS_OP(makeabspath);
|
||||
FS_OP(mkdir);
|
||||
FS_OP(move);
|
||||
FS_OP(copy);
|
||||
FS_OP(open);
|
||||
FS_OP(read);
|
||||
FS_OP(readp);
|
||||
FS_OP(rmdir);
|
||||
FS_OP(setcachemode);
|
||||
FS_OP(seteof);
|
||||
FS_OP(setfileinfo);
|
||||
FS_OP(setpos);
|
||||
FS_OP(unlink);
|
||||
FS_OP(write);
|
||||
FS_OP(writep);
|
||||
FS_OP(shutdown);
|
||||
Blizzard__File__Filesystem* original;
|
||||
Blizzard__File__Filesystem* next;
|
||||
Blizzard__File__Functions verbs;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
#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
|
||||
int32_t attributes;
|
||||
Blizzard__Time__Timestamp createtime;
|
||||
Blizzard__Time__Timestamp lastwritetime;
|
||||
Blizzard__Time__Timestamp lastaccesstime;
|
||||
int32_t filetype;
|
||||
int32_t normal;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -4,17 +4,18 @@
|
|||
DECLARE_ENUM(Blizzard__File__Mode);
|
||||
|
||||
enum Blizzard__File__Mode {
|
||||
read = 0x0001,
|
||||
write = 0x0002,
|
||||
shareread = 0x0004,
|
||||
sharewrite = 0x0008,
|
||||
nocache = 0x0040,
|
||||
temporary = 0x0080,
|
||||
truncate = 0x0100,
|
||||
append = 0x0200,
|
||||
create = 0x0400,
|
||||
mustnotexist = 0x0800,
|
||||
mustexist = 0x1000
|
||||
read = 0x0001,
|
||||
write = 0x0002,
|
||||
shareread = 0x0004,
|
||||
sharewrite = 0x0008,
|
||||
async = 0x0020, // confirmed
|
||||
nocache = 0x0040, // confirmed
|
||||
temp = 0x0080, // confirmed
|
||||
truncate = 0x0100, // confirmed
|
||||
append = 0x0200, // confirmed
|
||||
recreate = 0x0400, // confirmed
|
||||
cantexist = 0x0800,
|
||||
mustexist = 0x1000
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
DECLARE_STRUCT(Blizzard__File__ProcessDirParms);
|
||||
|
||||
struct Blizzard__File__ProcessDirParms {
|
||||
const char* dir;
|
||||
const char* item;
|
||||
void* param;
|
||||
bool isdir;
|
||||
const char* pathRoot;
|
||||
const char* filename;
|
||||
void* cookie;
|
||||
bool isDir;
|
||||
};
|
||||
|
||||
typedef bool (*Blizzard__File__ProcessDirCallback)(const Blizzard__File__ProcessDirParms* parms);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,20 +1,23 @@
|
|||
#ifndef BC_FILE_STREAM_H
|
||||
#define BC_FILE_STREAM_H
|
||||
|
||||
#include "bc/file/info.h"
|
||||
|
||||
DECLARE_STRUCT(Blizzard__File__StreamRecord);
|
||||
|
||||
// Stream is defined as a pointer to StreamRecord
|
||||
typedef Blizzard__File__StreamRecord* Blizzard__File__Stream;
|
||||
|
||||
#include "bc/file/fileinfo.h"
|
||||
#include "bc/file/streaminginfo.h"
|
||||
|
||||
struct Blizzard__File__StreamRecord {
|
||||
void* filehandle;
|
||||
int32_t mode;
|
||||
bool haveinfo;
|
||||
uint32_t unk0C;
|
||||
Blizzard__File__FileInfo info;
|
||||
// GetFileInfo only gets a size if this is null or points to a zero value
|
||||
int32_t* unk48;
|
||||
char* name; // name is a pointer to &filehandle (0x00) + sizeof(StreamRecord)
|
||||
// extra buffer that holds the actual data of name
|
||||
void* fileHandle;
|
||||
int32_t mode;
|
||||
bool infoValid;
|
||||
uint32_t unk0C; // not present in Diablo 3 Switch
|
||||
Blizzard__File__FileInfo info;
|
||||
Blizzard__File__StreamingInfo* streaming; // GetFileInfo only gets a size if this is null or points to a zero value
|
||||
char* pathname; // name is a pointer to &filehandle (0x00) + sizeof(StreamRecord)
|
||||
// extra buffer that holds the actual data of name
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
#ifndef BC_MAIN_H
|
||||
#define BC_MAIN_H
|
||||
|
||||
#include "bc/file/filesystem.h"
|
||||
#include "bc/file/stream.h"
|
||||
#include "bc/file/processdir.h"
|
||||
#include "bc/lock/do_once.h"
|
||||
#include "bc/string/quicknativepath.h"
|
||||
#include "bc/systemfile/stacked.h"
|
||||
#include "bc/os/file.h"
|
||||
#include "bc/os/file_data.h"
|
||||
#include "bc/time/timestamp.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#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
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#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"
|
||||
#include "bc/file/mode.h"
|
||||
|
||||
DECLARE_STRUCT(System_File__Stacked__FileParms);
|
||||
|
||||
struct System_File__Stacked__FileParms {
|
||||
// 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;
|
||||
Blizzard__File__FileInfo noinfo;
|
||||
uint32_t setinfo;
|
||||
// something to do with file info
|
||||
// used by:
|
||||
// Blizzard::File::GetFileInfo
|
||||
// set to -1
|
||||
uint32_t getinfo;
|
||||
Blizzard__File__Mode mode; // 0x58
|
||||
void* data; //
|
||||
uint32_t count;
|
||||
int64_t offset;
|
||||
int32_t whence;
|
||||
char* buffer;
|
||||
int32_t buffersize;
|
||||
bool recurse;
|
||||
// something to do with MakeAbsolutePath? (normalize? resolve? resolvesymlinks?)
|
||||
bool canonicalize;
|
||||
void* dirwalkparam;
|
||||
Blizzard__File__ProcessDirCallback dirwalkcallback;
|
||||
// set to false by Blizzard::File::ProcessDirFast
|
||||
bool unk88;
|
||||
bool overwrite;
|
||||
bool set_acl; // something that causes a security descriptor to be generated in mkdir() (takeownership? chown? )
|
||||
uint32_t unk8C;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef BC_TIME_TIMESTAMP_H
|
||||
#define BC_TIME_TIMESTAMP_H
|
||||
|
||||
typedef int64_t Blizzard__Time__Timestamp;
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue