views:

145

answers:

1

Background

I am playing Imperishable Night, one of the Touhou series of games. The shoot button is 'z', moving slower is 'shift', and the arrow keys move. Unfortunately for me, using shift-z ghosts my right arrow key, so I can't move to the right while shooting. This ghosting happens in all applications, and switching keyboards fixes it.

Goal

I want to locate in the disassembled code the directx function that gets the keyboard input and compares it against the 'z' key, and change that key to 'a'. I'm considering this a fun project. Assuming the size of the scan codes are the same, this should be fairly simple. And because the executable is only 400k, maybe this will provide a unique opportunity for me to explore the dark side of the computing underworld (kidding).

Relevant experience

I have some experience with coding in assembly, but not in the disassembly of such. I have no experience with the DirectX apis.

Question

I need some guidance. I've found a listing of directx keyboard scan codes, and a program called PEExplorer that looks like it will do what I need.

Is there a means by which I can turn some of the assembly with C function calls so it's more easily read? I will need to locate where the game retrieves the currently pressed keys, compares those against a list, and it's that list I need to modify.

Any input would be greatly appreciated.

+5  A: 

You might be interested in the Detours library from Microsoft Research, it allows you to hook function calls and alter their arguments. Doing that your code can change the scan codes of keys that don't ghost into the ones the game expects.

AlcariTheMad