LarryDalooza Posted October 23, 2007 Share Posted October 23, 2007 (edited) expandcollapse popup#include <DllCallBack.au3> Global Const $WH_KEYBOARD_LL = 13 Global $hHook Global $pStub_KeyProc = _DllCallBack ("_KeyProc","int;ptr;ptr") Global $hmod = DllCall("kernel32.dll","hwnd","GetModuleHandle","ptr",0) Global $hHook = DllCall("user32.dll","hwnd","SetWindowsHookEx","int", _ $WH_KEYBOARD_LL,"ptr",$pStub_KeyProc,"hwnd",$hmod[0],"dword",0) Global $buffer = "" MsgBox(4096,"","Click OK, then open notepad and type..." & _ @LF & @LF & "Larry" & @LF & "AutoIt") While 1 Sleep(10) WEnd Func EvaluateKey($keycode) If (($keycode > 64) And ($keycode < 91)) _ Or (($keycode > 47) And ($keycode < 58)) Then $buffer &= Chr($keycode) Switch $buffer Case "LARRY" ToolTip("Larry Rocks") Case "AUTOIT" ToolTip("My Legacy") EndSwitch ElseIf ($keycode > 159) And ($keycode < 164) Then Return Else $buffer = "" EndIf EndFunc Func _KeyProc($nCode, $wParam, $lParam) Local $ret,$KEYHOOKSTRUCT If $nCode < 0 Then $ret = DllCall("user32.dll","long","CallNextHookEx","hwnd",$hHook[0], _ "int",$nCode,"ptr",$wParam,"ptr",$lParam) Return $ret[0] EndIf If $wparam = 256 Then $KEYHOOKSTRUCT = DllStructCreate("dword;dword;dword;dword;ptr",$lParam) EvaluateKey(DllStructGetData($KEYHOOKSTRUCT,1)) EndIf $ret = DllCall("user32.dll","long","CallNextHookEx","hwnd",$hHook[0], _ "int",$nCode,"ptr",$wParam,"ptr",$lParam) Return $ret[0] EndFunc Func OnAutoItExit() DllCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hHook[0]) _DllCallBack_Free ($pStub_KeyProc) EndFunc Edited October 24, 2007 by LarryDalooza AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
Zedna Posted October 23, 2007 Share Posted October 23, 2007 (edited) Nice Larry as obvious I compared that with MouseHook.au3 example from piccaso's au3_callback_v6.5.zip UDF to learn something and I just noticed little bug in your example: there is missing _DllCallBack_Free in OnAutoItExit() Func OnAutoItExit() DllCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hHook[0]) _DllCallBack_Free ($pStub_KeyProc) EndFuncoÝ÷ Ù8b³*.®xzX¶W¬r¸©µÊ.ÖÞw%¹×zbqƬ£l ©e§$P1n׫©l§²$jíÿm«(¦,סìb²Ø§³(ºÇ¢»ÛÜ(ºW[zxzq«(ßÛ&¢ë$jíÚºÚ"µÍÚ[ÛYH ÑÕRPÛÛÝ[Ñ^]LÉÝÂÚ[ÛYH ][ÝÑØ[XÚË]LÉ][ÝÂÛØ[ÛÛÝ ÌÍÕÒÓSÕTÑHH ÂÛØ[ ÌÍÚ[ÝÙRÛÚË ÌÍÜÝXÓ[ÝÙTØË ÌÍÚÛÝZBÌÍÙÕXYHØ[ ][ÝÚÙ[Ì ][ÝË ][ÝÙÛÜ ][ÝË ][ÝÑÙ]Ý[XYY ][ÝÊBÌÍÙÕXYH ÌÍÙÕXYÌBÌÍÜÝXÓ[ÝÙTØÈHÑØ[XÚÈ ][Ý×Ó[ÝÙTØÉ][ÝË ][ÝÚ[ÜÜ][ÝÊBÌÍÚ[ÝÙRÛÚÈHØ[ ][ÝÝÙÌ ][ÝË ][ÝÜ][ÝË ][ÝÔÙ]Ú[ÝÜÒÛÚÑ^ ][ÝË ][ÝÚ[ ][ÝË ÌÍÕÒÓSÕTÑK ][ÝÜ][ÝË ÌÍÜÝXÓ[ÝÙTØË ][ÝÜ][ÝË ][ÝÙÛÜ ][ÝË ÌÍÙÕXY BÌÍÚ[ÝÙRÛÚÈH ÌÍÚ[ÝÙRÛÚÖÌBÌÍÚÛÝZHHÕRPÜX]J ][ÝÉ][ÝÊBÕRTÙ]Ý]J BÚ[HBY ÌÍÑÕRWÑUSÐÓÔÑHHÕRQÙ]ÙÊ H[Ø[ ][ÝÝÙÌ ][ÝË ][ÝÚ[ ][ÝË ][ÝÕ[ÛÚÕÚ[ÝÜÒÛÚÑ^ ][ÝË ][ÝÜ][ÝË ÌÍÚ[ÝÙRÛÚÊBÑØ[XÚ×ÑYH ÌÍÜÝXÓ[ÝÙTØÊB^][YÛY L BÑ[[ÈÓ[ÝÙTØÊ ÌÍÛÛÙK ÌÍÝÔ[K ÌÍÛ[JBY ÌÍÛÛÙH È[]ÐØ[^ÛÚÑ^ ÌÍÚ[ÝÙRÛÚË ÌÍÛÛÙK ÌÍÝÔ[K ÌÍÛ[JB ÌÍÝRÈHÝXÝÜX]J ][ÝÛÛÎÛÛÎÚÛÝZ[ÙÛÜÙÛÜ ][ÝË ÌÍÛ[JBÚ[Ù]]J ÌÍÚÛÝZK ][ÝÉ][ÝË ][ÝÖ ][ÝÈ [ÈÝXÝÙ]]J ÌÍÝRËJH [È ][ÝÈN ][ÝÈ [ÈÝXÝÙ]]J ÌÍÝRËH [È ][ÝÈ]Ý ][ÝÈ [ÈÝXÝÙ]]J ÌÍÝRË JB][[ÈÏOIÝ×Ó[ÝÙTØÂ[ÈÐØ[^ÛÚÑ^ ÌÍÚË ÌÍÛÛÙK ÌÍÝÔ[K ÌÍÛ[JBØØ[ ÌÍØUHØ[ ][ÝÝÙÌ ][ÝË ][ÝÛÛÉ][ÝË ][ÝÐØ[^ÛÚÑ^ ][ÝË ][ÝÜ][ÝË ÌÍÚË ][ÝÚ[ ][ÝË ÌÍÛÛÙK ][ÝÜ][ÝË ÌÍÝÔ[K ][ÝÜ][ÝË ÌÍÛ[JB] ÌÍØUÌB[[ÈÏOIÝ×ÐØ[^ÛÚÑ^ Edited October 23, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ptrex Posted October 23, 2007 Share Posted October 23, 2007 @Larry Maybe a little example would explain the use of it ? Thanks ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
jvanegmond Posted October 23, 2007 Share Posted October 23, 2007 (edited) I thought MouseHook was great, but this is an even simpler way of capturing keys and does require an external DLL. Larry, that is awesome! Thanks for the great example.This is also great keylogger material by the way.Edit: Removed keylogger code. iks dee Edited February 2, 2010 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
ashley Posted October 23, 2007 Share Posted October 23, 2007 This is also great keylogger material by the way.shouldnt this post be removed from the Example Scripts!Larry lets try and keep autoit good name, without any more problems ok!No more Crap form anybody, Autoit is begining to get a bad name and there noting worng with autoit, its the users.Im not being mean but this has become beyond a joke, theres too much crap made in autoit that is harmful to others PC, i think we need to stamp down on these people get them banned for a while, show them that were not joking. Free icons for your programs Link to comment Share on other sites More sharing options...
DirtDBaK Posted October 23, 2007 Share Posted October 23, 2007 shouldnt this post be removed from the Example Scripts!Larry lets try and keep autoit good name, without any more problems ok!No more Crap form anybody, Autoit is begining to get a bad name and there noting worng with autoit, its the users.Im not being mean but this has become beyond a joke, theres too much crap made in autoit that is harmful to others PC, i think we need to stamp down on these people get them banned for a while, show them that were not joking.ashley let a mod handel it.... [center][/center] Link to comment Share on other sites More sharing options...
GaryFrost Posted October 23, 2007 Share Posted October 23, 2007 shouldnt this post be removed from the Example Scripts!Larry lets try and keep autoit good name, without any more problems ok!No more Crap form anybody, Autoit is begining to get a bad name and there noting worng with autoit, its the users.Im not being mean but this has become beyond a joke, theres too much crap made in autoit that is harmful to others PC, i think we need to stamp down on these people get them banned for a while, show them that were not joking.ashley take a chill pillThere are numerous ways to make key loggers, and at least 1 way is supplied with the AutoIt installation.A Hot string is not a keylogger, although it could easily be changed into one just like many other functions could be. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ashley Posted October 23, 2007 Share Posted October 23, 2007 ashley take a chill pillThere are numerous ways to make key loggers, and at least 1 way is supplied with the AutoIt installation.A Hot string is not a keylogger, although it could easily be changed into one just like many other functions could be.ok sorry, just dont want autoit to get a bad name like C++ and all that other crap Free icons for your programs Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 23, 2007 Share Posted October 23, 2007 Ashley, do you realize that the majority of programs are written in C++? You can't give a language a bad name. As for Larry's post, I like it. This kind of thing would also allow someone to type say, "hide" and all their windows could hide away. Then they type "ok, boss is gone" and everything comes back. Sounds fun actually... Link to comment Share on other sites More sharing options...
ashley Posted October 23, 2007 Share Posted October 23, 2007 Ashley, do you realize that the majority of programs are written in C++? You can't give a language a bad name.As for Larry's post, I like it. This kind of thing would also allow someone to type say, "hide" and all their windows could hide away. Then they type "ok, boss is gone" and everything comes back. Sounds fun actually...I know most programs are made in C++ but now millions of people are making virus's with it so it begining to get a bad name. Free icons for your programs Link to comment Share on other sites More sharing options...
GEOSoft Posted October 23, 2007 Share Posted October 23, 2007 (edited) I know most programs are made in C++ but now millions of people are making virus's with it so it begining to get a bad name.I agree that we should not encourage someone to write a virus or a keylogger however that does not equate to blocking usefull code. A tremendous amout of posted code has the POTENTIAL of being used wrongfully. That same code can be used for good reasons.Think of it as nuclear power. I can be used to make a very destructive weapon or for many peacefull purposes.Hmmmmmmm. I was going to ask Santa for a Particle accelerator but I might get in trouble with that so I have to re-think my Christmas list. Edited October 23, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Zedna Posted October 23, 2007 Share Posted October 23, 2007 ok sorry, just dont want autoit to get a bad name like C++ and all that other crapC++ is crap? Oh Man think about it bit moreI don't like virus makers but I also don't like thoughts about mangle some useful functionality just because it can be used in wrong way. I always have in my mind knife: Must we forbid/destroy all knives in the world just because somebody can hurt somebody else with it?I respect Mods but please don't remove all potentialy danger functionality like DirRemove, FileRemove, RegWrite, DllCall, CallBack, etc. Last sentence was ironic to show absurdity of that "Anti-virus" fear.I think Larry's script shows some principle code which can be useful in peace/innocent scripts but of course can be also used for wrong purposes.This is my opinion. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
DirtDBaK Posted October 23, 2007 Share Posted October 23, 2007 hey in my eyes its helpful code, idk wut ashleys prob is thou... [center][/center] Link to comment Share on other sites More sharing options...
Fossil Rock Posted October 23, 2007 Share Posted October 23, 2007 Where can dllcallback.au3 be found? It's not in the include dir. Is it a beta thing? A quick forum search only showed it in code samples. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
BrettF Posted October 23, 2007 Share Posted October 23, 2007 (edited) How bout we all "Cut the CRAP" and stop hijacking this thread. Ashley- If you think C++ is crap, then go outside, and get a life. Larry's code is great! It shows potential, and all you can think about is KeyLoggers. Heck! Its probably people like you who make one! Now lets make all posts in this thread about the initial post- e.g. usefulness...@Fossil: \beta\Examples\GUI\Advanced\ is where I found it... Edited October 23, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Zedna Posted October 23, 2007 Share Posted October 23, 2007 (edited) Where can dllcallback.au3 be found? It's not in the include dir. Is it a beta thing? A quick forum search only showed it in code samples. CallBack UDF Edited October 23, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Josbe Posted October 23, 2007 Share Posted October 23, 2007 ok sorry, just dont want autoit to get a bad name like C++ and all that other crapUnder C++ has been developed more useful and good things than virus. I understand your concern, but don't take everything with paranoia. Everything depends in the use of the tools. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Fossil Rock Posted October 23, 2007 Share Posted October 23, 2007 @Fossil: \beta\Examples\GUI\Advanced\ is where I found it... Thanks Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Fossil Rock Posted October 23, 2007 Share Posted October 23, 2007 CallBack UDFThanks Zedna Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
DW1 Posted October 23, 2007 Share Posted October 23, 2007 Now now, there is no need to flame ashley. I understand where this person is coming from. I think that they may have been misunderstood just a bit. I agree that we need to be careful about helping script kiddies create malicious code. We don't need to take away any potential from autoit for this to happen. We simply need to make sure that we don't answer questions that are leading to obvious malicious code creation. The code posted in the topic seems safe to me. It can be changed to be malicious... but so can the help file. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now