[VB][Undocumented] LoadUserTile() - Obtener la imagen del usuario

Iniciado por Karcrack, Junio 16, 2013, 06:30:45 PM

Tema anterior - Siguiente tema

0 Miembros y 5 Visitantes están viendo este tema.

Código: vb
Option Explicit
'KERNEL32
Private Declare Function GetVersion Lib "KERNEL32" () As Long
'SHELL32
Private Declare Function SHGetUserPicturePath Lib "SHELL32" Alias "#261" (ByVal pUserOrPicName As Long, ByVal sguppFlags As Long, ByVal pwszPicPath As Long, ByVal picPathLen As Long) As Long
Private Declare Function xp_SHGetUserPicturePath Lib "SHELL32" Alias "#233" (ByVal pUserOrPicName As Long, ByVal sguppFlags As Long, ByVal pwszPicPath As Long) As Long

Private Const SGUPP_CREATEPICTURESDIR = &H80000000

Public Function LoadUserTile() As IPictureDisp
    Dim sPath   As String
   
    sPath = String$(256, vbNullChar)
   
    Select Case (GetVersion() And &HFF)
        Case 5
            Call xp_SHGetUserPicturePath(0, SGUPP_CREATEPICTURESDIR, StrPtr(sPath))
        Case 6
            Call SHGetUserPicturePath(0, SGUPP_CREATEPICTURESDIR, StrPtr(sPath), 256)
    End Select
   
    sPath = Left$(sPath, InStr(1, sPath, vbNullChar) - 1)
   
    Set LoadUserTile = LoadPicture(sPath)
End Function


Para probarlo añade un PictureBox en un form:
Código: vb
Private Sub Form_Load()
    Picture1.Picture = LoadUserTile()
End Sub


Usa un export no documentado de SHELL32.. que varía según el SO en el que estamos... por eso el GetVersion().

saludos
I code for $$$.

(PGP ID 0xCC050E77)
ASM, C, C++, VB6... skilled [malware] developer

@Karcrack este código es tuyo?


lastima que ya te alejaste del vb6 :(

saludos

Sí que lo es, sí. En realidad no me he alejado tanto, ahora estoy en asuntos más internos de VB6 jugueteando con el compilador y las librerías.

Aunque veréis poco de esas investigaciones ya que las suelo vender :-\ Seguramente durante el verano suelte alguna cosita ::)

Saludos :)
I code for $$$.

(PGP ID 0xCC050E77)
ASM, C, C++, VB6... skilled [malware] developer

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Sí que lo es, sí. En realidad no me he alejado tanto, ahora estoy en asuntos más internos de VB6 jugueteando con el compilador y las librerías.

Aunque veréis poco de esas investigaciones ya que las suelo vender :-\ Seguramente durante el verano suelte alguna cosita ::)

Saludos :)

para mi lo externo por ahora es demasiado  :(

que bien que andes todavía en el vb y que le saques provecho.  ;D


Todavía ando esperando el paper del que hablaste una vez que comenzaste y nunca terminaste.


saludos  Karcrack

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Todavía ando esperando el paper del que hablaste una vez que comenzaste y nunca terminaste.
Tenía un índice y todo... Ha pasado muchísimo tiempo, he aprendido mucho desde entonces. Ahora me quedaría un paper muy largo jaja

A ver si alguna calurosa noche de verano me viene la inspiración  :P
I code for $$$.

(PGP ID 0xCC050E77)
ASM, C, C++, VB6... skilled [malware] developer

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Todavía ando esperando el paper del que hablaste una vez que comenzaste y nunca terminaste.
Tenía un índice y todo... Ha pasado muchísimo tiempo, he aprendido mucho desde entonces. Ahora me quedaría un paper muy largo jaja

A ver si alguna calurosa noche de verano me viene la inspiración  :P


Ojala haya mucho calor jajajaajajaja. a ver si lo terminas.

el vb6 es viejo pero varios lo han mágico. ¬¬ a ver que magia negra sacas ahorita.


saludos compa.



PD: hace falta un chat room.