Hack Forums
[.NET] Need help fixing simple vb.net keylogger and should record all keys in windows 10 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Need help fixing simple vb.net keylogger and should record all keys in windows 10 (/showthread.php?tid=5364909)



Need help fixing simple vb.net keylogger and should record all keys in windows 10 - YenMan089 - Aug 5, 2016

Hi!
I need help in fixing my simple keylogger app. It should record all keystrokes and save them into a text file. The keylogger works well in my Win7 pc although some keys are duplicated but when I ran it on my Win10 laptop, some keys weren't recorder and there are missing characters after I tested it from A-Z and 0-9. It also can't detect shift and space bar. Same thing happened when I ran it on my cousin's win10 laptop.

I don't know if the version of windows has anything to with it but it just happened to work on my win7 and failed on 2 win10s.

Here's a sample of my code:
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.A)
If hotkey1 = True Then
myChar.Text = "A"
End If

myChar is then appended to the text file.______________________________________
Dim file As System.IO.StreamWriter

Dim reportsFolder As String
reportsFolder = Path.Combine(Directory.GetCurrentDirectory())

file = My.Computer.FileSystem.OpenTextFileWriter(reportsFolder & "\test.txt", True)
file.Write(myChar.Text)
myChar.Text = ""
file.Close()_______________________________________

Yes this is brute force. I typed in codes for A-Z, 0-9, Shift, Space and Enter. I had another shorter code that I got from the net but the output looks like an enrcypted file and there are also missing characters there.

Can anyone help me build a better code for this program? Thanks a lot in advance! :D


* - Zilog80 - Aug 6, 2016

My 2 cents (2 minutes programming. Not expected Uber code)

[Image: uatrLKf.gif]


* - He B TeMy - Aug 6, 2016

GetAsyncState might be the cause of the missing keys, as said above, use Global Hooks.


* - Ninja - Aug 6, 2016

Why do so many people do:
Code
Dim something As Type
something = value
instead of:
Code
Dim something As Type = value



* - He B TeMy - Aug 6, 2016

(Aug 6, 2016 08:10 AM)Ninja Wrote:  Why do so many people do:
Code
Dim something As Type
something = value
instead of:
Code
Dim something As Type = value

Code
Dim something = value
For full profit.


* - SIM-2914476 - Aug 6, 2016

(Aug 6, 2016 08:10 AM)Ninja Wrote:  Why do so many people do:
Code
Dim something As Type
something = value
instead of:
Code
Dim something As Type = value

Why do people do:
Code
Dim something As Type = value

instead of:
Code
SomethingsXYZ = New Type(value).DoWhateverHere