wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools > Programming
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-05-2008, 08:42 PM   #16
Strilanc
User
 
Strilanc's Avatar
 
Join Date: Jun 2007
Posts: 917

Submissions (4)

Strilanc has a spectacular aura about (131)

2008 Spell olympics - Fire - Gold

Default

Well I've dived in and started using a disassembler.

Good news:
I found the function that computes the key per file, and it is the same as mine. I also found the function calling it for each file, and that is almost what I expected.

It doesn't seem to mention war3map.j anywhere, though. Definitely going to have to dig deeper. I get to learn to read assembly, too, so there's a bonus.
__________________
Don't pay attention to this signature, it's self-contradictory.
Strilanc is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-07-2008, 01:29 AM   #17
Strilanc
User
 
Strilanc's Avatar
 
Join Date: Jun 2007
Posts: 917

Submissions (4)

Strilanc has a spectacular aura about (131)

2008 Spell olympics - Fire - Gold

Default

Dance, dance, dance! I got it working!

This works for dota, power towers, island troll tribes, undead assault, ...

Code:
    Public Function xorRotateStream(ByVal s As IO.Stream, Optional ByVal length As Integer = -1) As UInteger
        If length = -1 Then length = CInt(s.Length)
        Dim val As UInteger = 0
        Dim r As New IO.BinaryReader(s)
        For repeat As Integer = 1 To length - 3 Step 4
            val = ShiftRotateLeft(val Xor r.ReadUInt32(), 3)
        Next repeat
        For repeat As Integer = 1 To length Mod 4
            val = ShiftRotateLeft(val Xor CUInt(r.ReadByte()), 3)
        Next repeat
        Return val
    End Function
    Public Function xorRotateMap(ByVal mpqa As MPQ.Archive) As UInteger
        Dim val As UInteger = 0
        Dim backupMPQA As New MPQ.Archive(My.Settings.war3path + "Copy of War3Patch.mpq")

        Dim ssj() As String = {"Scripts\common.j", "Scripts\blizzard.j"}
        For Each s As String In ssj
            Dim f As MPQ.FileStream
            If mpqa.hashTable.contains(s) Then
                f = New MPQ.FileStream(mpqa, s)
            Else
                f = New MPQ.FileStream(backupMPQA, s)
            End If
            val = val Xor xorRotateStream(f)
        Next s
        val = ShiftRotateLeft(val, 3)
        val = ShiftRotateLeft(val Xor CUInt(&H3F1379E), 3)

        Dim ss() As String = {"war3map.j", "scripts\war3map.j", "war3map.w3e", "war3map.wpm", "war3map.doo", "war3map.w3u", "war3map.w3b", "war3map.w3d", "war3map.w3a", "war3map.w3q"}
        For Each s As String In ss
            If mpqa.hashTable.contains(s) Then
                Dim f As New MPQ.FileStream(mpqa, s)
                val = ShiftRotateLeft(val Xor xorRotateStream(f), 3)
                f.Close()
            End If
        Next s

        Return val
    End Function
__________________
Don't pay attention to this signature, it's self-contradictory.
Strilanc is offline   Reply With Quote
Old 09-07-2008, 02:12 AM   #18
Szythe
User
 
Join Date: Sep 2006
Posts: 320

Submissions (3)

Szythe has a spectacular aura about (143)

Spell Making Session 11 WinnerSmiley contest 4th and 5th place.Mapping Contest Third PlaceSpell making session 08

Default

Excuse my ignorance, but I don't quite understand what this does.
Szythe is offline   Reply With Quote
Old 09-07-2008, 02:17 AM   #19
Strilanc
User
 
Strilanc's Avatar
 
Join Date: Jun 2007
Posts: 917

Submissions (4)

Strilanc has a spectacular aura about (131)

2008 Spell olympics - Fire - Gold

Default

If you want to make a bot host a game on bnet, it needs this value.
__________________
Don't pay attention to this signature, it's self-contradictory.
Strilanc is offline   Reply With Quote
Old 09-18-2008, 04:32 AM   #20
d07.RiV
User
 
d07.RiV's Avatar
 
Join Date: May 2008
Posts: 239

Submissions (1)

d07.RiV is on a distinguished road (10)

Default

Its probably the same value as used in replays?
Then it definetly doesn't check the files in Units\ directory (at least the Strings.txt files because thats the way multi language dota works).

Well you can always RE it. Though it will probably be rather hard to do that.

Oh and can't you ask someone who made a hostbot already? There are some open source hostbots. Or they require you to enter that value?
__________________

Last edited by d07.RiV : 09-18-2008 at 04:33 AM.
d07.RiV is offline   Reply With Quote
Old 09-18-2008, 06:09 AM   #21
Strilanc
User
 
Strilanc's Avatar
 
Join Date: Jun 2007
Posts: 917

Submissions (4)

Strilanc has a spectacular aura about (131)

2008 Spell olympics - Fire - Gold

Default

I solved it myself. Look a few posts up. I sniffed hundreds of test maps, learned to use a disassembler, and generally used way too much of my time.

I tried asking people who made hostbots already, but none of the ones I asked knew how to make it. They were all doing the same thing I was: sniffing it from packet traffic for individual maps.
__________________
Don't pay attention to this signature, it's self-contradictory.

Last edited by Strilanc : 09-18-2008 at 10:49 AM.
Strilanc is offline   Reply With Quote
Old 09-25-2008, 03:09 AM   #22
d07.RiV
User
 
d07.RiV's Avatar
 
Join Date: May 2008
Posts: 239

Submissions (1)

d07.RiV is on a distinguished road (10)

Default

Are you sure that algorithm is correct?
I tried it and it didn't work for me (well I compared it with map checksum in replay). Is it true that &H3F1379E is hexadecimal value of 3F1379E?

Anyway what value did you receive for latest version of dota?


Nvm it works. GJ
__________________

Last edited by d07.RiV : 09-25-2008 at 12:51 PM.
d07.RiV is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:15 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2017, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services