Calling a function through its address in memory in c / c++

前端 未结 6 741
天涯浪人
天涯浪人 2020-12-02 13:46

Given knowledge of the prototype of a function and its address in memory, is it possible to call this function from another process or some piece of code that knows nothing

6条回答
  •  鱼传尺愫
    2020-12-02 14:05

    It is definitely possible, but there are restrictions. Each process will have its own block of memory which other processes can't interfere with. Now, you will notice, I wrote it is definitely possible, this is through DLL injection (or code injection).

    We can use the typedef keyword to achieve this. Now, I see you've marked the answer as 'Answered' and it seems you've gotten on fine, this is just a notice for anyone else that may be interested.

提交回复
热议问题