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

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


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

Desconectado Desconectado

Mensajes: 30


Ver Perfil
Programa de actualizacion de archivos
« en: 25 Noviembre 2009, 07:19 am »

Hola gente, he estado trabajando en un programa que se encarga de actualizar los archivos del cliente de un juego(Concretamente MuOnline), el program funcion de la siguiente manera:
1) se conecta al servidor web, y decsrga de el un archivo de texto con los archivos a actualizar
2) leer el achivo  el cuel contiene los sgte datos de cada fichero a actualizar:
   *[fileN] ' donde N es el numero de actualizacion
   *url 'direccion del archivo en cuestion
   *descr 'descripccion del mismo
   *newchecksum 'Suma de comprobacion
   *localversion 'nombre del archivo de destino
   *targetdir  'Direccion de destino del fichero
   *compressed si se encuentra comprimido
3) verifica si el fichero existe en el cliente, y si su suma de verificacion es correcta
4) descarga los archivos
5) los coloca donde se supone que van
6) inicia el cliente del juego
Ahora estoy trabajando en la parte de verificacion de la existencia del archivo y su suma de verificacion, pero quiero consultarlos aver si le daj un vistaso y me cometan que les parece y me den su opinion respecto a la optimisacion del codigo.
Bueno siin mas aqui el codigo
FrmInicial:
Código
  1. Option Explicit
  2.  
  3. 'Api GetLongPathName para convertir el path
  4. ''''''''''''''''''''''''''''''''''''''''''''
  5. Private Declare Function GetLongPathName Lib _
  6.    "kernel32.dll" _
  7.    Alias "GetLongPathNameA" ( _
  8.    ByVal lpszShortPath As String, _
  9.    ByVal lpszLongPath As String, _
  10.    ByVal cchBuffer As Long) As Long
  11.    'Función Api ShellExecute para abrir el archivo html
  12. Private Declare Function ShellExecute _
  13.    Lib "shell32.dll" _
  14.    Alias "ShellExecuteA" ( _
  15.        ByVal hWnd As Long, _
  16.        ByVal lpOperation As String, _
  17.        ByVal lpFile As String, _
  18.        ByVal lpParameters As String, _
  19.        ByVal lpDirectory As String, _
  20.        ByVal nShowCmd As Long) As Long
  21.  
  22. Private m_CRC As clsCRC
  23. Public TEMP As String 'Variable de directorio temporal
  24. Dim filesize As String
  25. Dim FILES As Long
  26. Dim FILE As String
  27. Dim nomArchivo As String
  28. Dim CRC As String
  29. Dim CountDescargas As Long
  30. Dim i As Long
  31. Private Type Lista
  32.    Direccion As String
  33.    Descr As String
  34.    Checksum As String
  35.    LocalFile As String
  36.    Destino As String
  37.    Comprimido As String
  38. End Type
  39. Dim Down() As Lista
  40. Private Sub Download(URL As String)
  41. With Inet1
  42.    .AccessType = icUseDefault
  43.    .URL = URL
  44.    .Execute , "GET"
  45. End With
  46. End Sub
  47.  
  48.  
  49.  
  50. Private Sub Command1_Click()
  51. Download ("ip80.sytes.net/UpdateConf.inf")
  52. End Sub
  53.  
  54. Private Sub Form_Load()
  55.   TEMP = GetDirTemp
  56. CountDescargas = 1
  57. End Sub
  58.  
  59. ' retorna la Ruta
  60. '''''''''''''''''''
  61. Function GetDirTemp() As String
  62.    If Environ$("temp") <> vbNullString Then
  63.       Dim Buffer As String
  64.       Buffer = String(255, 0) ' buffer de caracteres para el retorno
  65.       ' llamada a GetLongPathName para convertir
  66.       Call GetLongPathName(Environ$("temp"), Buffer, 255)
  67.       ' Retorno
  68.       GetDirTemp = Replace(Buffer, Chr(0), vbNullString)
  69.    End If
  70. End Function
  71.  
  72. Private Sub Inet1_StateChanged(ByVal State As Integer)
  73. Dim vtData As Variant
  74. Dim bDone As Boolean, tempArray() As Byte
  75. Dim filesize As String, contenttype As String
  76. nomArchivo = Right(Inet1.URL, Len(Inet1.URL) - InStrRev(Inet1.URL, "/"))
  77. 'On Error GoTo err_sub
  78. Select Case State
  79.  
  80.    Case icResponseCompleted
  81.         bDone = False
  82.         filesize = Inet1.GetHeader("Content-length")
  83.         contenttype = Inet1.GetHeader("Content-type")
  84. If nomArchivo = "UpdateConf.inf" Then ' si el archivo es UpdateConf.inf
  85.         Open TEMP & "\" & nomArchivo For Binary As #1
  86.         vtData = Inet1.GetChunk(1024, icByteArray)
  87.  
  88.         DoEvents
  89.  
  90.         If Len(vtData) = 0 Then
  91.            bDone = True
  92.         End If
  93.  
  94.    Do While Not bDone
  95.  
  96.       tempArray = vtData
  97.  
  98.       Put #1, , tempArray
  99.  
  100.  
  101.  
  102.       vtData = Inet1.GetChunk(1024, icByteArray)
  103.  
  104.       DoEvents
  105.  
  106.       If Len(vtData) = 0 Then
  107.          bDone = True
  108.  
  109.  
  110.        End If
  111.  
  112.    Loop
  113. Obtener_Lista
  114.  
  115.    Close #1
  116. FileCopy TEMP & "\UpdateConf.inf", App.Path & "\NPXI.DAT"
  117.   Else ' en caso contrario
  118.            Open App.Path & "\" & nomArchivo For Binary As #1
  119.         vtData = Inet1.GetChunk(1024, icByteArray)
  120.  
  121.         DoEvents
  122.  
  123.         If Len(vtData) = 0 Then
  124.            bDone = True
  125.         End If
  126.            With ProgressBar1
  127.                 .Value = 0
  128.                 .Max = filesize
  129.            End With
  130.    Do While Not bDone
  131.  
  132.       tempArray = vtData
  133.  
  134.       Put #1, , tempArray
  135.  
  136.  
  137.  
  138.       vtData = Inet1.GetChunk(1024, icByteArray)
  139.  
  140.       DoEvents
  141. ProgressBar1.Value = ProgressBar1.Value + (Len(vtData) * 2)
  142.       If Len(vtData) = 0 Then
  143.          bDone = True
  144.  
  145.  
  146.        End If
  147.  
  148.    Loop
  149.  
  150.    Close #1
  151.  ProgressBar1.Value = 0
  152.  List1.ListItems.Item(CountDescargas).Checked = True
  153.  CountDescargas = CountDescargas + 1
  154.  Descargar
  155. End If
  156. End Select
  157. Exit Sub
  158. err_sub:
  159.  
  160.          ShellExecute Me.hWnd, _
  161.                  vbNullString, _
  162.                  "http://midominio.net/err/?" & Err.Number, _
  163.                  vbNullString, _
  164.                  vbNullString, 1
  165.     On Error Resume Next
  166.  Kill App.Path & "\NPXI.DAT"
  167.     Inet1.Cancel
  168.   ProgressBar1.Value = 0
  169.   End
  170. End Sub
  171.  
  172. Sub Obtener_Lista()
  173.  
  174. FILES = LeerIni("FILES", "Count", TEMP & "\" & nomArchivo) ' Leo la cantidad de archivos que se descargaran
  175. ReDim Preserve Down(1 To FILES) ' Redimensiono el array en para que entren todos los datos
  176. For i = 1 To FILES 'Leo uno a uno los datos en las secciones
  177.    FILE = "file" & i ' Agrego i a flie para tener la secion a leer
  178.    Down(i).Direccion = LeerIni(FILE, "url", TEMP & "\" & nomArchivo) ' Leo url y la paso al array
  179.    Down(i).Descr = LeerIni(FILE, "descr", TEMP & "\" & nomArchivo) ' Leo desc y la paso al array
  180.    Down(i).Checksum = LeerIni(FILE, "newchecksum", TEMP & "\" & nomArchivo) ' Leo newchecksum y la paso al array
  181.    Down(i).LocalFile = LeerIni(FILE, "localversion", TEMP & "\" & nomArchivo) ' Leo localversion y la paso al array
  182.    Down(i).Comprimido = LeerIni(FILE, "compressed", TEMP & "\" & nomArchivo) ' Leo compressed y la paso al array
  183.    Down(i).Destino = LeerIni(FILE, "targetdir", TEMP & "\" & nomArchivo) ' Leo compressed y la paso al array
  184.    List1.ListItems.Add = Down(i).Descr ' Coloco los nombre de los ficheros en el lista de archivos
  185.  
  186.  
  187.  
  188. Next
  189. Verifica_Archivos
  190. End Sub
  191.  
  192. Sub CalcularCRC() 'calcula CRC del archivo
  193. Dim OldTimer As Single
  194. m_CRC.Algorithm = CRC32
  195.  If (Mid$(Down(i).Checksum, 2, 2) = ":\") Then
  196.    OldTimer = Timer
  197.    CRC = Hex(m_CRC.CalculateFile(Down(i).Checksum))
  198.    Exit Sub
  199.  End If
  200. End Sub
  201. Sub Verifica_Archivos() 'Verifico si el archivo existe en el equipo remoto
  202. Dim A() As Lista 'creo el array
  203.    For i = LBound(Down) To UBound(Down) 'Hago un bucle para verificar uno a uno los ficheros
  204.  
  205.    If IsFile(App.Path & Down(i).Destino & "\" & Down(i).LocalFile) = False Then 'Existe el fichero?
  206.        ReDim Preserve A(UBound(Down)) 'redimenciono el array A para que solo queden ficheros quedeben descargarse
  207.            A(i).Checksum = Down(i).Checksum
  208.            A(i).Comprimido = Down(i).Comprimido
  209.            A(i).Descr = Down(i).Descr
  210.            A(i).Destino = Down(i).Destino
  211.            A(i).Direccion = Down(i).Direccion
  212.            A(i).LocalFile = Down(i).LocalFile
  213. End If
  214.  
  215. Next
  216.  
  217. ReDim Down(1 To UBound(A))
  218.    For i = 1 To UBound(A)
  219.        Down(i).Checksum = A(i).Checksum
  220.        Down(i).Comprimido = A(i).Comprimido
  221.        Down(i).Descr = A(i).Descr
  222.        Down(i).Destino = A(i).Destino
  223.        Down(i).Direccion = A(i).Direccion
  224.        Down(i).LocalFile = A(i).LocalFile
  225. Next
  226.  
  227. End Sub
  228. Sub Descargar()
  229. If i - 1 = FILES Then
  230. Download (Down(CountDescargas).Direccion)
  231. lblDescargados.Caption = CountDescargas & "\" & FILES
  232. If CountDescargas = FILES Then
  233.     ShellExecute Me.hWnd, _
  234.                  vbNullString, _
  235.                  App.Path & "\main.exe", _
  236.                  vbNullString, _
  237.                  vbNullString, 1
  238. End If
  239. End If
  240. End Sub
  241. Function IsFile(ByVal Filename As String) As Boolean
  242.  On Error Resume Next
  243.  IsFile = (GetAttr(Filename) And Not vbDirectory)
  244. End Function
  245.  
IniFiles.bas

Código
  1. Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
  2.  
  3. Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  4.  
  5. Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
  6.  
  7. Public Sub EscribirINI(S As String, C As String, V As String, ArchINI As String)
  8.   'S= sección a escribir
  9.   'C=Clave a escribir
  10.   'V=Valor a escribir
  11.   'Archini=Archivo a leer
  12.   'Escribo finalmente en el archivo INI
  13.   WritePrivateProfileString S, C, V, ArchINI
  14. End Sub
  15.  
  16. Public Function LeerIni(S As String, C As String, ArchivoINI As String) As String
  17.  
  18.   'S=sección de la cual leer
  19.   'C=Clave a leer
  20.   'Archivoini=Archivo a leer
  21.   Dim Var As String
  22.   Var = Space(128)
  23.   Dim R As Long
  24.   R = GetPrivateProfileString(S, C, "ERROR", Var, 128, ArchivoINI)
  25.   LeerIni = Left(Var, R)
  26.  
  27. End Function
  28.  

CRC.bas
Código
  1. 'CRC Checksum Class
  2. '------------------------------------
  3. '
  4. 'A very fast solution to calculate the
  5. 'CRC Checksum (at the moment CRC16 and
  6. 'CRC32 values) with the help of some
  7. 'pre-compiled assembler code
  8. '
  9. '(c) 2000, Fredrik Qvarfort
  10. '
  11.  
  12. Option Explicit
  13.  
  14. Public Enum CRCAlgorithms
  15.  CRC16
  16.  CRC32
  17. End Enum
  18. Private m_Algorithm As Boolean
  19.  
  20. Private m_CRC16 As Long
  21. Private m_CRC16Asm() As Byte
  22. Private m_CRC16Init As Boolean
  23. Private m_CRC16Table(0 To 255) As Long
  24.  
  25. Private m_CRC32 As Long
  26. Private m_CRC32Asm() As Byte
  27. Private m_CRC32Init As Boolean
  28. Private m_CRC32Table(0 To 255) As Long
  29.  
  30. Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  31.  
  32. Public Function AddBytes(ByteArray() As Byte) As Variant
  33.  
  34.  Dim ByteSize As Long
  35.  
  36.  'We need to add a simple error trapping
  37.  'here because if the bytearray is not
  38.  'dimensioned we want it to just skip
  39.  'the assembler code call below
  40.  On Local Error GoTo NoData
  41.  
  42.  'Precalculate the size of the byte array
  43.  ByteSize = UBound(ByteArray) - LBound(ByteArray) + 1
  44.  
  45.  'No error trapping needed, if something
  46.  'goes bad below something is definitely
  47.  'fishy with your computer
  48.  On Local Error GoTo 0
  49.  
  50.  'Run the pre-compiled assembler code
  51.  'for the current selected algorithm
  52.  Select Case m_Algorithm
  53.  Case CRC16
  54.    Call CallWindowProc(VarPtr(m_CRC16Asm(0)), VarPtr(m_CRC16), VarPtr(ByteArray(LBound(ByteArray))), VarPtr(m_CRC16Table(0)), ByteSize)
  55.  Case CRC32
  56.    Call CallWindowProc(VarPtr(m_CRC32Asm(0)), VarPtr(m_CRC32), VarPtr(ByteArray(LBound(ByteArray))), VarPtr(m_CRC32Table(0)), ByteSize)
  57.  End Select
  58.  
  59. NoData:
  60.  'Return the current CRC value
  61.  AddBytes = Value
  62.  
  63. End Function
  64. Public Function AddString(Text As String) As Variant
  65.  
  66.  'Convert the string into a byte array
  67.  'and send it to the function that can
  68.  'handle bytearrays
  69.  AddString = AddBytes(StrConv(Text, vbFromUnicode))
  70.  
  71. End Function
  72. Public Property Let Algorithm(New_Value As CRCAlgorithms)
  73.  
  74.  'Set the new algorithm
  75.  m_Algorithm = New_Value
  76.  
  77.  'Make sure we have initialized the
  78.  'current selected algorithm
  79.  Select Case m_Algorithm
  80.  Case CRC16
  81.    If (Not m_CRC16Init) Then Call InitializeCRC16
  82.  Case CRC32
  83.    If (Not m_CRC32Init) Then Call InitializeCRC32
  84.  End Select
  85.  
  86.  'Make sure we reset the data of the
  87.  'current selected algorithm
  88.  Call Clear
  89.  
  90. End Property
  91. Public Property Get Algorithm() As CRCAlgorithms
  92.  
  93.  Algorithm = m_Algorithm
  94.  
  95. End Property
  96.  
  97. Public Function CalculateBytes(ByteArray() As Byte) As Variant
  98.  
  99.  'Reset the current CRC calculation
  100.  Call Clear
  101.  
  102.  'Calculate the CRC from the bytearray
  103.  'and return the current CRC value
  104.  CalculateBytes = AddBytes(ByteArray)
  105.  
  106. End Function
  107.  
  108. Public Function CalculateFile(Filename As String) As Variant
  109.  
  110.  Dim Filenr As Integer
  111.  Dim ByteArray() As Byte
  112.  
  113.  'Make sure the file contains data
  114.  'to avoid errors later below
  115.  If (FileLen(Filename) = 0) Then Exit Function
  116.  
  117.  'Open the file in binary mode, read
  118.  'the data into a bytearray and then
  119.  'close the file
  120.  Filenr = FreeFile
  121.  Open Filename For Binary As #Filenr
  122.  ReDim ByteArray(0 To LOF(Filenr) - 1)
  123.  Get #Filenr, , ByteArray()
  124.  Close #Filenr
  125.  
  126.  'Now send the bytearray to the function
  127.  'that can calculate a CRC from it
  128.  CalculateFile = CalculateBytes(ByteArray)
  129.  
  130. End Function
  131. Public Function CalculateString(Text As String)
  132.  
  133.  'Convert the string into a bytearray
  134.  'and send it to the function that
  135.  'calculates the CRC from a bytearray
  136.  CalculateString = CalculateBytes(StrConv(Text, vbFromUnicode))
  137.  
  138. End Function
  139. Public Property Get Value() As Variant
  140.  
  141.  Select Case m_Algorithm
  142.  Case CRC16
  143.    Value = (m_CRC16 And 65535)
  144.  Case CRC32
  145.    Value = (Not m_CRC32)
  146.  End Select
  147.  
  148. End Property
  149.  
  150. Public Property Let Value(New_Value As Variant)
  151.  
  152.  Select Case m_Algorithm
  153.  Case CRC16
  154.    m_CRC16 = New_Value
  155.  Case CRC32
  156.    m_CRC32 = New_Value
  157.  End Select
  158.  
  159. End Property
  160.  
  161. Private Sub InitializeCRC16()
  162.  
  163.  Dim i As Long
  164.  Dim j As Long
  165.  Dim k As Long
  166.  Dim CRC As Long
  167.  Dim sASM As String
  168.  
  169.  'Create the fixed lookup-table, this
  170.  'is calculated because it won't take
  171.  'long and is only done once
  172.  For i = 0 To 255
  173.    k = i * 256
  174.    CRC = 0
  175.    For j = 0 To 7
  176.      If (((CRC Xor k) And 32768) = 32768) Then
  177.        CRC = (CRC * 2) Xor &H1021
  178.      Else
  179.        CRC = (CRC * 2)
  180.      End If
  181.      k = k * 2
  182.    Next
  183.    m_CRC16Table(i) = CRC '(CRC And 65535)
  184.  Next
  185.  
  186.  'Create a bytearray to hold the
  187.  'precompiled assembler code
  188.  sASM = "5589E55756505351528B45088B008B750C8B7D108B4D1431DB8A1E30E3668B149F30C66689D0464975EF25FFFF00008B4D0889015A595B585E5F89EC5DC21000"
  189.  ReDim m_CRC16Asm(0 To Len(sASM) \ 2 - 1)
  190.  For i = 1 To Len(sASM) Step 2
  191.    m_CRC16Asm(i \ 2) = Val("&H" & Mid$(sASM, i, 2))
  192.  Next
  193.  
  194.  'Mark the CRC16 algorithm as initialized
  195.  m_CRC16Init = True
  196.  
  197. End Sub
  198. Public Sub Clear()
  199.  
  200.  'Here can be sloppy and reset both
  201.  'crc variables (this procedure will
  202.  'be more advanced when adding more
  203.  'checksums algorithms..)
  204.  m_CRC16 = 0
  205.  m_CRC32 = &HFFFFFFFF
  206.  
  207. End Sub
  208.  
  209. Private Sub InitializeCRC32()
  210.  
  211.  Dim i As Long
  212.  Dim sASM As String
  213.  
  214.  m_CRC32Table(0) = &H0
  215.  m_CRC32Table(1) = &H77073096
  216.  m_CRC32Table(2) = &HEE0E612C
  217.  m_CRC32Table(3) = &H990951BA
  218.  m_CRC32Table(4) = &H76DC419
  219.  m_CRC32Table(5) = &H706AF48F
  220.  m_CRC32Table(6) = &HE963A535
  221.  m_CRC32Table(7) = &H9E6495A3
  222.  m_CRC32Table(8) = &HEDB8832
  223.  m_CRC32Table(9) = &H79DCB8A4
  224.  m_CRC32Table(10) = &HE0D5E91E
  225.  m_CRC32Table(11) = &H97D2D988
  226.  m_CRC32Table(12) = &H9B64C2B
  227.  m_CRC32Table(13) = &H7EB17CBD
  228.  m_CRC32Table(14) = &HE7B82D07
  229.  m_CRC32Table(15) = &H90BF1D91
  230.  m_CRC32Table(16) = &H1DB71064
  231.  m_CRC32Table(17) = &H6AB020F2
  232.  m_CRC32Table(18) = &HF3B97148
  233.  m_CRC32Table(19) = &H84BE41DE
  234.  m_CRC32Table(20) = &H1ADAD47D
  235.  m_CRC32Table(21) = &H6DDDE4EB
  236.  m_CRC32Table(22) = &HF4D4B551
  237.  m_CRC32Table(23) = &H83D385C7
  238.  m_CRC32Table(24) = &H136C9856
  239.  m_CRC32Table(25) = &H646BA8C0
  240.  m_CRC32Table(26) = &HFD62F97A
  241.  m_CRC32Table(27) = &H8A65C9EC
  242.  m_CRC32Table(28) = &H14015C4F
  243.  m_CRC32Table(29) = &H63066CD9
  244.  m_CRC32Table(30) = &HFA0F3D63
  245.  m_CRC32Table(31) = &H8D080DF5
  246.  m_CRC32Table(32) = &H3B6E20C8
  247.  m_CRC32Table(33) = &H4C69105E
  248.  m_CRC32Table(34) = &HD56041E4
  249.  m_CRC32Table(35) = &HA2677172
  250.  m_CRC32Table(36) = &H3C03E4D1
  251.  m_CRC32Table(37) = &H4B04D447
  252.  m_CRC32Table(38) = &HD20D85FD
  253.  m_CRC32Table(39) = &HA50AB56B
  254.  m_CRC32Table(40) = &H35B5A8FA
  255.  m_CRC32Table(41) = &H42B2986C
  256.  m_CRC32Table(42) = &HDBBBC9D6
  257.  m_CRC32Table(43) = &HACBCF940
  258.  m_CRC32Table(44) = &H32D86CE3
  259.  m_CRC32Table(45) = &H45DF5C75
  260.  m_CRC32Table(46) = &HDCD60DCF
  261.  m_CRC32Table(47) = &HABD13D59
  262.  m_CRC32Table(48) = &H26D930AC
  263.  m_CRC32Table(49) = &H51DE003A
  264.  m_CRC32Table(50) = &HC8D75180
  265.  m_CRC32Table(51) = &HBFD06116
  266.  m_CRC32Table(52) = &H21B4F4B5
  267.  m_CRC32Table(53) = &H56B3C423
  268.  m_CRC32Table(54) = &HCFBA9599
  269.  m_CRC32Table(55) = &HB8BDA50F
  270.  m_CRC32Table(56) = &H2802B89E
  271.  m_CRC32Table(57) = &H5F058808
  272.  m_CRC32Table(58) = &HC60CD9B2
  273.  m_CRC32Table(59) = &HB10BE924
  274.  m_CRC32Table(60) = &H2F6F7C87
  275.  m_CRC32Table(61) = &H58684C11
  276.  m_CRC32Table(62) = &HC1611DAB
  277.  m_CRC32Table(63) = &HB6662D3D
  278.  m_CRC32Table(64) = &H76DC4190
  279.  m_CRC32Table(65) = &H1DB7106
  280.  m_CRC32Table(66) = &H98D220BC
  281.  m_CRC32Table(67) = &HEFD5102A
  282.  m_CRC32Table(68) = &H71B18589
  283.  m_CRC32Table(69) = &H6B6B51F
  284.  m_CRC32Table(70) = &H9FBFE4A5
  285.  m_CRC32Table(71) = &HE8B8D433
  286.  m_CRC32Table(72) = &H7807C9A2
  287.  m_CRC32Table(73) = &HF00F934
  288.  m_CRC32Table(74) = &H9609A88E
  289.  m_CRC32Table(75) = &HE10E9818
  290.  m_CRC32Table(76) = &H7F6A0DBB
  291.  m_CRC32Table(77) = &H86D3D2D
  292.  m_CRC32Table(78) = &H91646C97
  293.  m_CRC32Table(79) = &HE6635C01
  294.  m_CRC32Table(80) = &H6B6B51F4
  295.  m_CRC32Table(81) = &H1C6C6162
  296.  m_CRC32Table(82) = &H856530D8
  297.  m_CRC32Table(83) = &HF262004E
  298.  m_CRC32Table(84) = &H6C0695ED
  299.  m_CRC32Table(85) = &H1B01A57B
  300.  m_CRC32Table(86) = &H8208F4C1
  301.  m_CRC32Table(87) = &HF50FC457
  302.  m_CRC32Table(88) = &H65B0D9C6
  303.  m_CRC32Table(89) = &H12B7E950
  304.  m_CRC32Table(90) = &H8BBEB8EA
  305.  m_CRC32Table(91) = &HFCB9887C
  306.  m_CRC32Table(92) = &H62DD1DDF
  307.  m_CRC32Table(93) = &H15DA2D49
  308.  m_CRC32Table(94) = &H8CD37CF3
  309.  m_CRC32Table(95) = &HFBD44C65
  310.  m_CRC32Table(96) = &H4DB26158
  311.  m_CRC32Table(97) = &H3AB551CE
  312.  m_CRC32Table(98) = &HA3BC0074
  313.  m_CRC32Table(99) = &HD4BB30E2
  314.  m_CRC32Table(100) = &H4ADFA541
  315.  m_CRC32Table(101) = &H3DD895D7
  316.  m_CRC32Table(102) = &HA4D1C46D
  317.  m_CRC32Table(103) = &HD3D6F4FB
  318.  m_CRC32Table(104) = &H4369E96A
  319.  m_CRC32Table(105) = &H346ED9FC
  320.  m_CRC32Table(106) = &HAD678846
  321.  m_CRC32Table(107) = &HDA60B8D0
  322.  m_CRC32Table(108) = &H44042D73
  323.  m_CRC32Table(109) = &H33031DE5
  324.  m_CRC32Table(110) = &HAA0A4C5F
  325.  m_CRC32Table(111) = &HDD0D7CC9
  326.  m_CRC32Table(112) = &H5005713C
  327.  m_CRC32Table(113) = &H270241AA
  328.  m_CRC32Table(114) = &HBE0B1010
  329.  m_CRC32Table(115) = &HC90C2086
  330.  m_CRC32Table(116) = &H5768B525
  331.  m_CRC32Table(117) = &H206F85B3
  332.  m_CRC32Table(118) = &HB966D409
  333.  m_CRC32Table(119) = &HCE61E49F
  334.  m_CRC32Table(120) = &H5EDEF90E
  335.  m_CRC32Table(121) = &H29D9C998
  336.  m_CRC32Table(122) = &HB0D09822
  337.  m_CRC32Table(123) = &HC7D7A8B4
  338.  m_CRC32Table(124) = &H59B33D17
  339.  m_CRC32Table(125) = &H2EB40D81
  340.  m_CRC32Table(126) = &HB7BD5C3B
  341.  m_CRC32Table(127) = &HC0BA6CAD
  342.  m_CRC32Table(128) = &HEDB88320
  343.  m_CRC32Table(129) = &H9ABFB3B6
  344.  m_CRC32Table(130) = &H3B6E20C
  345.  m_CRC32Table(131) = &H74B1D29A
  346.  m_CRC32Table(132) = &HEAD54739
  347.  m_CRC32Table(133) = &H9DD277AF
  348.  m_CRC32Table(134) = &H4DB2615
  349.  m_CRC32Table(135) = &H73DC1683
  350.  m_CRC32Table(136) = &HE3630B12
  351.  m_CRC32Table(137) = &H94643B84
  352.  m_CRC32Table(138) = &HD6D6A3E
  353.  m_CRC32Table(139) = &H7A6A5AA8
  354.  m_CRC32Table(140) = &HE40ECF0B
  355.  m_CRC32Table(141) = &H9309FF9D
  356.  m_CRC32Table(142) = &HA00AE27
  357.  m_CRC32Table(143) = &H7D079EB1
  358.  m_CRC32Table(144) = &HF00F9344
  359.  m_CRC32Table(145) = &H8708A3D2
  360.  m_CRC32Table(146) = &H1E01F268
  361.  m_CRC32Table(147) = &H6906C2FE
  362.  m_CRC32Table(148) = &HF762575D
  363.  m_CRC32Table(149) = &H806567CB
  364.  m_CRC32Table(150) = &H196C3671
  365.  m_CRC32Table(151) = &H6E6B06E7
  366.  m_CRC32Table(152) = &HFED41B76
  367.  m_CRC32Table(153) = &H89D32BE0
  368.  m_CRC32Table(154) = &H10DA7A5A
  369.  m_CRC32Table(155) = &H67DD4ACC
  370.  m_CRC32Table(156) = &HF9B9DF6F
  371.  m_CRC32Table(157) = &H8EBEEFF9
  372.  m_CRC32Table(158) = &H17B7BE43
  373.  m_CRC32Table(159) = &H60B08ED5
  374.  m_CRC32Table(160) = &HD6D6A3E8
  375.  m_CRC32Table(161) = &HA1D1937E
  376.  m_CRC32Table(162) = &H38D8C2C4
  377.  m_CRC32Table(163) = &H4FDFF252
  378.  m_CRC32Table(164) = &HD1BB67F1
  379.  m_CRC32Table(165) = &HA6BC5767
  380.  m_CRC32Table(166) = &H3FB506DD
  381.  m_CRC32Table(167) = &H48B2364B
  382.  m_CRC32Table(168) = &HD80D2BDA
  383.  m_CRC32Table(169) = &HAF0A1B4C
  384.  m_CRC32Table(170) = &H36034AF6
  385.  m_CRC32Table(171) = &H41047A60
  386.  m_CRC32Table(172) = &HDF60EFC3
  387.  m_CRC32Table(173) = &HA867DF55
  388.  m_CRC32Table(174) = &H316E8EEF
  389.  m_CRC32Table(175) = &H4669BE79
  390.  m_CRC32Table(176) = &HCB61B38C
  391.  m_CRC32Table(177) = &HBC66831A
  392.  m_CRC32Table(178) = &H256FD2A0
  393.  m_CRC32Table(179) = &H5268E236
  394.  m_CRC32Table(180) = &HCC0C7795
  395.  m_CRC32Table(181) = &HBB0B4703
  396.  m_CRC32Table(182) = &H220216B9
  397.  m_CRC32Table(183) = &H5505262F
  398.  m_CRC32Table(184) = &HC5BA3BBE
  399.  m_CRC32Table(185) = &HB2BD0B28
  400.  m_CRC32Table(186) = &H2BB45A92
  401.  m_CRC32Table(187) = &H5CB36A04
  402.  m_CRC32Table(188) = &HC2D7FFA7
  403.  m_CRC32Table(189) = &HB5D0CF31
  404.  m_CRC32Table(190) = &H2CD99E8B
  405.  m_CRC32Table(191) = &H5BDEAE1D
  406.  m_CRC32Table(192) = &H9B64C2B0
  407.  m_CRC32Table(193) = &HEC63F226
  408.  m_CRC32Table(194) = &H756AA39C
  409.  m_CRC32Table(195) = &H26D930A
  410.  m_CRC32Table(196) = &H9C0906A9
  411.  m_CRC32Table(197) = &HEB0E363F
  412.  m_CRC32Table(198) = &H72076785
  413.  m_CRC32Table(199) = &H5005713
  414.  m_CRC32Table(200) = &H95BF4A82
  415.  m_CRC32Table(201) = &HE2B87A14
  416.  m_CRC32Table(202) = &H7BB12BAE
  417.  m_CRC32Table(203) = &HCB61B38
  418.  m_CRC32Table(204) = &H92D28E9B
  419.  m_CRC32Table(205) = &HE5D5BE0D
  420.  m_CRC32Table(206) = &H7CDCEFB7
  421.  m_CRC32Table(207) = &HBDBDF21
  422.  m_CRC32Table(208) = &H86D3D2D4
  423.  m_CRC32Table(209) = &HF1D4E242
  424.  m_CRC32Table(210) = &H68DDB3F8
  425.  m_CRC32Table(211) = &H1FDA836E
  426.  m_CRC32Table(212) = &H81BE16CD
  427.  m_CRC32Table(213) = &HF6B9265B
  428.  m_CRC32Table(214) = &H6FB077E1
  429.  m_CRC32Table(215) = &H18B74777
  430.  m_CRC32Table(216) = &H88085AE6
  431.  m_CRC32Table(217) = &HFF0F6A70
  432.  m_CRC32Table(218) = &H66063BCA
  433.  m_CRC32Table(219) = &H11010B5C
  434.  m_CRC32Table(220) = &H8F659EFF
  435.  m_CRC32Table(221) = &HF862AE69
  436.  m_CRC32Table(222) = &H616BFFD3
  437.  m_CRC32Table(223) = &H166CCF45
  438.  m_CRC32Table(224) = &HA00AE278
  439.  m_CRC32Table(225) = &HD70DD2EE
  440.  m_CRC32Table(226) = &H4E048354
  441.  m_CRC32Table(227) = &H3903B3C2
  442.  m_CRC32Table(228) = &HA7672661
  443.  m_CRC32Table(229) = &HD06016F7
  444.  m_CRC32Table(230) = &H4969474D
  445.  m_CRC32Table(231) = &H3E6E77DB
  446.  m_CRC32Table(232) = &HAED16A4A
  447.  m_CRC32Table(233) = &HD9D65ADC
  448.  m_CRC32Table(234) = &H40DF0B66
  449.  m_CRC32Table(235) = &H37D83BF0
  450.  m_CRC32Table(236) = &HA9BCAE53
  451.  m_CRC32Table(237) = &HDEBB9EC5
  452.  m_CRC32Table(238) = &H47B2CF7F
  453.  m_CRC32Table(239) = &H30B5FFE9
  454.  m_CRC32Table(240) = &HBDBDF21C
  455.  m_CRC32Table(241) = &HCABAC28A
  456.  m_CRC32Table(242) = &H53B39330
  457.  m_CRC32Table(243) = &H24B4A3A6
  458.  m_CRC32Table(244) = &HBAD03605
  459.  m_CRC32Table(245) = &HCDD70693
  460.  m_CRC32Table(246) = &H54DE5729
  461.  m_CRC32Table(247) = &H23D967BF
  462.  m_CRC32Table(248) = &HB3667A2E
  463.  m_CRC32Table(249) = &HC4614AB8
  464.  m_CRC32Table(250) = &H5D681B02
  465.  m_CRC32Table(251) = &H2A6F2B94
  466.  m_CRC32Table(252) = &HB40BBE37
  467.  m_CRC32Table(253) = &HC30C8EA1
  468.  m_CRC32Table(254) = &H5A05DF1B
  469.  m_CRC32Table(255) = &H2D02EF8D
  470.  
  471.  'Create a bytearray to hold the
  472.  'precompiled assembler code
  473.  sASM = "5589E557565053518B45088B008B750C8B7D108B4D1431DB8A1E30C3C1E80833049F464975F28B4D088901595B585E5F89EC5DC21000"
  474.  ReDim m_CRC32Asm(0 To Len(sASM) \ 2 - 1)
  475.  For i = 1 To Len(sASM) Step 2
  476.    m_CRC32Asm(i \ 2) = Val("&H" & Mid$(sASM, i, 2))
  477.  Next
  478.  
  479.  'Mark the CRC32 algorithm as initialized
  480.  m_CRC32Init = True
  481.  
  482. End Sub
  483. Private Sub Class_Initialize()
  484.  
  485.  'The default algorithm is CRC32
  486.  Algorithm = CRC32
  487.  
  488. End Sub
  489.  





« Última modificación: 27 Noviembre 2009, 06:52 am por shaggikpo » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Actualizacion whatsweb. Ya no me puedo enviar archivos
Windows
sunbikers 1 2,843 Último mensaje 20 Abril 2022, 12:16 pm
por sunbikers
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines