Add macOS support

This commit is contained in:
momo5502
2025-01-05 17:07:12 +01:00
parent 0791b0fca7
commit 6b172f5e78
10 changed files with 61 additions and 22 deletions

View File

@@ -834,7 +834,7 @@ namespace
const auto mod = c.proc.mod_manager.find_by_address(base_address);
if (!mod)
{
printf("Bad address for memory image request: 0x%zX\n", base_address);
printf("Bad address for memory image request: 0x%" PRIx64 "\n", base_address);
return STATUS_INVALID_ADDRESS;
}
@@ -1487,7 +1487,7 @@ namespace
for (const auto& file : std::filesystem::directory_iterator(dir))
{
files.emplace_back(file.path().filename());
files.emplace_back(file_entry{.file_path = file.path().filename(),});
}
return files;
@@ -2899,13 +2899,8 @@ namespace
const auto filename = read_unicode_string(c.emu, emulator_object<UNICODE_STRING<EmulatorTraits<Emu64>>>{c.emu, attributes.ObjectName});
const auto u8_filename = u16_to_u8(filename);
#ifdef OS_WINDOWS
struct _stat64 file_stat{};
if (_stat64(u8_filename.c_str(), &file_stat) != 0)
#else
struct stat64 file_stat{};
if (stat64(u8_filename.c_str(), &file_stat) != 0)
#endif
{
return STATUS_OBJECT_NAME_NOT_FOUND;
}
@@ -3199,7 +3194,7 @@ namespace
}
else
{
printf("Unsupported thread attribute type: %zX\n", type);
printf("Unsupported thread attribute type: %" PRIx64 "\n", type);
}
}, i);
}