How to hook to external library function, such as OpenGL for example.
I have a function used by the program I am trying to change behaviour of. The function is:
lVar17 = glfwCreateWindow(uVar22,uVar25,pplVar29,uVar30,0);
Now, I want to change that function without changing the caller function. I.e. the caller function and the call above will remain exactly the same, but the glfwCreateWindow will return something different, i.e. it will be re-written like this:
glfwCreateWindow (uVar22,uVar25,pplVar29,uVar30,0) {
GLFWwindow* window = glfwCreateWindow(uVar22,uVar25,pplVar29,uVar30,0);
HWND hwnd = FindWindow(NULL, WindowName);
GLFWwindow* atchdHwd = glfwAttachWin32Window(hwnd, window);
return atchdHwd;
}
Any way of doing this?