
Problema for y como cortar string
Publicado por Miguel Angel (4 intervenciones) el 08/04/2016 13:49:07
Hola buenas, dos cuestiones:
1)Tengo dos arrays, el primero se llama vbData y contiene valores hexadecimales
el segundo contiene lo que quiero buscar, lo llamo kernel32, como la lib de windows.
He intentado hacerlo con for, pero no se me ocurre como concatenar las condiciones, tipo if
2)Como es posible manipular una string para hacer esto
original: 00401DE0
modificada:E01D4000
original:00401FD4
modificada:D41F4000
original: 00402020
modificada: 20204000
1)Tengo dos arrays, el primero se llama vbData y contiene valores hexadecimales
el segundo contiene lo que quiero buscar, lo llamo kernel32, como la lib de windows.
He intentado hacerlo con for, pero no se me ocurre como concatenar las condiciones, tipo if
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Dim kernel32(0 To 8) As Long
kernel32(0) = &H6B '("6B")k
kernel32(1) = &H65 '("65")e
kernel32(2) = &H72 '("72")r
kernel32(3) = &H6E '("6E")n
kernel32(4) = &H65 '("65")e
kernel32(5) = &H6C '("6C")l
kernel32(6) = &H33 '("33")3
kernel32(7) = &H32 '("32")2
kernel32(8) = &H0 '("00")
If bvData(i) = CLng(kernel32(0)) Then 'k
If bvData(i + 1) = CLng(kernel32(1)) Then 'e
If bvData(i + 2) = CLng(kernel32(2)) Then 'r
If bvData(i + 3) = CLng(kernel32(3)) Then 'n
If bvData(i + 4) = CLng(kernel32(4)) Then 'e
If bvData(i + 5) = CLng(kernel32(5)) Then 'l
If bvData(i + 6) = CLng(kernel32(6)) Then '3
If bvData(i + 7) = CLng(kernel32(7)) Then '2
If bvData(i + 8) = CLng(kernel32(8)) Then
Debug.Print "kernel32 encontrada en " & i & " --- " & "40" & Hex(i)
End If
End If
End If
End If
End If
End If
End If
End If
End If
2)Como es posible manipular una string para hacer esto
original: 00401DE0
modificada:E01D4000
original:00401FD4
modificada:D41F4000
original: 00402020
modificada: 20204000
Valora esta pregunta


0