Code Monkey home page Code Monkey logo

Comments (4)

stevemk14ebr avatar stevemk14ebr commented on August 11, 2024 1

Thanks for the report and PR. I believe this error is due to your project structure. Polyhook is designed to be built as a lib and then linked, rather than included as a subdirectory. Including it this way has likely messed up the include cycles. But of course this should be supported too, as headers should include all the dependencies they need directly, so I have merged the PR.

from polyhook_2_0.

stevemk14ebr avatar stevemk14ebr commented on August 11, 2024

what is your build process and how is polyhook integrated into your project, did you copy particular header files directly into your project or are you building polyhook as a library and linking it.

Also what is the exact error you receive.

from polyhook_2_0.

ross-weir avatar ross-weir commented on August 11, 2024

Thanks for the response.

Exact errors:

'placeholders': a namespace with this name does not exist 
'placeholders': is not a member of 'std' 

I'm using cmake and polyhook is consumed as a subdirectory. I have not copied or moved header files, building as a static library and linking. My configuration is almost an exact copy of ExampleProject at the moment except added include paths and different lib paths given the slightly different directory structure.

from polyhook_2_0.

ross-weir avatar ross-weir commented on August 11, 2024

Build fails:

#include <Windows.h>
#include <iostream>
//#include <functional>
#include "polyhook2/Detour/x64Detour.hpp"
#include "polyhook2/CapstoneDisassembler.hpp"

FILE* std_handle;
PLH::x64Detour* handle_set_xp_detour;
PLH::x64Detour* handle_recv_pkt_detour;
PLH::CapstoneDisassembler dis(PLH::Mode::x64);

BOOL APIENTRY DllMain(HMODULE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved)
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hModule);
        AllocConsole();
        freopen_s(&std_handle, "conout$", "w", stdout);
        freopen_s(&std_handle, "conin$", "r", stdin);

        break;
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

Build succeeds:

#include <Windows.h>
#include <iostream>
#include <functional>
#include "polyhook2/Detour/x64Detour.hpp"
#include "polyhook2/CapstoneDisassembler.hpp"

FILE* std_handle;
PLH::x64Detour* handle_set_xp_detour;
PLH::x64Detour* handle_recv_pkt_detour;
PLH::CapstoneDisassembler dis(PLH::Mode::x64);

BOOL APIENTRY DllMain(HMODULE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved)
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hModule);
        AllocConsole();
        freopen_s(&std_handle, "conout$", "w", stdout);
        freopen_s(&std_handle, "conin$", "r", stdin);

        break;
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

from polyhook_2_0.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.