From 86b89793dcaf290206faeb7fe3100dd0a5f71d1d Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 30 May 2025 14:42:35 +0200 Subject: global: architectural changes, see commit details. refactor: Refactor libSystem, user frameworks, and preparing for OpenMSG. feat: Jail info client structure (libSystem) feat: Document what the RTime is doing starting from line 504. feat: use `int 50` instead of `syscall` for now. Signed-off-by: Amlal El Mahrouss --- tooling/mk_app.py | 2 +- tooling/mk_fwrk.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tooling') diff --git a/tooling/mk_app.py b/tooling/mk_app.py index 5ee6d5b7..7f7cef17 100755 --- a/tooling/mk_app.py +++ b/tooling/mk_app.py @@ -64,7 +64,7 @@ def create_directory_structure(base_path, project_name): proj_cpp_path = os.path.join(base_path, project_name, f"src/CommandLine.cc") - cpp_file = "#include \n\nSInt32 _NeMain(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" + cpp_file = "#include \n\nSInt32 _NeMain(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" with open(proj_cpp_path, 'w') as cpp_file_io: cpp_file_io.write(cpp_file) diff --git a/tooling/mk_fwrk.py b/tooling/mk_fwrk.py index e4e5d7de..b2ef99ff 100755 --- a/tooling/mk_fwrk.py +++ b/tooling/mk_fwrk.py @@ -56,7 +56,7 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name): "sources_path": [ ], - "output_name": f"./dist/{project_name}", + "output_name": f"./dist/lib{project_name}.dylib", "cpp_macros": [ "kSampleFWVersion=0x0100", "kSampleFWVersionHighest=0x0100", @@ -70,7 +70,7 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name): proj_cpp_path = os.path.join(base_path_fwrk, project_name, f"src/DylibMain.cc") - cpp_file = "#include \n\nSInt32 _DylibAttach(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" + cpp_file = "#include \n\nSInt32 _DylibAttach(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" with open(proj_cpp_path, 'w') as cpp_file_io: cpp_file_io.write(cpp_file) -- cgit v1.2.3 From 5d57377d3b1e5719ccef1baabbd1c48ff68861b8 Mon Sep 17 00:00:00 2001 From: 0xf00sec <159052166+0xf00sec@users.noreply.github.com> Date: Mon, 2 Jun 2025 21:01:55 +0000 Subject: Unsafe mem-op in mkfs.hefs. Buffer Overflow and Unsafe memory operations in mkfs.hefs. --- tooling/mkfs.hefs.cc | 287 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 195 insertions(+), 92 deletions(-) (limited to 'tooling') diff --git a/tooling/mkfs.hefs.cc b/tooling/mkfs.hefs.cc index fcb0c006..4a9ab4dd 100644 --- a/tooling/mkfs.hefs.cc +++ b/tooling/mkfs.hefs.cc @@ -7,123 +7,226 @@ #include #include #include +#include #include +#include +#include namespace detail { -/// @interal -/// @brief GB equation formula. +/// @internal +/// @brief GB‐to‐byte conversion (use multiplication, not XOR). static constexpr size_t gib_cast(uint32_t gb) { - return ((1024 ^ 3) * gb); + return static_cast(gb) * 1024ULL * 1024ULL * 1024ULL; } } // namespace detail static size_t kDiskSize = detail::gib_cast(4UL); static uint16_t kVersion = kHeFSVersion; -static std::u8string kLabel = kHeFSDefaultVolumeName; +static std::u8string kLabel; static size_t kSectorSize = 512; -/// @brief Entrypoint of tool. -int main(int argc, char** argv) { - if (argc < 2) { - mkfs::console_out() - << "hefs: usage: mkfs.hefs -L