+ Reply to Thread
Showing results 1 to 7 of 7

Thread: Hex2Dec problem.

  1. #1
    Senior Member

    Saint
    punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture's Avatar
    Join Date
    Jul 2004
    Location
    Vancouver, B.C. Canada
    Posts
    6,443

    Default Hex2Dec problem.

    I'm trying to make a stat hack and found out that the offset that holds the information of the mineral and gas are giving me this wierd symbols. So I learned that I must use the Hex2Dec function. I tried my best to figure out how to use that function and here is what I got.

    Code:
    Dim minbuffer0 As String
    Dim minbuffer1 As String
    Dim minbuffer2 As String
    Dim minbuffer3 As String
    Dim minbuffer4 As String
    Dim minbuffer5 As String
    Dim minbuffer6 As String
    Dim minbuffer7 As String
    Dim gasbuffer0 As String
    Dim gasbuffer1 As String
    Dim gasbuffer2 As String
    Dim gasbuffer3 As String
    Dim gasbuffer4 As String
    Dim gasbuffer5 As String
    Dim gasbuffer6 As String
    Dim gasbuffer7 As String
    Dim hwnd As Long
        Dim pid As Long
        Dim pHandle As Long
        Dim hProcess As Long
    
        hwnd = FindWindow(vbNullString, "Brood War")
        If (hwnd = 0) Then
            MsgBox "Window not found!"
            Exit Sub
        End If
        GetWindowThreadProcessId hwnd, pid
        pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
        If (pHandle = 0) Then
            MsgBox "Couldn't get a process handle!"
            Exit Sub
        End If
        minbuffer0 = String(4, " ")
        minbuffer1 = String(4, " ")
        minbuffer2 = String(4, " ")
        minbuffer3 = String(4, " ")
        minbuffer4 = String(4, " ")
        minbuffer5 = String(4, " ")
        minbuffer6 = String(4, " ")
        minbuffer7 = String(4, " ")
        gasbuffer0 = String(4, " ")
        gasbuffer1 = String(4, " ")
        gasbuffer2 = String(4, " ")
        gasbuffer3 = String(4, " ")
        gasbuffer4 = String(4, " ")
        gasbuffer5 = String(4, " ")
        gasbuffer6 = String(4, " ")
        gasbuffer7 = String(4, " ")
        ReadProcessMemory pHandle, Hex2Dec("508600"), minbuffer0, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508604"), minbuffer1, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508608"), minbuffer2, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("50860C"), minbuffer3, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508610"), minbuffer4, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508614"), minbuffer5, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508618"), minbuffer6, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("50861C"), minbuffer7, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508630"), gasbuffer0, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508634"), gasbuffer1, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508638"), gasbuffer2, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("50863C"), gasbuffer3, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508640"), gasbuffer4, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508644"), gasbuffer5, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("508648"), gasbuffer6, 4, 0&
        ReadProcessMemory pHandle, Hex2Dec("50864C"), gasbuffer7, 4, 0&
        Text1.Text = Hex2Dec("minbuffer0")
        Text2.Text = Hex2Dec("minbuffer1")
        Text3.Text = Hex2Dec("minbuffer2")
        Text4.Text = Hex2Dec("minbuffer3")
        Text5.Text = Hex2Dec("minbuffer4")
        Text6.Text = Hex2Dec("minbuffer5")
        Text7.Text = Hex2Dec("minbuffer6")
        Text8.Text = Hex2Dec("minbuffer7")
        Text9.Text = Hex2Dec("gasbuffer0")
        Text10.Text = Hex2Dec("gasbuffer1")
        Text11.Text = Hex2Dec("gasbuffer2")
        Text12.Text = Hex2Dec("gasbuffer3")
        Text13.Text = Hex2Dec("gasbuffer4")
        Text14.Text = Hex2Dec("gasbuffer5")
        Text15.Text = Hex2Dec("gasbuffer6")
        Text16.Text = Hex2Dec("gasbuffer7")
    As you can see.. I have pretty much no idea what I'm doing so help me out please :D

  2. #2
    The Sexy Penguin Senior Member
    Moderator

    Prophet
    LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX's Avatar
    Join Date
    Feb 2005
    Location
    astrotravelin'
    Posts
    7,770

    Default

    Umm, that doesn't help at all, post your "hex2dec" function.
    Quote Originally Posted by ston3rpimp69 View Post
    hello im the official spokesperson for lcs' awesome group only cool ppl can join and here is my official statement

    YO FUKC U PUNK ASS FGTS THIS GROUP IS FOR AWESOME MOTHERFUKCERS DOING AWESOME MOTHERFUKCIN THINGS AND DISCUSSING IMPORTANT AND PROFOUND TOPICS SUCH AS SUBSTANCE EXCHANGE RATES, JAILBAIT, COOKIN CRANK, TRISH'S SNATCH, BEER AND TACOS. WE ALSO GO ON FIELD TRIPS AND SIHT. SO IF UR INTO BEATIN HOMELESS PPL WITH SOCKS FULL OF BATTERIES THEN JOIN THIS FUKCIN GROUP CUZ U CANT BE A SCARED LITTLE BITCH ALL UR LIFE
    Quote Originally Posted by ston3rpimp69
    so at first i was excited cuz i was gettin laid. but then i thought about it. i dunno, maybe it's cuz i hadn't had anything to drink, but i almost panicked. i was thinkin this bitch takes in dicks like air and has probably done some pretty wild siht that i've only seen in vids from dsg's porn collection. she probably needs 4 cocks and a slip n slide to get off. that's kinda intimidating. that and i was worried that my dick might get the plague and fall off. might have to coat the condom in pesticide and wear a trash bag or something. i almost let it end there. almost. it's hard to say no when she's biting my shoulder as i walk her to her car. at least she doesn't waste time.

  3. #3
    Senior Member

    Saint
    punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture's Avatar
    Join Date
    Jul 2004
    Location
    Vancouver, B.C. Canada
    Posts
    6,443

    Default

    Code:
    Public Function Hex2Dec(sText As String) As Long
        
        On Error GoTo err
        
        Dim H As String
        H = sText
        Dim Tmp$
        Dim lo1 As Integer, lo2 As Integer
        Dim hi1 As Long, hi2 As Long
        Const Hx = "&H"
        Const BigShift = 65536
        Const LilShift = 256, Two = 2
        Tmp = H
    
        If UCase(Left$(H, 2)) = "&H" Then Tmp = Mid$(H, 3)
        Tmp = Right$("0000000" & Tmp, 8)
        If IsNumeric(Hx & Tmp) Then
            lo1 = CInt(Hx & Right$(Tmp, Two))
            hi1 = CLng(Hx & Mid$(Tmp, 5, Two))
            lo2 = CInt(Hx & Mid$(Tmp, 3, Two))
            hi2 = CLng(Hx & Left$(Tmp, Two))
            Hex2Dec = CCur(hi2 * LilShift + lo2) * BigShift + (hi1 * LilShift) + lo1
        End If
        Exit Function
            
    err:
    
    End Function
    here is the function.

  4. #4
    The Sexy Penguin Senior Member
    Moderator

    Prophet
    LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX has a reputation beyond repute LCSBSSRHXXX's Avatar
    Join Date
    Feb 2005
    Location
    astrotravelin'
    Posts
    7,770

    Default

    If the buffer is storing a value that needs to be converted to hex why are you converting the offset,
    try this:
    Code:
        ReadProcessMemory pHandle, &H508600, minbuffer0, 4, 0&
        ReadProcessMemory pHandle, &H508604, minbuffer1, 4, 0&
        ReadProcessMemory pHandle, &H508608, minbuffer2, 4, 0&
        ReadProcessMemory pHandle, &H50860C, minbuffer3, 4, 0&
        ReadProcessMemory pHandle, &H508610, minbuffer4, 4, 0&
        ReadProcessMemory pHandle, &H508614, minbuffer5, 4, 0&
        ReadProcessMemory pHandle, &H508618, minbuffer6, 4, 0&
        ReadProcessMemory pHandle, &H50861C, minbuffer7, 4, 0&
        ReadProcessMemory pHandle, &H508630, gasbuffer0, 4, 0&
        ReadProcessMemory pHandle, &H508634, gasbuffer1, 4, 0&
        ReadProcessMemory pHandle, &H508638, gasbuffer2, 4, 0&
        ReadProcessMemory pHandle, &H50863C, gasbuffer3, 4, 0&
        ReadProcessMemory pHandle, &H508640, gasbuffer4, 4, 0&
        ReadProcessMemory pHandle, &H508644, gasbuffer5, 4, 0&
        ReadProcessMemory pHandle, &H508648, gasbuffer6, 4, 0&
        ReadProcessMemory pHandle, &H50864C, gasbuffer7, 4, 0&
    Quote Originally Posted by ston3rpimp69 View Post
    hello im the official spokesperson for lcs' awesome group only cool ppl can join and here is my official statement

    YO FUKC U PUNK ASS FGTS THIS GROUP IS FOR AWESOME MOTHERFUKCERS DOING AWESOME MOTHERFUKCIN THINGS AND DISCUSSING IMPORTANT AND PROFOUND TOPICS SUCH AS SUBSTANCE EXCHANGE RATES, JAILBAIT, COOKIN CRANK, TRISH'S SNATCH, BEER AND TACOS. WE ALSO GO ON FIELD TRIPS AND SIHT. SO IF UR INTO BEATIN HOMELESS PPL WITH SOCKS FULL OF BATTERIES THEN JOIN THIS FUKCIN GROUP CUZ U CANT BE A SCARED LITTLE BITCH ALL UR LIFE
    Quote Originally Posted by ston3rpimp69
    so at first i was excited cuz i was gettin laid. but then i thought about it. i dunno, maybe it's cuz i hadn't had anything to drink, but i almost panicked. i was thinkin this bitch takes in dicks like air and has probably done some pretty wild siht that i've only seen in vids from dsg's porn collection. she probably needs 4 cocks and a slip n slide to get off. that's kinda intimidating. that and i was worried that my dick might get the plague and fall off. might have to coat the condom in pesticide and wear a trash bag or something. i almost let it end there. almost. it's hard to say no when she's biting my shoulder as i walk her to her car. at least she doesn't waste time.

  5. #5
    Senior Member

    Crusader
    Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac has a reputation beyond repute Dyndrilliac's Avatar
    Join Date
    Jun 2005
    Location
    Jacksonville, FL, USA
    Posts
    3,372

    Default

    Code:
    Public Function HexToDec(ByVal sHex As String) As Long
        On Error Resume Next
        Dim I As Integer, nDec As Long
        Const HexChar As String = "0123456789ABCDEF"
        For I = Len(sHex) To 1 Step -1
            nDec = nDec + (InStr(1, HexChar, Mid$(sHex, I, 1)) - 1) * 16 ^ (Len(sHex) - I)
        Next I
        HexToDec = CStr(nDec)
    End Function
    The Ultimate Guide Thread
    Quote Originally Posted by Ethernet Networking Bible
    Thou shalt switch where thy can, and route where thy must.

  6. #6

    Heretic
    l)ragon is on a distinguished road l)ragon's Avatar
    Join Date
    Dec 2004
    Posts
    9

    Default

    Code:
    Public Function HexToDec(ByVal sHex As String) As Long
        On Error Resume Next
        HexToDec = val("&H" & sHex)
    End Function
    lazy way

  7. #7
    Senior Member

    Saint
    punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture has a brilliant future punture's Avatar
    Join Date
    Jul 2004
    Location
    Vancouver, B.C. Canada
    Posts
    6,443

    Default

    k thx for all of your help!! you all get rep points.. and the problem was solved !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. math problem?
    By DA( in forum Flame Board
    Replies: 40
    Last Post: 05-08-2005, 04:43 PM
  2. Disconnect problem with Burrito / Inhale
    By LCSBSSRHXXX in forum Hardware and Software
    Replies: 14
    Last Post: 03-06-2005, 02:40 PM
  3. Arcade Mini Putt Problem
    By LCSBSSRHXXX in forum General Chat
    Replies: 1
    Last Post: 03-06-2005, 01:32 PM
  4. Yet another problem with my computer
    By kds in forum Hardware and Software
    Replies: 10
    Last Post: 12-08-2004, 02:10 AM
  5. router problem. (connecting to Xbox live)
    By n8_115 in forum Hardware and Software
    Replies: 7
    Last Post: 10-12-2004, 12:33 AM

Posting Rules

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