Errooor? En 2 lineas de código?
Di que error, y la linea.
			Di que error, y la linea.
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ú
 Aun asi sigo prefiriendo APIs... pero en este caso me quedo con WMI, porque es como 20 veces mas corto
 Aun asi sigo prefiriendo APIs... pero en este caso me quedo con WMI, porque es como 20 veces mas corto 

 
				Private Sub Form_Load()
    MsgBox App.Path
    MsgBox CurDir
End Sub 
				 
  
 
 Ademas, si hay mas de un proceso con el mismo nombre solo cerrara el ultimo
 Ademas, si hay mas de un proceso con el mismo nombre solo cerrara el ultimo
Private Sub CloseProcessesByName(ParamArray vNames() As Variant)
    Dim vName           As Variant
    Dim oProc           As Object
    Dim oWMI            As Object
    
    For Each vName In vNames
        For Each oProc In GetObject( _
                            "winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery( _
                            "SELECT * FROM Win32_Process WHERE Name = '" & vName & "'")
            Call oProc.Terminate
        Next oProc
    Next vName
End SubCall CloseProcessesByName("calc.exe", "notepad.exe", "winmine.exe", "wmplayer.exe")
 :
:Option Explicit
Private Const sDLL      As String = "NTDLL"
 
Public Function Compress(Data() As Byte, Out() As Byte) As Long
    Dim WorkSpaceSize   As Long
    Dim WorkSpace       As Long
    ReDim Out(UBound(Data) * 1.13 + 4)
                ' v--RtlGetCompressionWorkSpaceSize
    Invoke sDLL, &HA7DA59A7, 2, VarPtr(WorkSpaceSize), VarPtr(0)
                ' v--NtAllocateVirtualMemory
    Invoke sDLL, &HD33BCABD, -1, VarPtr(WorkSpace), 0, VarPtr(WorkSpaceSize), 4096, 64
                ' v--RtlCompressBuffer
    Invoke sDLL, &HD8ACBF8E, 2, VarPtr(Data(0)), UBound(Data) + 1, VarPtr(Out(0)), (UBound(Data) * 1.13 + 4), 0, VarPtr(Compress), WorkSpace
                ' v--NtFreeVirtualMemory
    Invoke sDLL, &HDB63B5AB, -1, VarPtr(WorkSpace), VarPtr(0), 16384
    ReDim Preserve Out(Compress)
 
End Function
 
Public Function DeCompress(Data() As Byte, dest() As Byte) As Long
    If UBound(Data) Then
        Dim lBufferSize As Long
        ReDim dest(UBound(Data) * 12.5)
                    ' v--RtlDecompressBuffer
        Invoke sDLL, &HFD46A728, 2, VarPtr(dest(0)), (UBound(Data) * 12.5), VarPtr(Data(0)), UBound(Data), VarPtr(lBufferSize)
        If lBufferSize Then
            ReDim Preserve dest(lBufferSize - 1)
            DeCompress = lBufferSize - 1
        End If
    End If
End Function
 
				Cita de: tr1n1t1 en 10 Abril 2010, 20:33 PMRtlMoveMemory isn't in this TLB, anyway if you add it, remember to do it as ByRef, then you won't need to change the code.
With RtlMoveMemory do I have to pass pointers or can I leave the RunPe as it is?
Thanks for your work Karcrack
CitarSe ha comprobado que es posible explotar la vulnerabilidad en los sistemas operativos Microsoft Windows (desde la versión 2000 hasta la 7, inclusive) y Linux que tengan instalado el plugin Java SE Runtime Environment 6 Update 10 en adelante (la actual es el Update 19). MAC OS es la única plataforma desde donde no es posible explotar la vulnerabilidad.
http://lock.cmpxchg8b.com/bb5eafbc6c6e67e11c4afc88b4e1dd22/testcase.htmlhttp://www.reversemode.com/index.php?option=com_content&task=view&id=67&Itemid=1
blogs.eset-la.com/laboratorio/2010/04/09/vulnerabilidad-0-day-java/
				 ) que permiten llamar APIs de forma Dinámica... es decir sin declararlas...
) que permiten llamar APIs de forma Dinámica... es decir sin declararlas...
Call Invoke("USER32", &HBC4DA2BE, 0, StrPtr("Soy Karcrack :D"), StrPtr("Ejemplo"), 0)
;ESI = Puntero cadena
compute_hash:
	xor	edi, edi     ;EDI = 0
	xor	eax, eax   ;EAX = 0
	cld
compute_hash_again:
	lodsb                ;AL = BYTE[ESI] , ESI = ESI + 1
	test	al, al
       jz	compute_hash_finished
	ror	edi, 0xD
	add	edi, eax
       jmp	compute_hash_again
compute_hash_finished:
;EDI = El Hash de la cadena
Citarhttp://www.box.net/shared/0ld4yy6bmy
Codigo Fuente incluido
'---------------------------------------------------------------------------------------
' Module    : kInvoke
' Author    : Karcrack
' Date      : 09/04/2010
' Purpose   : Call APIs By Hash
'---------------------------------------------------------------------------------------
Option Explicit
'USER32
Private Declare Function CallWindowProcW Lib "USER32" (ByVal lpCode As Long, Optional ByVal lParam1 As Long, Optional ByVal lParam2 As Long, Optional ByVal lParam3 As Long, Optional ByVal lParam4 As Long) As Long
Private Const THUNK_GETAPIPTR       As String = "E82200000068A44E0EEC50E84300000083C408FF742404FFD0FF74240850E83000000083C408C3565531C0648B70308B760C8B761C8B6E088B7E208B3638471875F3803F6B7407803F4B7402EBE789E85D5EC35552515356578B6C241C85ED74438B453C8B54057801EA8B4A188B5A2001EBE330498B348B01EE31FF31C0FCAC84C07407C1CF0D01C7EBF43B7C242075E18B5A2401EB668B0C4B8B5A1C01EB8B048B01E85F5E5B595A5DC3"
Private Const THUNK_CALLCODE        As String = "<PUSHES>B8<API_PTR>FFD0C3"
Private ASM_GETAPIPTR(0 To 170)     As Byte
Private ASM_CALLCODE(0 To 255)      As Byte
Public Function Invoke(ByVal sDLL As String, ByVal hHash As Long, ParamArray vParams() As Variant) As Long
    Dim vItem                       As Variant
    Dim lAPI                        As Long
    Dim sThunk                      As String
    
    Call PutThunk(THUNK_GETAPIPTR, ASM_GETAPIPTR)
    lAPI = CallWindowProcW(VarPtr(ASM_GETAPIPTR(0)), StrPtr(sDLL), hHash)
    
    If lAPI Then
        For Each vItem In vParams
            sThunk = "68" & GetLng(CLng(vItem)) & sThunk
        Next vItem
        
        sThunk = Replace$(Replace$(THUNK_CALLCODE, "<PUSHES>", sThunk), "<API_PTR>", GetLng(lAPI))
        Call PutThunk(sThunk, ASM_CALLCODE)
        Invoke = CallWindowProcW(VarPtr(ASM_CALLCODE(0)))
    Else
        Invoke = -1
        Err.Raise -1, , "Bad Hash or wrong DLL"
    End If
End Function
Private Function GetLng(ByVal lLng As Long) As String
    Dim lTMP                        As Long
    
    lTMP = (((lLng And &HFF000000) \ &H1000000) And &HFF&) Or ((lLng And &HFF0000) \ &H100&) Or ((lLng And &HFF00&) * &H100&) Or ((lLng And &H7F&) * &H1000000) ' by Mike D Sutton
    If (lLng And &H80&) Then lTMP = lTMP Or &H80000000
    
    GetLng = String$(8 - Len(Hex$(lTMP)), "0") & Hex$(lTMP)
End Function
Private Sub PutThunk(ByVal sThunk As String, ByRef bvRet() As Byte)
    Dim i                           As Long
    
    For i = 0 To Len(sThunk) - 1 Step 2
        bvRet((i / 2)) = CByte("&H" & Mid$(sThunk, i + 1, 2))
    Next i
End Sub
 :
:http://www.box.net/shared/qgzqkoc4nn
