-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i have a skill issue #60
Comments
I think it's because if (MH_CreateHook(target, _function, _original) != MH_OK || MH_EnableHook(target) != MH_OK) {
return Status::UnknownError;
} Just a guess, though. Didn't try it myself, but see if you can fix it by adding that |
uhh, it still happens sir, and seems it cant get swapchain info on second init, i try to init d3d11 and hook it, when program find out the target is not using d3d11 then hook d3d12, and can not hook present, but the part of hook to get g_pD3D12CommandQueue is fine |
I had a similar issue when trying to make a mod menu. What I did was hook a DX12 function to retrieve the command queue, sleep the thread for 2 seconds, then if the command queue was captured successfully, continue using DX12 as normal (hook the present function). Otherwise, unbind and shutdown kiero and reinitialize with D3D11 and then hook the present function. It's a bit of a hackish solution but it works. bool init() {
if (kiero::init(kiero::RenderType::D3D12) == kiero::Status::Success) {
kiero::bind(54, (void **)&oExecuteCommandLists, hookExecuteCommandLists);
std::this_thread::sleep_for(std::chrono::seconds(2));
if (commandQueue == nullptr) {
kiero::unbind(54);
kiero::shutdown();
return false;
}
kiero::bind(140, (void **)&oPresent, hookPresent);
return true;
}
return false;
}
void initCaller() {
if (init()) {
// we're using DX12
} else {
// reinitialize kiero with DX11 here and hook the present function
}
} |
uh i figured it out, the second bind's index(both dx11 dx12) refers to same swapchain address, and this make second hook failed, thank you mate |
well its like
kiero::init(kiero::RenderType::D3D11);
👇
kiero::bind(8, (void**)&oEndScene, hkEndScene);
👇
kiero::shutdown();
👇
kiero::init(kiero::RenderType::D3D11);
👇
kiero::bind(8, (void**)&oEndScene, hkEndScene);
the last bind will not work for some reason, and i tried on d3d12, things still happen, what can i do
The text was updated successfully, but these errors were encountered: