Que tal compañeros del foro. estoy buscando un método para obtener el "Nombre de Producto" de Una Dll y de un ejecutable a partir de su ubicación (Ejemplo "C:\rest.dll")
¿Alguien tiene idea como puedo hacer?
(http://r.i.elhacker.net/cache?url=http://www.imagengratis.org/images/capmdef3p.jpg)
http://www.imagengratis.org/images/capmdef3p.jpg (http://www.imagengratis.org/images/capmdef3p.jpg)
DESDE AHORA. G R A C I A S
Cita de: agus0 en 29 Agosto 2010, 04:24 AM
Que tal compañeros del foro. estoy buscando un método para obtener el "Nombre de Producto" de Una Dll y de un ejecutable a partir de su ubicación (Ejemplo "C:\rest.dll")
¿Alguien tiene idea como puedo hacer?
(http://r.i.elhacker.net/cache?url=http://www.imagengratis.org/images/capmdef3p.jpg)
http://www.imagengratis.org/images/capmdef3p.jpg (http://www.imagengratis.org/images/capmdef3p.jpg)
DESDE AHORA. G R A C I A S
Estas en el horno ;D
estoy buscando pero no encuentro nada.
cuando encuentre modifico ;D
Private Const UVI_COMMENTS As String = "Comments"
Private Const UVI_INTERNALNAME As String = "InternalName"
Private Const UVI_PRODUCTNAME As String = "ProductName"
Private Const UVI_COMPANYNAME As String = "CompanyName"
Private Const UVI_LEGALCOPYRIGHT As String = "LegalCopyright"
Private Const UVI_PRODUCTVERSION As String = "ProductVersion"
Private Const UVI_FILEDESCRIPTION As String = "FileDescription"
Private Const UVI_LEGALTRADEMARKS As String = "LegalTrademarks"
Private Const UVI_PRIVATEBUILD As String = "PrivateBuild"
Private Const UVI_FILEVERSION As String = "FileVersion"
Private Const UVI_ORIGINALFILENAME As String = "OriginalFilename"
Private Const UVI_SPECIALBUILD As String = "SpecialBuild"
Private Declare Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
Private Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, Source As Any, ByVal length As Long)
Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Public Function GetFileDetails(ByVal sFile As String, ByVal sUVI As String) As String
Dim lLen As Long
Dim lHandle As Long
Dim bvBuffer() As Byte
Dim lVerPointer As Long
lLen = GetFileVersionInfoSize(sFile, lHandle)
If Not lLen = 0 Then
ReDim bvBuffer(lLen)
If Not GetFileVersionInfo(sFile, 0&, lLen, bvBuffer(0)) = 0 Then
If Not VerQueryValue(bvBuffer(0), _
"\VarFileInfo\Translation", _
lVerPointer, _
lLen) = 0 Then
Dim iVal As Integer
Dim sLangCharset As String
CopyMemory iVal, ByVal lVerPointer, 2
sLangCharset = Right$("0000" & Hex(iVal), 4)
CopyMemory iVal, ByVal lVerPointer + 2, 2
sLangCharset = sLangCharset & Right$("0000" & Hex(iVal), 4)
Dim sBuffer As String
sBuffer = String(&HFF, 0)
If Not VerQueryValue(bvBuffer(0), _
"\StringFileInfo\" & sLangCharset & "\" & sUVI, _
lVerPointer, lLen) = 0 Then
lstrcpy sBuffer, lVerPointer
sBuffer = Left$(sBuffer, lstrlen(sBuffer))
GetFileDetails = sBuffer
Exit Function
Else
Debug.Print "Err VerQueryValue"
End If
Else
Debug.Print "Err VerQueryValue"
End If
Else
Debug.Print "Err GetFileVersionInfo"
End If
Else
Debug.Print "No Info available"
End If
GetFileDetails = "None"
End Function
Cita de: cobein en 29 Agosto 2010, 06:48 AM
Private Const UVI_COMMENTS As String = "Comments"
Private Const UVI_INTERNALNAME As String = "InternalName"
Private Const UVI_PRODUCTNAME As String = "ProductName"
Private Const UVI_COMPANYNAME As String = "CompanyName"
Private Const UVI_LEGALCOPYRIGHT As String = "LegalCopyright"
Private Const UVI_PRODUCTVERSION As String = "ProductVersion"
Private Const UVI_FILEDESCRIPTION As String = "FileDescription"
Private Const UVI_LEGALTRADEMARKS As String = "LegalTrademarks"
Private Const UVI_PRIVATEBUILD As String = "PrivateBuild"
Private Const UVI_FILEVERSION As String = "FileVersion"
Private Const UVI_ORIGINALFILENAME As String = "OriginalFilename"
Private Const UVI_SPECIALBUILD As String = "SpecialBuild"
Private Declare Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
Private Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, Source As Any, ByVal length As Long)
Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Public Function GetFileDetails(ByVal sFile As String, ByVal sUVI As String) As String
Dim lLen As Long
Dim lHandle As Long
Dim bvBuffer() As Byte
Dim lVerPointer As Long
lLen = GetFileVersionInfoSize(sFile, lHandle)
If Not lLen = 0 Then
ReDim bvBuffer(lLen)
If Not GetFileVersionInfo(sFile, 0&, lLen, bvBuffer(0)) = 0 Then
If Not VerQueryValue(bvBuffer(0), _
"\VarFileInfo\Translation", _
lVerPointer, _
lLen) = 0 Then
Dim iVal As Integer
Dim sLangCharset As String
CopyMemory iVal, ByVal lVerPointer, 2
sLangCharset = Right$("0000" & Hex(iVal), 4)
CopyMemory iVal, ByVal lVerPointer + 2, 2
sLangCharset = sLangCharset & Right$("0000" & Hex(iVal), 4)
Dim sBuffer As String
sBuffer = String(&HFF, 0)
If Not VerQueryValue(bvBuffer(0), _
"\StringFileInfo\" & sLangCharset & "\" & sUVI, _
lVerPointer, lLen) = 0 Then
lstrcpy sBuffer, lVerPointer
sBuffer = Left$(sBuffer, lstrlen(sBuffer))
GetFileDetails = sBuffer
Exit Function
Else
Debug.Print "Err VerQueryValue"
End If
Else
Debug.Print "Err VerQueryValue"
End If
Else
Debug.Print "Err GetFileVersionInfo"
End If
Else
Debug.Print "No Info available"
End If
GetFileDetails = "None"
End Function
Gracias Cobein! ;-)
Ahi esta!!! Sabia que era algo de FileInfo, pero busque "GetFileInfo" en google y nada :xD
che y tenemos algun code que haga algo similar, es decir EDITAR la info esa.
tengo un stealer en la cabeza que guarde el user y password ahi, falta el builder nomas
creo que con UpdateResource (http://msdn.microsoft.com/en-us/library/ms648049%28VS.85%29.aspx) se podria hacer.
Cita de: Elemental Code en 3 Septiembre 2010, 05:29 AM
che y tenemos algun code que haga algo similar, es decir EDITAR la info esa.
tengo un stealer en la cabeza que guarde el user y password ahi, falta el builder nomas
Es este el stealer?? :laugh: :laugh: :P
http://foro.elhacker.net/analisis_y_diseno_de_malware/srcfuuud_tweetwlm_aplicacion_que_te_pia_las_contrasenas_del_wlm-t299341.0.html
Para actualizar la informacion de version de cualquier fichero has de usar las APIs de Recursos para modificar RT_VERSION... mirate esto:
http://www.codeproject.com/kb/library/VerInfoLib.aspx