News:

How did you even find this place?

Main Menu

Battle.net Server Signature

Started by iago, March 19, 2005, 03:42:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rabbit

OMG I SOLVED IT!!!!
log(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)

I win.

Joe

#16
wtf? Anyhow, heres an (almost) port to VB of the checking function. Theres one line thats (cleary) still in Java, so iago or somebody can fix that, or I will eventually.

'---------------------------------------------------------------------------------------
' Module    : modServerSig
' Author    : Joe[x86]
'             www.x86labs.org
' Purpose   : Verification of WAR3/W3XP Battle.net server signatures.
'---------------------------------------------------------------------------------------

Option Explicit

Public Function checkServerSignature(sig As String, ip As String) As Boolean
    Dim I As Integer, Ret As Boolean
    Dim K() As Byte: Let K = Array(0, 1, 1, 0)
    Dim N() As Byte: Let N = Array(&HD5, &HA3, &HD6, &HAB, &HF, &HD, &HC5, &HF, &HC3, &HFA, &H6E, &H78, &H9D, &HB, &HE3, &H32, &HB0, &HFA, &H20, &HE8, &H42, &H19, &HB4, &HA1, &H3A, &H3B, &HCD, &HE, &H8F, &HB5, &H56, &HB5, &HDC, &HE5, &HC1, &HFC, &H2D, &HBA, &H56, &H35, &H29, &HF, &H48, &HB, &H15, &H5A, &H39, &HFC, &H88, &H7, &H43, &H9E, &HCB, &HF3, &HB8, &H73, &HC9, &HE1, &H77, &HD5, &HA1, &H6, &HA6, &H20, &HD0, &H82, &HC5, &H2D, &H4D, &HD3, &H25, &HF4, &HFD, &H26, &HFC, &HE4, &HC2, &H0, &HDD, &H98, &H2A, &HF4, &H3D, &H5E, &H8, &H8A, &HD3, &H20, &H41, &H84, &H32, &H69, &H8E, &H8A, &H34, &H76, &HEA, &H16, &H8E, &H66, &H40, &HD9, &H32, &HB0, &H2D, &HF5, &HBD, &HE7, &H57, &H51, &H78, &H96, &HC2, &HED, &H40, &H41, &HCC, &H54, &H9D, &HFD, &HB6, &H8D, &HC2, &HBA, &H7F, &H69, &H8D, &HCF)
   
    'Do the calculation
    byte []result = new BigIntegerEx(BigIntegerEx.LITTLE_ENDIAN, sig).modPow(key, mod).toByteArray();
   
    Dim CorrectResult As String: CorrectResult = String(Len(Result), Chr(&HBB))
    CorrectResult = ip & Mid(CorrectResult, 5)
       
    Ret = True
    For I = 0 To Len(Result) Step 1
        If Result(I) <> CorrectResult(I) Then
            Ret = False
        End If
    Next I
End Function


EDIT -
Hrm, got somewhere with porting BigIntegerEx too!
Public Const BIG_ENDIAN As Integer = 0
Public Const LITTLE_ENDIAN As Integer = 1
Public Const BIGINT_SIZE = 32
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


iago

Quote from: Joex86] link=topic=883.msg16660#msg16660 date=1120380463]
    byte []result = new BigIntegerEx(BigIntegerEx.LITTLE_ENDIAN, sig).modPow(key, mod).toByteArray();

That's the most important line, and the one line that I'm pretty sure you can't do in Visual Basic.  First, it creates an arbitrary length integer from the signature, then does the calculation (signaturekey % mod) (where % is modular division).  This is the standard formula for encryption/decrypting/creating keys.  ab%c with arbitrary length integers is cryptographically the most important function. 

rabbit

function poiuytrewq(a as long, b as long, c as long) as currency
    poiuytrewq = (a ^ b) mod c
end function
?

iago

Quote from: R.a.B.B.i.T on July 03, 2005, 09:51:28 PM
function poiuytrewq(a as long, b as long, c as long) as currency
    poiuytrewq = (a ^ b) mod c
end function
?

I think he's trying to implement modpow with short variables.  A "long" isn't arbitrary length.

rabbit

currency is the closest to arbitrary you can get, and long ...eh...whatever I give up.  VB sucks that way.

iago

I don't think a currency can do 1024-bit numbers, though, which is what the server signature is.

Newby

Quote from: iago on July 03, 2005, 02:36:17 PM
Quote from: Joex86] link=topic=883.msg16660#msg16660 date=1120380463]
    byte []result = new BigIntegerEx(BigIntegerEx.LITTLE_ENDIAN, sig).modPow(key, mod).toByteArray();

That's the most important line, and the one line that I'm pretty sure you can't do in Visual Basic.  First, it creates an arbitrary length integer from the signature, then does the calculation (signaturekey % mod) (where % is modular division).  This is the standard formula for encryption/decrypting/creating keys.  ab%c with arbitrary length integers is cryptographically the most important function. 

I'm pretty sure you can do ab%c.

You just have to use an API call for the ab

Wait, never mind. If the numbers are 1024-bit, good luck I guess!
- Newby
http://www.x86labs.org

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote from: Rule on June 30, 2008, 01:13:20 PM
Quote from: CrAz3D on June 30, 2008, 10:38:22 AM
I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT.