Sign in to follow this  
Followers 0
LarryDalooza

Larry's Use of Bandwidth

50 posts in this topic

#1 ·  Posted (edited)

#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 by LarryDalooza

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Zedna

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Manadar

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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 pill

There 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.

 

Share this post


Link to post
Share on other sites

ashley take a chill pill

There 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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 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!"

Share this post


Link to post
Share on other sites

ok sorry, just dont want autoit to get a bad name like C++ and all that other crap

C++ is crap? Oh Man <_<  think about it bit more

I 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.

Share this post


Link to post
Share on other sites

hey in my eyes its helpful code, idk wut ashleys prob is thou...


[center][/center]

Share this post


Link to post
Share on other sites

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!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

#15 ·  Posted (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 by Bert

Share this post


Link to post
Share on other sites

ok sorry, just dont want autoit to get a bad name like C++ and all that other crap

Under 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.

Share this post


Link to post
Share on other sites

@Fossil: \beta\Examples\GUI\Advanced\ is where I found it... <_<

Thanks

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
Thanks Zedna

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0