I found a function that I would like to hook. The function looks that way:
undefined __register setVisible(int param_1, undefined param_2)
undefined AL:1 <RETURN>
int EAX:4 param_1
undefined DL:1 param_2
setVisible
XREF[3705]: [...]
0047c09c 88 50 18 MOV byte ptr [param_1 + 0x18],param_2
0047c09f c3 RET
My goal is to jump to my own function when this one is called. A jump to my own function will take 5 bytes while the function I want to replace is 4 bytes large, meaning that I would be overriding the function below (FUN_0047c0a0). I can obviously find a way to avoid having to hook this function by hooking the code that calls this function, but this one is being called from a lot of different functions and that does not seem to be the proper way to do.
Do you have any idea how I could manage to handle such a case, where a function is shorter than an hook?