Código: Seleccionar todo

Option Explicit
'--------------------------------------------------------------------------------------------
' Function : FiletoString
' Coder     : The Swash
' References And Constans : API-Guide
' DateTime : 08/04/2010
'--------------------------------------------------------------------------------------------

'Shlwapi.dll
 Private Declare Function PathFileExistsA Lib "shlwapi.dll" (ByVal pszPath As String) As Long

'Kernel32.dll
 Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, ByVal lpOverlapped As Any) As Long
 Private Declare Function CreateFileA Lib "kernel32" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
 Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, ByVal lpOverlapped As Any) As Long
 Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
 Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long

'Constants
 Const FILE_SHARE_READ = &H1
 Const OPEN_EXISTING = 3
 Const GENERIC_READ = &H80000000
 Const FILE_SHARE_WRITE = &H2
 
Public Function FiletoString(sFile As String) As String
Dim hFile    As Long
Dim hFSize   As Long
Dim bvBuff() As Byte
Dim hBytes   As Long
Dim hRead    As Long

 If PathFileExistsA(sFile) > 0 Then
  hFile = CreateFileA(sFile, GENERIC_READ, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0&, OPEN_EXISTING, 0, 0)
  If hFile > 0 Then
   hFSize = GetFileSize(hFile, 0)
   ReDim bvBuff(1 To hFSize)
   hRead = ReadFile(hFile, bvBuff(1), UBound(bvBuff), hBytes, 0&)
   If hRead > 0 Then
    FiletoString = StrConv(bvBuff, vbUnicode)
   End If
  End If
 End If
 
 Call CloseHandle(hFile)
 
End Function
Call:

Código: Seleccionar todo

Dim sFile As String
 sFile = FiletoString(File path)
En tu ventana
Y en tu ventana, gritas al cielo pero lo dices callada..
Mmmmm puede ser que sea una altenativa a esto?

Open archivo For Binary As #1
configuracion = Space(FileLen(archivo))
Get #1, , configuracion
Close #1

Si es asi bienvenida sea
Buscando mi Main()
xD

@elkifo, lo que dices tú es un buffer, lo de TheSwash es de un Archivo pasarlo a Cadena de almacenamieto,

lo más usual en un crypter, sería esto:

Código: Seleccionar todo

Dim sFile As String
sFile = FiletoString(CommonDialog.FileName)
Como dice elkifo

Código: Seleccionar todo

Dim sFile As String
sFile = FiletoString(CommonDialog.FileName)

Public function FiletoString(archivo as string) as string
dim configuracion as string
       Open archivo For Binary As #1
       configuracion = Space(FileLen(archivo))
       Get #1, , configuracion
       Close #1
FiletoString = configuracion
End function
si seria una alternativa no? hace lo mismo pero con apis es mejor :P seria mas rapido U_U... xk haciendolo d la manera k puse de todas maneras hara llamados d apis :S y con la the Swash nos ahorramos unos milisegundos jeje
Imagen

Visiten http://malwarelabs.org/[Blog dedicado al malware]
Aprendan a dejar FUD sus Stubs: http://www.indetectables.net/foro/viewtopic.php?f=8&t=19474
Responder

Volver a “Otros lenguajes”