How do i get a program to simulate a keypress to the system

Posted on 2005-04-17
Last Modified: 2010-05-18
Hello all,

As some of you may or may not know, on Thinkpad computers you have the option to type in a 7 character password and "lock the hard drive". naturally some people loose their passwords and thus loose their hard drive.

I would like to write a program that would simulate a keypress from the keyboard. for example if the program called "Ctrl, Alt, Del" i would see the windows task manager because the program outputed the keypresses and the system responded. currently i do NOT know how to wright a C++ program to do this(if there is another language that can easly do it, then i might be willing to change the language)

Now i know that there are literaly billions of possible combonations with a 36^7 but i have some ideas that will limit that number down substansually, Also, it is my understanding that you have infinite retrys and very fast responce times from the hard drive.

my main idea for this program is to have the hard drive installed in a PC and will do constant interaction. another idea(some hardware required) would be to use the USB cord with a PS2 conection to the end, so that the computer would repeatedly send commands to the laptop computer "from the keyboard".

Yes, i know this will take a LONG time for the program to compleate it's task, but it is my hope that the Thinkpad users will be able to regain the use of their laptops.

Incase you are wondering(or perhaps you wish to make the program yourself) my idea to limit the possible number of combonations by asking the following questions.

1) are there only letters or only numbers?
2) Do you know of any specific letters or numbers in a specific place?
3)do you remember part of the password?
4) where are these parts located?
5)are the missing parts letters or numbers or both?

once again, i am only asking how to simulate a keyboard keypress from a computer program.
Question by:Diane258
    LVL 11

    Accepted Solution

    In VB you have a KeyPress Event trigger, using which you can simulate it. In Oracle Forms we have DO-KEY trigger which can be used for this. Do some RnD on them i am sure you can get your work done.

    Some URLs that might help you,

    LVL 4

    Author Comment

    Hey very good thank you :) i still have yet to get it to work, but that is my problem, but at least i know a potential problem with sendkeys. Altho the blog was not very specific as to what the replacement of the sendkeys is.

    still it is something for me to work on :)
    LVL 23

    Expert Comment

    Visual basic 6.0 :

    That site shows you more or less about send keys :)

    If you need any further help or you still want to create it in c++ let me know :) is a good starting place and also if you search for a guy called bruce eckel using google and you should find his site with all of the pdf's with regards to java and c++
    LVL 85

    Assisted Solution

    by:Mike Tomlinson
    Silly question...if the hard drive is "locked", how do you propose putting your program on the system so it can send keys and crack the password?
    LVL 23

    Expert Comment

    To the best of my knowledge, the only way around a ThinkPad HDD password is to re-write the eprom the password is stored in.  The only folks I know of who do this are:
    LVL 4

    Author Comment


    Thanks for all the help guys.

    i have had a few problems with it at first, and i still wanna know the c++ way to do it, but it seems to be working well :)

    Now all i gotta do is post a question as to how i can compile a program to run in a non-windows enviroment :)

    As to how i do this, well most laptops have a way to connect a PS2 keyboard, or perhaps a USB keyboard to the computer(at least out test TP does). A guy i know already created a "simulated" keyboard program, with the approiate cable provided.

      giving it about 300 combonations before finding the key and timeing it should give an accurate estimation as to how long it will take to "crack" the passowrd.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    abstract class with all non abstract mentods 6 58
    dividesSelf challange 15 58
    nestparen challenge 4 35
    mapBully challenge 6 53
    INTRODUCTION We all know how to code. But at times you simply want to insert a common code block into your existing code and amend it as per your requirements. This tool not only saves you time but also saves you the pain of typing it all out aga…
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now