• Welcome to Valhalla Legends Archive.
 

Re: Storm.dll Function

Started by aton, May 01, 2005, 05:58 AM

Previous topic - Next topic

aton

just write your own, its the standard udp header checksum algorithm, read the udp rfc


edit: sorry this is not correct. its absolutely not the udp header checksum algo.
i am looking for the correct checksum function in c atm

iago

Hmm, I found it one time, but it's not so cut-and-dry.  It's in the middle of a very very very long Storm function.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Archangel

#2
Quote
« on: June 19, 2004, 07:24 pm »

« Reply #6 on: Today at 05:58:55 AM »

Today: May 01, 2005, Almost 1 year.
I'm not an Addict.

Joe[x86]

Hop off. He said its the default header, thus helped someone.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Archangel

#4

Private Function SubCheckSum(ByVal buf As String, ByVal length As Integer) As Long
    Dim sum1, sum2
    Dim i As Integer, iY As Integer
        For iY = 0 To length - 1
            i = length - iY
            sum2 = sum2 + Asc(Mid(buf, i, 1))
            If sum2 > &HFF Then
                sum2 = sum2 - &HFF
            End If
            sum1 = sum1 + sum2
        Next iY
        SubCheckSum = (LShift((sum2 And &HFF), 8)) Or ((sum1 Mod &HFF) And &HFF)
End Function

Private Function UDPCheckSum(buf As String) As Integer
    Dim subsum As Long, length As Integer
    Dim a As Long, b As Long, Ret As Integer
        CopyMemory length, ByVal Mid$(buf, 3, 2), 2
        length = length - 2
        subsum = SubCheckSum(Mid$(buf, 3), length)
        a = &HFF - ((subsum And &HFF) + (RShift(subsum, 8))) Mod &HFF
        b = CLng((((&HFF - (a + RShift(subsum, 8)) Mod &HFF) And &HFF) Or LShift(a, 8)))
        CopyMemory Ret, b, 2
        UDPCheckSum = Ret
End Function


Starcraft UDP Documentation:
http://www.archangel.bnetweb.com/projecto/starcraft_udp/Starcraft%20UDP.zip

*Authors: Pianka & ArchAngel
*This documentation is not complete, might be wrong and will not be finished.
*But if you are looking for adding something or correcting something i will do it with the specific credits.
I'm not an Addict.