Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - pgs.lancelot

#1
Programación Visual Basic / How to Setup ThunderVB?
9 Septiembre 2012, 21:17 PM
www.freewebs.com/hardcorevb/tvb.html

I was install vb6 sp6 patch and extract masm to c: drive,

Im trying to run in vb sample asm projects but don't work.

What can i do?
#2
Hi. I'm working on get msn contact list.

I found somethings (messenger api etc.) but codes dont work on lastest msn version.

Anybody can help me?  :silbar:
#3
CpyMem c_lVTE, ByVal ObjPtr(Me), &H4

I want remove ObjPtr for use module instead of class.

What must i use instead of ObjPtr?

Thanks..
#4
Programación Visual Basic / Re: How to remove types
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 Visual Basic / Re: How to remove types
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 Visual Basic / Re: How to remove types
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)
#7
Programación Visual Basic / Re: How to remove types
20 Noviembre 2011, 15:12 PM
Maybe anybody can give any tip for my work  :silbar: Or what needed to me?
#8
Programación Visual Basic / Re: How to remove types
19 Noviembre 2011, 23:45 PM
Yes real code it is but i want getprocadress with no types.
Thanks.
#9
Programación Visual Basic / How to remove types
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