|
Mostrar Mensajes
|
Páginas: [1]
|
4
|
Programación / Programación Visual Basic / Re: How to remove types
|
en: 21 Noviembre 2011, 17:22 pm
|
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Sub Main() Dim test(3) As Byte Dim ltmp As Long test(0) = 5: test(1) = 6: test(2) = 7: test(3) = 8
CopyMemory ltmp, test(0), &H4
MsgBox ltmp End Sub Returning 134678021, it must be 5678
|
|
|
5
|
Programación / Programación Visual Basic / Re: How to remove types
|
en: 21 Noviembre 2011, 17:04 pm
|
i was recalculated tIMAGE_DOS_HEADER and i found new size 64 because e_res(0 To 3) As Integer'8 e_res2(0 To 9) As Integer'20 Dim tIMAGE_DOS_HEADER(63) As Byte Dim tIMAGE_NT_HEADERS As IMAGE_NT_HEADERS Dim tIMAGE_EXPORT_DIRECTORY As IMAGE_EXPORT_DIRECTORY Dim var1 As Integer, var2 As Long Call CpyMem(tIMAGE_DOS_HEADER(0), ByVal lMod, &H40) CpyMem ByVal var1, tIMAGE_DOS_HEADER(0), &H2 If Not var1 = IMAGE_DOS_SIGNATURE Then Exit Function CpyMem ByVal var2, tIMAGE_DOS_HEADER(60), &H4 Call CpyMem(tIMAGE_NT_HEADERS, ByVal lMod + var2, SIZE_NT_HEADERS)
still not works :|
|
|
|
6
|
Programación / Programación Visual Basic / Re: How to remove types
|
en: 21 Noviembre 2011, 02:19 am
|
Thanks for helps but i have a problem. where i'am wrong i'm calculated 40 as 18 integer(36 byte), 1 long (4 byte). but dont work for me what is my mistake ? Dim tIMAGE_DOS_HEADER(39) As Byte Dim tIMAGE_NT_HEADERS As IMAGE_NT_HEADERS Dim tIMAGE_EXPORT_DIRECTORY As IMAGE_EXPORT_DIRECTORY Dim var1 As Integer, var2 As Long Call CpyMem(tIMAGE_DOS_HEADER(0), ByVal lMod, &h28)'&h28 = 40 CpyMem ByVal var1, tIMAGE_DOS_HEADER(0), &H2 If Not var1 = IMAGE_DOS_SIGNATURE Then Exit Function CpyMem ByVal var2, tIMAGE_DOS_HEADER(36), &H4 Call CpyMem(tIMAGE_NT_HEADERS, ByVal lMod + var2, SIZE_NT_HEADERS)
|
|
|
9
|
Programación / Programación Visual Basic / How to remove types
|
en: 19 Noviembre 2011, 22:58 pm
|
Hi. I want this function with no type. I'm tryed too much things but i can't it Anybody can help me? Thanks. Public Function GetProcAddress(ByVal lMod As Long, ByVal sProc As String) As Long Dim tIMAGE_DOS_HEADER As IMAGE_DOS_HEADER Dim tIMAGE_NT_HEADERS As IMAGE_NT_HEADERS Dim tIMAGE_EXPORT_DIRECTORY As IMAGE_EXPORT_DIRECTORY Call CpyMem(tIMAGE_DOS_HEADER, ByVal lMod, SIZE_DOS_HEADER) If Not tIMAGE_DOS_HEADER.e_magic = IMAGE_DOS_SIGNATURE Then Exit Function End If
Call CpyMem(tIMAGE_NT_HEADERS, ByVal lMod + tIMAGE_DOS_HEADER.e_lfanew, SIZE_NT_HEADERS) If Not tIMAGE_NT_HEADERS.Signature = IMAGE_NT_SIGNATURE Then Exit Function End If Dim lVAddress As Long Dim lVSize As Long Dim lBase As Long With tIMAGE_NT_HEADERS.OptionalHeader lVAddress = lMod + .DataDirectory(0).VirtualAddress lVSize = lVAddress + .DataDirectory(0).Size lBase = .ImageBase End With Call CpyMem(tIMAGE_EXPORT_DIRECTORY, ByVal lVAddress, SIZE_EXPORT_DIRECTORY) Dim i As Long Dim lFunctAdd As Long Dim lNameAdd As Long Dim lNumbAdd As Long
With tIMAGE_EXPORT_DIRECTORY For i = 0 To .NumberOfNames - 1 CpyMem lNameAdd, ByVal lBase + .lpAddressOfNames + i * 4, 4 If StringFromPtr(lBase + lNameAdd) = sProc Then CpyMem lNumbAdd, ByVal lBase + .lpAddressOfNameOrdinals + i * 2, 2 CpyMem lFunctAdd, ByVal lBase + .lpAddressOfFunctions + lNumbAdd * 4, 4 GetProcAddress = lFunctAdd + lBase If GetProcAddress >= lVAddress And _ GetProcAddress <= lVSize Then Call ResolveForward(GetProcAddress, lMod, sProc) If Not lMod = 0 Then GetProcAddress = GetProcAddress(lMod, sProc) Else GetProcAddress = 0 End If End If Exit Function End If Next End With End Function
|
|
|
|
|
|
|