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ú

Mensajes - Miseryk

#181
Hola a todos, estuve viendo el tema del address de una función.
Código:
Código (vb) [Seleccionar]

[Module1]
Option Explicit

Sub Main()
'MsgBox Hex(AddressOf procesoX)

'Dim ThisAddress&

'ThisAddress& = Adrs&(AddressOf procesoX)
'MsgBox ThisAddress& & " - (" & Hex(ThisAddress&) & ")"
End Sub

Public Function Adrs(ByVal Addrs As Long) As Long
Adrs = Addrs
End Function

Public Function procesoX(ParamArray ParametrosX() As Variant) As String
procesoX = "procesoX"
End Function

Public Function Valor(ByVal v1 As Long, ByVal v2 As Long) As Long
Valor = v1 + v2
End Function

Public Sub Mensaje()
MsgBox "Test"
End Sub


Código (vb) [Seleccionar]

[Form1]
Option Explicit

Private Sub Command1_Click()
Dim ThisAddress As Long

Text1.Text = ""

ThisAddress = Adrs(AddressOf procesoX)
Text1.Text = Text1.Text & "AddressOf procesoX: " & Hex(ThisAddress) & vbCrLf & _
"[Public Function procesoX(ParamArray ParametrosX() As Variant) As String" & vbCrLf & _
"procesoX = ''procesoX''" & vbCrLf & _
"End Function" & "]" & vbCrLf & vbCrLf

ThisAddress = Adrs(AddressOf Valor)
Text1.Text = Text1.Text & "AddressOf Valor: " & Hex(ThisAddress) & vbCrLf & _
"[Public Function Valor(ByVal v1 As Long, ByVal v2 As Long) As Long" & vbCrLf & _
"Valor = v1 + v2" & vbCrLf & _
"End Function" & "]" & vbCrLf & vbCrLf

ThisAddress = Adrs(AddressOf Mensaje)
Text1.Text = Text1.Text & "AddressOf Mensaje: " & Hex(ThisAddress) & vbCrLf & _
"[Public Sub Mensaje()" & vbCrLf & _
"MsgBox ''Test''" & vbCrLf & _
"End Sub" & "]"

'ThisAddress& = Adrs&(AddressOf Mensaje)

'Me.Caption = Hex(ThisAddress)
End Sub

Private Sub Command2_Click()
Call Mensaje
End Sub


Gracias a BlackZeroX por el este code que me dió hace mucho  ;-) ;-) ;-)

Ahora la pregunta es: cómo puedo obtener la longitud de cada función? Porque lo que estoy tratando de hacer, es injectar en otro programa solo la función Mensaje (por ejemplo) y hacerle un jmp en el MessageBoxA del ejecutable víctima, donde alojé dicha función. Gracias a to2.
#182
Cita de: Tenient101 en  8 Mayo 2011, 00:46 AM
Muchas gracias por su ayuda   :D

@Miseryk tu code va de 10  :P  ;-) (falta probarlo con 7)

hasta luego !  ;)

Me alegro :), en w7 tiene que funcar, =mente depende del SO... xq hay muchos w7, en el q usaba, funcaban to2 los programas de VB con las llamadas viejas a funciones de W XP.
#183
Mirá tenía 1 modulo de como bloquear teclado por una parte y mouse por otra, acá dejo el modulo:

Código (vb) [Seleccionar]

Option Explicit

'Declare needed functions from Windows API
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long

'Keyboard related Constants and Structs
Private Const WH_KEYBOARD_LL As Byte = 13

'Keyboard related variables
Private IdKeyBoard As Long

'Mouse related Constants and Structs
Private Const WH_MOUSE_LL As Byte = 14

'Mouse related variables
'Dim p2 As MSLLHOOKSTRUCT
Private IdMouse As Long

'función que desactiva el teclado
'''''''''''''''''''''''''''''''''
Public Function WinProcKeyBoard(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
WinProcKeyBoard = -1
End Function

'Función que desactiva el Mouse
'''''''''''''''''''''''''''''''
Public Function WinProcMouse(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
WinProcMouse = -1
End Function

' Sub que instala los Hook para bloquear el teclado y mouse
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub Bloquear()
'Deshabilita el teclado
'IdKeyBoard = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf WinProcKeyBoard, App.hInstance, 0)
'Deshabilita el mouse
If IdMouse <> 0 Then Exit Sub
IdMouse = SetWindowsHookEx(WH_MOUSE_LL, AddressOf WinProcMouse, App.hInstance, 0)
End Sub

Public Sub Desbloquear()
' Vuelve a Habilitar el teclado
'If IdKeyBoard <> 0 Then UnhookWindowsHookEx IdKeyBoard
' Vuelve a Habilitar el mouse
If IdMouse <> 0 Then UnhookWindowsHookEx IdMouse
End Sub


yo creo q usaba el bloquear solo para el mouse, pero descomentalo y listo. :D
#184
Alguno tiene idea como hacer funcionar el entry point de 1 dll en vb? Probé de todo.
#185
Hola, estaba en la otra PC, la llamo MierdBook (NetBook) entonces leí ésto y dije, excelente, puedo pasar mi tiempo con ésto haciendolo desde el Bloc de notas, lo terminé en el bloc y cdo lo probé en la verdadera PC, funcionó sin errores, ni tuve q hacer cambios :D

Código (vb) [Seleccionar]

Option Explicit

Private Sub Form_Load()
Dim SearchString As String, SearchChar As String

SearchString = "Baila baila baila como Juana, baila la cubana, parece refresco de cola, a mi me parece que estás bien buena."

SearchChar = "col"

MsgBox InStr(1, SearchString, SearchChar)
MsgBox MyInStr(1, SearchString, SearchChar)
End
End Sub

Public Function MyInStr(ByVal Sutato As Integer, ByVal SearchString As String, ByVal SearchChar As String) As Integer
Dim i As Integer, LenSS As Integer, LenSC As Integer
Dim x As Integer

LenSS = Len(SearchString)
LenSC = Len(SearchChar)

'Anti-Dumb
If LenSC = 0 Or LenSS = 0 Then Exit Function
'Anti-Dumb
If Sutato < 0 Then Sutato = 0

'Only 1 Char?
If LenSC = 1 Then
   For i = Sutato To LenSS
       If Mid(SearchChar, 1, 1) = Mid(SearchString, i, 1) Then
           MyInStr = i
           Exit Function
       End If
   Next i
End If

For i = Sutato To LenSS
   If Mid(SearchChar, 1, 1) = Mid(SearchString, i, 1) Then
       For x = 2 To LenSC
           If Mid(SearchChar, x, 1) = Mid(SearchString, i + (x - 1), 1) Then
               If x = LenSC Then
                   MyInStr = i
                   Exit Function
               End If
           Else
               i = i + (x - 1)
               Exit For
           End If
       Next x
   End If
Next i
End Function


Feliz año nuevo (Y).
#186
Hola a to2, se viene el 2011 :O y se aproxima el 2012 :):):):):):), no he podido descargar ni encontrar esta herramienta, "WinDbg", otra cosa, cómo puedo hacer para saber el OffsetFlink y el OffsetBlink, son &H88 y &H8C? Desde yá muchas gracias y feliz año. (Y)
#187
Programación Visual Basic / Re: [Resuelto] Chinese
26 Diciembre 2010, 12:21 PM
Weno encontré el código, es super largo, hace controles propios, acá pongo algo muy útil.

Código (vb) [Seleccionar]

Option Explicit

Private Declare Function GetModuleHandleW Lib "kernel32" (ByVal lpModuleName As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function GetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowLongW Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowTextW Lib "user32" (ByVal hWnd As Long, ByVal lpString As Long) As Long

Private Const GWL_WNDPROC = -4

Private m_Caption As String

Public Property Get CaptionW() As String
   CaptionW = m_Caption
End Property

Public Property Let CaptionW(ByRef NewValue As String)
   Static WndProc As Long, VBWndProc As Long
   m_Caption = NewValue
   ' get window procedures if we don't have them
   If WndProc = 0 Then
       ' the default Unicode window procedure
       WndProc = GetProcAddress(GetModuleHandleW(StrPtr("user32")), "DefWindowProcW")
       ' window procedure of this form
       VBWndProc = GetWindowLongA(hWnd, GWL_WNDPROC)
   End If
   ' ensure we got them
   If WndProc <> 0 Then
       ' replace form's window procedure with the default Unicode one
       SetWindowLongW hWnd, GWL_WNDPROC, WndProc
       ' change form's caption
       SetWindowTextW hWnd, StrPtr(m_Caption)
       ' restore the original window procedure
       SetWindowLongA hWnd, GWL_WNDPROC, VBWndProc
   Else
       ' no Unicode for us
       Caption = m_Caption
   End If
End Property

Private Sub Form_Load()
Me.CaptionW = "UniControls sample: " & ChrW$(&H3042) & ChrW$(&H3044) & ChrW$(&H3046) & ChrW$(&H3048) & ChrW$(&H304A)
End Sub


El archivo se llama UniControl2117366192008.rar, por si lo encuentrar en internet,, debe ser de Planet Source Code (Y), no sé como subirlo acá y x lo q ví, creo q no se puede. (Y)
#188
Hola a to2, una vez, como me suele pasar, encontré un código que me mostraba un mensaje (MsgBox) con Kanjis (simbolos chinos / japoneses) no me acuerdo donde está, vale oro, alguno de ustedes sabe como hacer éso? Desde ya muchas gracias.
#189
Programación Visual Basic / [Ayuda] Hookin'
30 Octubre 2010, 15:44 PM
Hola a todos, estaba probando el proyecto Inject_en / RedirectHook / IAT, el que es muy conocido y estaba cambiando funciones de un programa como "GetTickCount", el código es algo así:

Código (vb) [Seleccionar]

If Not RemoteHook(hProcess, "kernel32.dll", "GetTickCount", AddressOf MyGetTickCount) Then
   MsgBox "Couldn't hook MessageBoxA.", vbExclamation
   CloseProcess hProcess
   Exit Sub
End If


Igualmente BlackZeroX lo tiene en su página.

Ahora lo que yo pensé es que si puedo modificar esa función, podría modificar una función del programa, como por ej:

Código (vb) [Seleccionar]

Public Function Suma(ByVal n1 As Long, ByVal n2 As Long) As Long
Suma = n1 + n2
End Function


Pero trato de modificar esa función y no encuentra nada :( es como que sólo capta funciones de windows :( alguna idéa?

Desde ya muchas gracias :)
#190
Hola, muchas gracias, realmente, muchas gracias. :) Cuando tenga tiempo lo veo y me pongo a hacer alguna que otra cosa :D:D:D.


Saludos.
Misery.