changing enter to F2

Started by
8 comments, last by rain711 18 years, 8 months ago
Hi everybody: I have this EXE file it is for a game. When you run the game and when you hit [ENTER] on the keyboard A dialog is created that pop ups to enter some chat and send chat message. I would like to know if I can change the "ENTER" key with an F2 key. What I mean is that instead of hitting the "Enter" key on the keyboard I want to hit the F2 key (or anyother key) to perform the same task described above. I appreciate your responce.
Advertisement
This is possible. However, you would require a disassembler or hex editor of some sort, also probably a debugger or assembly tracer, and a good knowledge of the structure of PE type executables. With these tools and skills, you would be able through repeated testing and experimentation to trace the command that compares a value received from the keyboard to a value stored in the program, and change the value stored in the program (probably a scancode, but not necessarily) from that of the Enter key to that of the F2 key.

That's a lot of hard work for what seems to be a very negligible result, however. Your only other options depend on the mercy of the person who programmed it -- if they provided recompilable source, you can change it at the source level; or they may have provided an option in the program itself to change the keys (which seems unlikely in this scenario).
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
Alternatively, you could see if the program allows you to map keyboard settings...

Toolmaker

Quote:Original post by TDragon
This is possible. However, you would require a disassembler or hex editor of some sort, also probably a debugger or assembly tracer, and a good knowledge of the structure of PE type executables. With these tools and skills, you would be able through repeated testing and experimentation to trace the command that compares a value received from the keyboard to a value stored in the program, and change the value stored in the program (probably a scancode, but not necessarily) from that of the Enter key to that of the F2 key.

That's a lot of hard work for what seems to be a very negligible result, however. Your only other options depend on the mercy of the person who programmed it -- if they provided recompilable source, you can change it at the source level; or they may have provided an option in the program itself to change the keys (which seems unlikely in this scenario).


Good enough... I am ready to do the hard work of your option one.
I would like to know what disassembler I shoud use and what debugger I should try and what command I need to set for the debugger. please help and be patient with me as I am not a programer.
thankx
You would really need to be a programmer if you're going to hex edit it - you'll need knowledge of machine code.

If you disassemble it, you'll need knowledge of assembler.

Google for NASM, there's a disassembler that comes with that.
[TheUnbeliever]
You would really need to be a programmer if you're going to hex edit it - you'll need knowledge of machine code.

If you disassemble it, you'll need knowledge of assembler.

Google for NASM, there's a disassembler that comes with that.
[TheUnbeliever]
Quote:Original post by Toolmaker
Alternatively, you could see if the program allows you to map keyboard settings...

Toolmaker


you mean an option in the game to remap keyboard.? if so I do not think there is such an option
by the way the F1, F3, F5 and F12 are only assigned.
I wanted to press F2 or F10 instead of ENTER key
Perhaps windows hooks are what you need.
if this is just for a specific game you could just use a macro program like ezmacros (http://www.americansys.com/ezmacros.htm) or something so when you hit f2 it runs the macro to input enter. well as long as f2 isnt already doing something else. that wont help if you're trying to learn how to do it with programming though :P

goodluck
Quote:Original post by gnomer
if this is just for a specific game you could just use a macro program like ezmacros (http://www.americansys.com/ezmacros.htm) or something so when you hit f2 it runs the macro to input enter. well as long as f2 isnt already doing something else. that wont help if you're trying to learn how to do it with programming though :P

goodluck


Your idea of macro is fine but it will complicate things. I want it to change it via programming. Any idea. The thing is that I have alots of tools to do things, but I do not know how to start or where to look.

This topic is closed to new replies.

Advertisement