Results 1 to 11 of 11

Thread: Debugger written in VB - needs a bit of cleaning up...

  1. #1

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616

    Debugger written in VB - needs a bit of cleaning up...

    The attached is a debugger/dependency walker application written in VB. I need a bit of help adding the ability to view (and ultimately edit) the resources held in the executable (and it's loaded libraries)

    You will need a good understanding of API to do this...
    Attached Files Attached Files
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  2. #2

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Hmm - kinda depressing that nobody is even prepared to download the code and take a look.
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by MerrionComputin
    Hmm - kinda depressing that nobody is even prepared to download the code and take a look.
    Dunc, that's because your level of VB expertise is so far above everyone else's, it sorta leaves us all in the dark a little.
    Lonely at the top 'eh ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    I shall have to write some catch-up articles so
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  5. #5
    Lively Member Deucy's Avatar
    Join Date
    Mar 2003
    Location
    Cali
    Posts
    85
    i was debugging IEXPLORE.EXE and it gave me an overflow.. any ideas? coz i need complete control over IEXPLORE.EXE.. i want to get events from it and all that..

  6. #6
    Addicted Member
    Join Date
    May 2001
    Location
    Montréal, Québec
    Posts
    195
    I got the same problem (the Overflow), but with McAfee Virus Scan.

  7. #7

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    You couldn't perhaps give me the line of code that gave the overflow?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by MerrionComputin
    You couldn't perhaps give me the line of code that gave the overflow?
    Yeah just give them a few minutes to dig up the source for IE and Mcafee anti-virus
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  9. #9

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    OK ...backs away slowly...

    I'm guessing the VB code was throwing the overflow error? When the message comes up press CTRL+BREAK and the line causeing the error should show up..?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  10. #10
    Addicted Member
    Join Date
    May 2001
    Location
    Montréal, Québec
    Posts
    195
    Here's the place in the VB code:
    (For VirusScan)

    Module: DebugMain.bas

    This line: If btSrc + btCarry + btDest > &HFF Then

    In this context:

    If btSrc + btCarry + btDest > &HFF Then
    btCarry = (btSrc + btCarry + btDest) And &HFF00
    bt3 = (btSrc + btCarry + btDest) And &HFF
    Else
    bt3 = (btSrc + btCarry + btDest)
    End If

  11. #11

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Oops - perhaps I should clear out the carry flag

    Try:-
    VB Code:
    1. '\\ --[ByteByByteAdd]-----------------------------------------------
    2. '\\ Adds two longs in a byte-by-byte manner to prevent nast overflow
    3. '\\ errors when VB longs are mixed up with C ULONGs
    4. '\\ ----------------------------------------------------------------
    5. Public Function ByteByByteAdd(ByVal lIn1 As Long, ByVal lIn2 As Long) As Long
    6.  
    7. Dim btSrc As Byte
    8. Dim btDest As Byte
    9. Dim btCarry As Integer
    10.  
    11. Dim bt1 As Byte
    12. Dim bt2 As Byte
    13. Dim bt3 As Byte
    14. Dim bt4 As Byte
    15.  
    16. Dim lRet As Long
    17.  
    18. btSrc = LoByte(LoWord(lIn1))
    19. btDest = LoByte(LoWord(lIn2))
    20.  
    21. If btSrc + btDest > &HFF Then
    22.     btCarry = (btSrc + btDest) And &HFF00
    23.     bt1 = (btSrc + btDest) And &HFF
    24. Else
    25.     bt1 = (btSrc + btDest)
    26.     btCarry = 0
    27. End If
    28.  
    29. btSrc = HiByte(LoWord(lIn1))
    30. btDest = HiByte(LoWord(lIn2))
    31.  
    32. If btSrc + btCarry + btDest > &HFF Then
    33.     btCarry = (btSrc + btCarry + btDest) And &HFF00
    34.     bt2 = (btSrc + btCarry + btDest) And &HFF
    35. Else
    36.     bt2 = (btSrc + btCarry + btDest)
    37.     btCarry = 0
    38. End If
    39.  
    40. btSrc = LoByte(HiWord(lIn1))
    41. btDest = LoByte(HiWord(lIn2))
    42.  
    43. If btSrc + btCarry + btDest > &HFF Then
    44.     btCarry = (btSrc + btCarry + btDest) And &HFF00
    45.     bt3 = (btSrc + btCarry + btDest) And &HFF
    46. Else
    47.     bt3 = (btSrc + btCarry + btDest)
    48.     btCarry = 0
    49. End If
    50.  
    51. btSrc = HiByte(HiWord(lIn1))
    52. btDest = HiByte(HiWord(lIn2))
    53.  
    54. If btSrc + btCarry + btDest > &HFF Then
    55.     btCarry = (btSrc + btCarry + btDest) And &HFF00
    56.     bt4 = (btSrc + btCarry + btDest) And &HFF
    57. Else
    58.     bt4 = (btSrc + btCarry + btDest)
    59.     btCarry = 0
    60. End If
    61.  
    62. ByteByByteAdd = MakeLong(MakeWord(bt1, bt2), MakeWord(bt3, bt4))
    63.  
    64. End Function
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width