flat assembler
Message board for the users of flat assembler.
Index
> Main > Simulate key press from keyboard |
Author |
|
Madis731 17 Mar 2006, 07:26
If it is a Windows game then you are better off cheating with SendKeys API
|
|||
17 Mar 2006, 07:26 |
|
vid 17 Mar 2006, 09:05
most DOS games weren't using int 16h to detect keys, they used own handlers, which were so accessing directly to kbd port. So it won't be that easy...
|
|||
17 Mar 2006, 09:05 |
|
flyff 17 Mar 2006, 16:20
Madis731 wrote: If it is a Windows game then you are better off cheating with SendKeys API Thanks for your quick response and yes this game is a windows base game. I searched on the forum to find out more about SendKeys, yet there wasn't much information about it. I did a google search on SendKeys but it kept on refering me to something related to visual basic. Is SendKeys a visual basic command or an assembly command? Can someone tell me what's the best solution to my problem. I am quite lost now and any help, links and examples would be much appreciate. Thanks in advance, PS: I'm not cheating, i'm finding a way to better manage my time =P |
|||
17 Mar 2006, 16:20 |
|
Madis731 17 Mar 2006, 18:00
Your program is a DOS-executable so you have to learn some new things. Making PE executables is explained here on the forums and they come with Windows package of the FASM. You can have a look of the syntax on the MSDN, but can't help you any further because learning Windows API takes time and just giving you some code won't solve the problem
Good luck! EDIT: SendKeys is NOT in the Windows API but its somekind of a wrapper in languages like Visual Basic etc. Last edited by Madis731 on 20 Mar 2006, 08:37; edited 1 time in total |
|||
17 Mar 2006, 18:00 |
|
RedGhost 18 Mar 2006, 02:10
flyff wrote:
windows API can be called from pretty much any language that can build PE applications (vb, asm, etc) but ive never heard of SendKeys :S, and all results on the MSDN returned VB related stuff, so maybe it is a vb specific function from the vb .dll's i use keybd_event for simulating key presses http://tinyurl.com/5s42w Code: KEYEVENTF_KEYDOWN = $00 push 0 push KEYEVENTF_KEYDOWN push 0 push VIRTUAL_KEY_CODE ;e.g. VK_RETURN call [keybd_event] it may keep the key 'pressed' untill you call it again with KEYEVENTF_KEYUP _________________ redghost.ca |
|||
18 Mar 2006, 02:10 |
|
r22 18 Mar 2006, 03:08
This old thread may also help.
It has a code snippet that gives an example of using keybd_event to send a string of text to a window. It clones the SendKeys function in VB. http://board.flatassembler.net/topic.php?t=3222 |
|||
18 Mar 2006, 03:08 |
|
flyff 18 Mar 2006, 21:58
Thanks everybody for your replies. I found a small program whiched used the keybd_event function and tried using it on the game...still no luck. I do know that this program is working since I was able to send the simulate key press to notepad. I guess this game has some kind of protection against this kind of use. It looks like i'm forced to abondon this project >_< Here's the link which I found this program if anyone is interested.
http://web3.codeproject.com/cpp/sendkeys_cpp_Article.asp Again, thank you everyone for your help. |
|||
18 Mar 2006, 21:58 |
|
farrier 19 Mar 2006, 03:52
flyff,
I'm not sure if this will help in your instance, but look at: AttachThreadInput hth, farrier _________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! |
|||
19 Mar 2006, 03:52 |
|
Madis731 20 Mar 2006, 08:35
I'm glad you got it almost working and sorry for misleading you - I thought that the Windows's API also holds SendKeys somewhere
|
|||
20 Mar 2006, 08:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.