How to hook functions (MinHook, x86 and x64)
Vložit
- čas přidán 27. 08. 2024
- We learn how to use the MinHook library to hook/detour functions in x86 and x64
- Music: Alchemorph - Memories
- Code: github.com/Cas...
- Community Discord: / discord
Resources:
- MinHook: github.com/Tsu...
- Help from Fyrahh and tomsa ;)
This channel is a gem. Keep up the videos
woo hoo, another video! Keep the great work up!!!
ty :) I'll try to not slack for too long before the next one
That's what i was waiting for! Great job, m8! Keep it up!
sheesh u just keep uploading tysm I love these vids u explain well
You always drop banger videos
thanks m8
Glad your back!
was I gone? ^^ one month since the last legit video.. not too bad for me :P
@@casualgamer1791 Glad your posting regularly again =)
Can you create a vid on how to reverse and call functions. I am having a hard time understanding a few things. Btw great vid.
will do
Ahh finally fresh video
Question: when hooking the function from a memory address, I don't see you get the modules base address. Does min hook handle this for you when it hooked the function? Should I use the relative address?
nope. because its an internal c++ hack, the dll is in the process itself means we're the processor we can just use the address without a problem. he made a video about that
self loading dll: czcams.com/video/uuMg7CeJF1k/video.html
Keep going i love your videos :3
@10:14 did you ever make a video explaining how to reverse functions?
♥️Great Dude ;)
Thank you very much man ! You are the best
:)
__asm doesn't work for x64 sadly. Does someone know an alternative?
Edit: look up rtlcapturecontext
Afaik it works if you use gcc/g++ instead of MSVC.
another banger
This doesn't work - first I found out I couldn't call AllocConsole from my dll, my debug prints showed that, but after removing that the code says everything is fine even though _nothing_ hints at the function being hooked.
10:00
i tried this, and i tried to get the value of eax register using the inline asm mov operation and compare it in CE. it's not the same. why is that?
EAX is a register. You can think of it kind of like a global variable as such it changes all the time.
@@casualgamer1791 thanks for replying.
I was trying to hook a function in another game I'm playing, and without changing anything just immediately call the original function, the game crash.
After debugging with the disassembly window visual studio provided, i noticed that the registers has been changed before calling the actual original function, which i think is causing the game crash.
And the value passed to the hooked function has changed too before calling the original function.
That could be. Most likely it is the calling convention tho. Have you made sure the function you detour and the detour function have the same calling convention? In my case i restore ecx after cout because with my function cx is a parameter eventho the calling convention would not suggest it is but that is kinda unusual
@@casualgamer1791 yes, I'm sure the calling convention is right, which is __fastcall.
Or maybe it's not.
Anyway thanks for replying, i will look more into this calling convention thing😁
Feel free to post the asm in the discord server in case u get stuck
Hey, thank you for great tutorials, love em.
but can you please consider to create one that teach us how to find certain function that we want to hook? thank you.
Great idea!
I'll make at least an introduction into that. But be warned a lot of practice goes into reversing which realy can not be replaced by watching tutorials ^^
@@casualgamer1791 thank you, yes I know, but we at least need to know what to practice... 😅
so giving us an starting point would be awsome.
Hello great video as always could you please explain what the last parameter of create hook does?
Ngl your pretty good at teaching when I’m done with learning cpp I might have to make videos like you
tyvm :) both my parents are teachers guess I learned a bit from them
make full hooking tutorial for beginners.
thanks in advance
nicely explained ty
Hi! Thank you for this video! Does this library supports Trampoline method of hooking functions?
Thats the one and only thing this lib supports ;)
@@casualgamer1791 Ah very good thanks :D
Thank you for your interesting videos.
Could you record a video about how to use opencv to write a program that can be manually trained to recognize characters (letters). Let's say the symbol J is on the screen(it can be of different colors or sizes), you need to save it and at the next similar symbol, the program will recognize this symbol J and pressed the corresponding key?(for mini-games) (If, of course, I have clearly translated my thought through a translator, and this topic may be interesting to you and the audience).
(Example, not advertising) czcams.com/video/qb3UuQrHmbY/video.html
Interesting idea but i am not sure if opencv is the best library for that. Maybe tesseract?
Here I found: czcams.com/video/CK0OCeCN9zg/video.html
But this is designed for a ready-made database, and not training it in real time
Bro How to fix Linker Tools Error LNK1181 can’t open file libminhook.lib
thanks easy to explanation
can you also add new character in the game and add code to it using hooking
Hey, not sure if your still active. Could you please provide some insight on hooking and return values from registers on a 32-Bit game. I'd really appreciate it.
I am and I will. Just very buissy atm ;(
@@casualgamer1791 Hopefully it's soon. I'm trying to finish a cheat I'm creating but have no idea how to go about hooking externally. For me the entity is in the register EDX when I debug. Anyways though I been researching and going through open source code but, It's just not clicking in my brain at the moment. Hopefully it will come to me very soon.
Gl m8. You can always ask for help on the discord server :)
can i hook a function which not window function ?
certainly, "just" gotta figure out the location and calling convention
@@casualgamer1791 MinHook can hooking internal functions in C# ?
Still waiting for the how to reverse functions video :D
Still learning myself. Most of it is practice. The general theroy aint that deep
What about mid function hooks.. can Minhook do that too?
I do not think it is intended for that purpose no but you could try it just passing the pointer to the location inside the function instead of the beginning
@@casualgamer1791 That is exactly my plan, the only problem is the calling convention, do I make it the same as the start of the func or because it is the middle it should change maybe??
@darwin because calling arguments on the start of the hook of a func, set registries to be X Y Z... through the func the registry changes and now you are telling me that I can pull a fast call with arguments in the middle of no where
@darwin i didnt ask if the impossible was possible in my question i just asked for a possible way
@@mateokladaric i know this comment is a year old but you can do a midfunction hook by doing everything in this video except your detour function must be a declspec naked with no paramateres and the type def for the function should be a void return type with no pararmetres one final reaquirment is inside the detour function you must use inline assembly and do a jump(jmp) to the orignal function pointer
Bro i have esp andlua can crack ?
epic stuff
Make tutorial Edit Packets Game Online please Bro. Thank you
;-; you were to late i learned minhook like 2 days ago
it was a pain
unfortunate timing ^^
ikr
can you make one for directx 11 pls ?
Will do. Probably my next video
10:24 memo
Discord link expired
fixed
Bro make a video in gameloop emulator hooking
Will this allow me to inject into warzone?
Please make bot for clash of clans to android
dllinject failed. "MinHook.x86.dll", the system cannot find the specific file. ç.ç
don't make the same mistake as I did; instead of putting the lib and include folder in \source
epos\TestDll I put them in \source
epos\TestDll\TestDll