{"id":18029277,"url":"https://github.com/std-microblock/blook","last_synced_at":"2025-08-20T04:31:51.807Z","repository":{"id":247019258,"uuid":"818098868","full_name":"std-microblock/blook","owner":"std-microblock","description":"A modern C++ library for hacking.","archived":false,"fork":false,"pushed_at":"2024-09-08T03:29:41.000Z","size":2165,"stargazers_count":57,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-22T18:02:33.905Z","etag":null,"topics":["aob","aob-scan","game-hacking","hacking","hook","inline-hook","memory-scanning"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/std-microblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-21T05:22:16.000Z","updated_at":"2024-09-21T19:27:37.000Z","dependencies_parsed_at":"2024-07-18T10:49:48.025Z","dependency_job_id":"f89ee6fa-e8fb-44ed-b9d1-9a293a49df26","html_url":"https://github.com/std-microblock/blook","commit_stats":null,"previous_names":["microcber/blook","std-microblock/blook"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2Fblook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2Fblook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2Fblook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2Fblook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/std-microblock","download_url":"https://codeload.github.com/std-microblock/blook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230394228,"owners_count":18218707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aob","aob-scan","game-hacking","hacking","hook","inline-hook","memory-scanning"],"created_at":"2024-10-30T09:08:43.321Z","updated_at":"2024-12-19T07:06:04.132Z","avatar_url":"https://github.com/std-microblock.png","language":"C++","readme":"\u003e [!WARNING]\n\u003e This project is in a relatively early stage and is not ready for production. Use at your own risk.  \n\u003e 此项目仍较早期，不建议实际使用。\n\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./resources/icon.webp\" width=\"270\"\u003e\n\u003ch1 style=\"margin-top: -30px;\"\u003e\u0026nbsp;\u0026nbsp;blook\u003c/h1\u003e\n\u003ch4\u003eA modern C++ library for hacking.\u003c/h4\u003e\n\u003c/div\u003e\n\n## So what?\n\nInline hook a function? Easy!\n\n```cpp\nauto process = blook::Process::self();\nauto hook = process-\u003emodule(\"user32.dll\").value()\n                   -\u003eexports(\"MessageBoxA\")\n                   -\u003einline_hook();\n    hook-\u003einstall([=](int64_t a, char *text, char *title, int64_t b) {\n        // DRY: All types are only written once!\n        return hook-\u003ecall_trampoline\u003cint64_t\u003e(a, \"oh yes\", text, b);\n    });\n\nMessageBoxA(nullptr, \"hi\", \"hi\", 0);\n```\n\n...hook more? Sure!\n\n```cpp\nauto process = blook::Process::self();\nauto mod = process-\u003emodule(\"user32.dll\").value();\nfor (auto\u0026 func: mod.obtain_exports()) {\n    auto hook = mod\n                -\u003eexports(func)\n                -\u003einline_hook();\n    hook-\u003einstall([=](int64_t a) -\u003e int64_t {\n        // Yes, capture anything you want!\n        std::cout \u003c\u003c \"Someone called: \" \u003c\u003c std::hex \u003c\u003c func \u003c\u003c \"\\n\";\n        return hook-\u003ecall_trampoline\u003cint64_t\u003e(a);\n    });\n}\n```\n\nHow about hooking a method that's not exported?\n\n```cpp\nauto process = blook::Process::self();\nauto mod = process-\u003emodule().value();\n// Let's find the specific function in .text (Code Segment) with blook's AOB shortcut!.\nauto text_segment = mod-\u003esection(\".text\").value();\nusing ANYp = blook::memory_scanner::ANYPattern;\nauto hook = text_segment.find_one({\n    0x55, 0x56, 0x57, 0x48, 0x83, 0xec, 0x70, 0x48, 0x8d, 0x6c, 0x24, 0x70,\n    0x48, 0xc7, 0x45, 0xf8, 0xfe, 0xff, 0xff, 0xff, 0x48, 0x89, 0xce, 0x48,\n    0x8d, 0x7d, 0xd0, 0x48, 0x89, 0xfa, 0xe8, 0x44, ANYp, ANYp, ANYp\n})-\u003esub(-0x28).as_function().inline_hook();\n\n// And now it's easy to hook it.\nhook-\u003einstall([=](int64_t a) -\u003e int64_t {\n    std::cout \u003c\u003c \"Someone called some internal function!\\n\";\n    return hook-\u003ecall_trampoline\u003cint64_t\u003e(a);\n});\n```\n\n## Getting started\n\n### Compile\n\nClone the repository to local, and build it with cmake!\n\n### Using in a CMake project\n\n### a) git submodule\n\nFirst, add the repo as submodule.\n\n```shell\ngit submodule add https://github.com/MicroCBer/blook\ngit submodule update --init --recursive\n```\n\nThen, import it and add it to your project in `CMakeLists.txt`\n\n```cmake\nadd_subdirectory(external/blook)\ntarget_link_libraries(your_target blook)\n```\n\n### b) CMake FetchContent\n\nAdd those lines into your `CMakeLists.txt`\n\n```cmake\ninclude(FetchContent)\n\n###### Fetch blook from GitHub #####\nFetchContent_Declare(\n        blook\n        GIT_REPOSITORY https://github.com/MicroCBer/blook\n        GIT_TAG origin/main\n)\nFetchContent_MakeAvailable(blook)\n####################################\n\ntarget_link_libraries(your_target blook)\n```\n\n### Manual installation\n\nIt's strongly discouraged to use the project without CMake, but it should be possible.\n\n## Platforms\n\n- std::function to function pointer [Windows x86/x64]\n- Inline Hook [Windows x86/x64]\n- Cross reference [Windows x86/x64]\n- AOB Scanning [Windows x86/x64]\n- Reassembly [Windows x86/x64]\n- Disassembly [Windowx x86/x64 (Zydis)]\n- Foreign process memory operations [Windows x86/x64]\n\nLinux/Mac support WIP.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstd-microblock%2Fblook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstd-microblock%2Fblook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstd-microblock%2Fblook/lists"}