-
Notifications
You must be signed in to change notification settings - Fork 1
cm3d2.dll API
Geoffrey Horsington edited this page Jun 16, 2018
·
25 revisions
CM3D2.dll recognizes two filesystem types: Windows (0
) and Archive (1
).
Externally, a filesystem is a struct:
struct FileSystem {
int* internals_ptr; // Pointer to the internal structure
int fs_type; // Type of the filesystem (0 = windows, 1 = archive)
};
An internal file system consists of the following interfaces: InterfaceFileShare
, InterfaceFileSystemAnsi
, InterfaceFileSystemWide
, InterfaceFileSystemUtf8
, InterfaceFileSystem
.
Internally, the class of
The archives' internals contains the following values.
The location is in bytes and relative to structure's start address.
Type | Location (HEX) | Value | Notes |
---|---|---|---|
Address | 0 |
0x7FFF0F641A10 |
Pointer to a part of vftable for FileSystemArchive
|
Address | 8 |
0x7FFF0F6419E8 |
Pointer to compile-time constant; Value: 0xF8FF FFFF 7000 0000
|
Address | 10 |
0x7FFF0F641498 |
Pointer to a part of vftable for FileSystemArchive
|
Address | 18 |
0x7FFF0F641D88 |
Pointer to compile-time constant; Value: 0xF8FF FFFF 6000 0000
|
Address | 20 |
0x7FFF0F641A50 |
Pointer to a part of vftable for FileSystemArchive
|
Address | 28 |
0x7FFF0F641C30 |
Pointer to compile-time constant; Value: 0xF8FF FFFF 5000 0000
|
Value | 30 |
0x0000ADBA0DF0ADBA |
Junk? |
Value | 40 |
0x0 |
NULL |
Address | 48 |
NULL | |
Address | 50 |
qword, varies between runs | |
Value | 58 |
0x0 |
NULL |
Address | 60 |
qword, varies between runs | |
Value | 68 |
0x0 |
NULL |
Value | 70 |
0x0DF0ADBA00000000 |
Junk? |
Address | 78 |
0x7FFF0F6419D8 |
Pointer to vftable of FileSystemArchive
|
- Only the 4 top bytes are used fron
8
,18
and28
. Thus essentially they contain values70
,60
and50
respectively - qword at
0x7FFF26350DE8
contains a running counter (of how many filesystems are initialized?)
FileSystemArchive
has the following functions:
First VFTable
vftable1[5] => SetBaseDirectory(*this, char* path)
vftable1[8] => AddFolder(*this, char* path)
vftable1[9] => AddArchive(*this, char* path)
vftable1[10] => AddAutoPathForAllFolder(*this)
vftable1[13] => AddAutoPath(*this, char* path)
Third VFTable
vftable[0] => FileMemory* GetFile(*this_third, char* file_str)
vftable[2] => void* CreateList(*this_third, void* memory, char* path, ListType list_type)
vftable[8] => BOOL IsExistentFile(*this_third, char* path)
Fourth VFTable
vftable[0] => bool IsValid(*this)
Type | Location (HEX) | Value (at the time of debugging) | Notes |
---|---|---|---|
Address | 40 |
Pointer to AddFolder_Impl
|