Comments (8)
Sadly this is impossible without modifying detour source itself. I'll probably redisign it a bit, shortly.
from blackbone.
Alright, no worries.
Another thought - if there was some method like Detour.Original(...)
then this would allow us to execute our both before and after which is pretty useful.
Cheers!
from blackbone.
You could potentially copy over the last few bytes by including a function that searches through the function for 0xC3 (RET) and other wanted bytes for "return x;". It would look something like->
void *retloc = SaveReturn(function, detour);
I could try to make it if you're too busy DarthTon (though I suck at git in general ._. ).
from blackbone.
Yeah, pull request will be nice.
from blackbone.
Can you not Returntype::new remove detour call original save result reapply detour and then return your value or the new value depending on criteria?
from blackbone.
I think current version support it already. My example code is working:
#define BLACKBONE_STATIC
#include <LocalHook/LocalHook.hpp>
#pragma comment(lib,"BlackBone.lib")blackbone::Detour<decltype(&MessageBoxA)> det;
int WINAPI myMessageBoxA(
In_opt HWND & hWnd,
In_opt LPCSTR & lpText,
In_opt LPCSTR & lpCaption,
In UINT & uType)
{
return det.CallOriginal((HWND&&)hWnd, (LPCSTR&&)"Test", (LPCSTR&&)lpCaption, (UINT&&)uType);
return 0;
}int _tmain(int argc, _TCHAR* argv[])
{
decltype(&MessageBoxA) orgaddr = (decltype(&MessageBoxA))GetProcAddress(GetModuleHandleA("user32.dll"), "MessageBoxA");
bool tmp = det.Hook(orgaddr, &myMessageBoxA, blackbone::HookType::HWBP,blackbone::CallOrder::NoOriginal,blackbone::ReturnMethod::UseNew);MessageBoxA(0, 0, 0, 0);
det.Restore();
return 0;
}
from blackbone.
i have problem on blackbone detour.
im try input this. but (blackbone::Detour Detour;) no declaration. can help me? thanks.
from blackbone.
oh solved. thank you..
need "LocalHook.hpp"
from blackbone.
Related Issues (20)
- Question
- cannot open file BlackBone.lib HOT 8
- MmapDll MmapDll HOT 1
- Map two DLLs HOT 2
- Attach to blender,and call Init routine crash
- BlackBone copy memory HOT 1
- BlackBone: ManualMap: Failed to get import 'StrChrA' from image 'shlwapi.dll'
- MmapDll Driver
- missing WINVER_10_21H2 offsets. HOT 1
- How to run my c++ code in remote process
- Driver().EnsureLoaded() returns -1073741772 HOT 5
- MapInHighMem HOT 1
- memory leak
- blackbone visualstudio 2022 build error HOT 4
- Windows 22H2 support/Windows 11 support HOT 3
- ldasm return value error
- Does not build on VS2022 17.5.4 HOT 6
- BBMMapDriver函数PsCreateSystemThread没有释放句柄
- Remote call causes the target process to crash
- Windows enterprise maunalmap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blackbone.