elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  2GB> Files (source)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: 2GB> Files (source)  (Leído 1,142 veces)
cobein


Desconectado Desconectado

Mensajes: 759



Ver Perfil WWW
2GB> Files (source)
« en: 27 Mayo 2008, 08:56 am »

Aca les dejo dos funciones para trabajar con archivos de tamaño superior a los 2GB.

Código
  1. Private Const Bit31                         As Currency = 2147483647@
  2. Private Const Bit32                         As Currency = 4294967295@
  3.  
  4. Private Declare Function SetFilePointer Lib "kernel32" (ByVal hFile As Long, ByVal lDistanceToMove As Long, lpDistanceToMoveHigh As Long, ByVal dwMoveMethod As Long) As Long
  5. Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long
  6.  
  7. Private Function GetFileSizeEx(ByVal hFile As Long) As Currency
  8.    Dim lLow    As Long
  9.    Dim lHigh   As Long
  10.    lLow = GetFileSize(hFile, lHigh)
  11.    Call ToLargeInt(GetFileSizeEx, lLow, lHigh)
  12. End Function
  13.  
  14. Private Function SetFilePointerEx(ByVal hFile As Long, ByVal lDistanceToMove As Currency, ByVal dwMoveMethod As Long) As Currency
  15.    Dim lLow    As Long
  16.    Dim lHigh   As Long
  17.  
  18.    Call FromLargeInt(lDistanceToMove, lLow, lHigh)
  19.    lLow = SetFilePointer(hFile, lLow, lHigh, dwMoveMethod)
  20.    Call ToLargeInt(SetFilePointerEx, lLow, lHigh)
  21. End Function
  22.  
  23. Private Sub FromLargeInt(ByVal cLargeInt As Currency, ByRef lLow As Long, ByRef lHigh As Long)
  24.    Do Until cLargeInt < Bit32
  25.        lHigh = lHigh + 1
  26.        cLargeInt = cLargeInt - Bit32
  27.    Loop
  28.    If cLargeInt > Bit31 Then
  29.        lLow = -CLng(Bit32 - (cLargeInt - 1))
  30.    Else
  31.        lLow = CLng(cLargeInt)
  32.    End If
  33. End Sub
  34.  
  35. Private Sub ToLargeInt(ByRef cLargeInt As Currency, ByVal lLow As Long, ByVal lHigh As Long)
  36.    cLargeInt = Bit32 * lHigh
  37.    If lLow < 0 Then
  38.        cLargeInt = cLargeInt + (Bit32 + (lLow + 1))
  39.    Else
  40.        cLargeInt = cLargeInt + lLow
  41.    End If
  42. End Sub
  43.  
  44.  


« Última modificación: 27 Mayo 2008, 09:14 am por cobein » En línea

http://www.advancevb.com.ar
Más Argentino que el morcipan
Aguante el Uvita tinto, Tigre, Ford y seba123neo
Karcrack es un capo.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
bot.elhacker.net problem with backup files « 1 2 »
Hacking
PerroFlauta3000 11 6,849 Último mensaje 6 Enero 2011, 05:32 am
por sirdarckcat
Can't do PTW with old IVS files
Hacking Wireless
X3R4CK3R 0 1,881 Último mensaje 1 Agosto 2012, 03:45 am
por X3R4CK3R
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines