my Problem is, i have bought a Huion Kamvas 22 Plus pen display for drawing and painting.

On my old Wacom tablet i had some hardware buttons and could map functions/setting of the driver to these hardware buttons.

The new Huion Monitor doesnt have any Hardware Buttons! Thats ok , i just use keyboard shortcuts anyways ...

But theres one problem,

the huion driver window has a function called "switch screen". with that i can switch the mouse output from the Pen to another monitor (in a multi monitor setup). This cant be mapped to any keyboard shortcut though , just (eventual) hardware buttons which come with the huion displays. As i mentioned, my model(the Kamvas 22 plus) doesnt have any buttons though.

Now i want to


find the specific function/argument in a file called "TabletDriverCore.exe" or any of its loaded dlls

and B)

run this function(+ correct arguments) from the command line / autohotkey / whatever

is that possible and how would i achieve that ?

  • This is definitely possible if you are sure the function is inside the TabletDriverCore.exe and the application is the same for all the devices. I would use the old tablet to find the hardware buttons handling function and from there look for the "switch screen" one.
    – morsisko
    Feb 21, 2021 at 1:23

1 Answer 1


Yes this is absolutely possible.

  • First, you need to attach a debugger to the executable file and play around with the functionality you are interested in (i.e use it multiple times while keeping an eye on the debugger, stack, interesting memory regions, etc... Usually the shortest path for finding a function is by looking for string/values references and tracing back from there) until you are able to find the starting address of the function in the EXE file (or one of the loaded modules).
  • After finding the function, you need to check the parameters as well as their correct data types, that's a bit of static analysis where you try to analyze the stack and the type of arithmetic instructions (for instance imul vs mul).
  • Now you've got both the function address and the correct parameters, from there you can code a DLL that gets injected into that executable on runtime, then hooks the target function and map it to whatever keyboard key(s) you want.

This trick is used extensively in game hacks and trainers, especially trainers that use the printing functions of a game to print some custom values at runtime.

  • Hello, thanx . Yes its most probably that exe.its easy to see in process explorer lighting up on switch screen (now mapped to one of the pen buttons) and if i kill the exe the pen and the switch screen dont work anymore. But i think this is above my head, i think i could manage to write a dll (would be my first), if i knew the correct function and parameters. but debugging isanother thing of its own where one needs to be confident and trained i guess. ill try my best though, do you recommend any easy to use and understand debugger? Feb 21, 2021 at 17:59
  • For me, I use x64dbg, but really whatever debugger you are comfortable with should work fine. You need to attach the debugger to the process, try to find any references (strings or anything else) for the functionality you are trying to trace, and start from there to trace back until you reach to the function header and be able to see the pushed parameters. It's indeed a bit tricky, there are no way that simplifies such task (at least to my knowledge). Feb 22, 2021 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.