Jump to content

Recommended Posts

Posted

I need a little code or someone to help with a program I am working on. I currently have it detecting you diablo 2 games ip address. I would like to monitor packets for a certain packet:

DiabloWalksTheEarth

5A 12 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

SojsSoldToMerchant

5A 11 04 XX XX XX XX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

where XX XX XX XX = number of sojs sold (DWORD).

Looked thru the packetx documentations and don't see anything about it. Am I trying to go about this wrong? Can you give me a little bit of code to get this going?

Posted

Adroitfulone, I don't understand your question very well. Would you like to replace XX XX XX XX with a hexadecimal value?

If so, this function can probably help you.

Cheers, Charvi

#===================================================================================================

===============================
; Function Name .....:  _HTA_
; Description .......:  Business Basic HTA Function - Converts a ASCII string to a HEX value represented string
; Syntax ............:  _HTA_($s_AsciiStr)
; Parameters ........:  $s_AsciiStr             Any value to be converted in Hexadecimal
; Return values .....:  A String of the Value in Hexadecimal Format
; Author ............:  'charvi' <charvista [at] gmail [dot] com>
; Creation Date .....:  2009-01-16
; Version ...........:  0.0.0.1
; Version Date ......:  2009-01-16
; Remarks ...........:
; Example ...........:  $s = _HTA_("Abc123")
;                       Result: $s = "416263313233"
#===================================================================================================

===============================
Func _HTA_($s_AsciiStr)
    Local $i_AsciiLen, $i_ScanPos, $s_HexStr
    $i_AsciiLen = StringLen($s_AsciiStr)
    If $i_AsciiLen Then
        For $i_ScanPos = 1 To $i_AsciiLen
            $s_HexStr &= StringRight("0" & Hex(Asc(StringMid($s_AsciiStr, $i_ScanPos, 1))),2)
        Next
    Else
    $s_HexStr = ""
    EndIf
    Return $s_HexStr
EndFunc
#===================================================================================================

===============================

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...