Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: iago on June 03, 2007, 02:24 AM

Title: iago's lockdown source (100% C)
Post by: iago on June 03, 2007, 02:24 AM
I was beat to it by a day! I was going to release mine tomorrow! :(++

http://www.skullsecurity.org/wiki/index.php/Lockdown
http://www.javaop.com/~ron/code/lockdown

Pure C.

Not as pretty as Warz's code, but it's complete :P
Title: Re: iago's lockdown source (100% C)
Post by: l2k-Shadow on June 03, 2007, 02:36 AM
why all the sudden releases?

damn, loading is back. :(
Title: Re: iago's lockdown source (100% C)
Post by: iago on June 03, 2007, 02:39 AM
Quote from: l2k-Shadow on June 03, 2007, 02:36 AM
why all the sudden releases?

damn, loading is back. :(
I always release my code. And I just finished it a couple days ago, and was testing it this weekend. I was going to release it tomorrow or Monday, but there's no sense in waiting now that it's out there.
Title: Re: iago's lockdown source (100% C)
Post by: Hdx on June 03, 2007, 02:49 AM
So, who wants to help convert it to java?
The cool thing about ron's code is that it dosen't use the lockdown dlls in any way (Aside from a pure data form) It dosen't have the dlls do the hard parts.
~Hdx
Title: Re: iago's lockdown source (100% C)
Post by: warz on June 03, 2007, 03:28 AM
not sure if hard parts is the right phrase - more like the large parts. :P
Title: Re: iago's lockdown source (100% C)
Post by: iago on June 03, 2007, 03:47 AM
Quote from: betawarz on June 03, 2007, 03:28 AM
not sure if hard parts is the right phrase - more like the large parts. :P
No, those were the hardest functions by far. Although I admit it's mainly because of their length. If you make one mistake, it could take you an hour to find it. And I pretty much make several mistakes per function as a rule :(
Title: Re: iago's lockdown source (100% C)
Post by: warz on June 03, 2007, 04:00 AM
well, yeah, they were easily the hardest, but the main reason that we didn't have a C++ conversion was due to their length. i mean, already have a working implementation on windows... what was the point in reversing a rather large function? that thought was always lurking. hehe.
Title: Re: iago's lockdown source (100% C)
Post by: Rob on June 03, 2007, 04:07 AM
I saw no good reason to reverse the large functions, for an implementation that was solely for windows. 
Title: Re: iago's lockdown source (100% C)
Post by: Hero on June 03, 2007, 04:25 AM
Good work sarge.
Title: Re: iago's lockdown source (100% C)
Post by: Warrior on June 03, 2007, 06:29 AM
Here, after reversing lockdown in it's entirety it will be eventually more easily understood. It could help with documentation and with implementations across other platforms. Additionally, it is in a sense future proof if the lockdown dlls were ever to even slightly change.
Title: Re: iago's lockdown source (100% C)
Post by: iago on June 03, 2007, 09:53 AM
Quote from: Rob on June 03, 2007, 04:07 AM
I saw no good reason to reverse the large functions, for an implementation that was solely for windows. 
Because it's fun and rewarding! :P
Title: Re: iago's lockdown source (100% C)
Post by: vuther.de on June 03, 2007, 11:30 AM
Good job iago, but I don't know why you released this for..
Title: Re: iago's lockdown source (100% C)
Post by: Warrior on June 03, 2007, 12:43 PM
So people (like you) who can't reverse it themselves can use it? Why else?

Stop being such a damn elitist just because Rob let you use his implementation. Before his you were QQing about it just like every other "programmer"
Title: Re: iago's lockdown source (100% C)
Post by: Barabajagal on June 03, 2007, 02:09 PM
So does this work with DRTL/DSHR/JSTR/SSHR as well? And if so, how do I find out what memory locations to read from? Is there a beginning and ending byte sequence to look for perhaps?
Title: Re: iago's lockdown source (100% C)
Post by: brew on June 03, 2007, 02:20 PM
if you had read the first link, iago made a screen dumper. go make them yourself.
Title: Re: iago's lockdown source (100% C)
Post by: l2k-Shadow on June 03, 2007, 02:29 PM
Quote from: brew on June 03, 2007, 02:20 PM
if you had read the first link, iago made a screen dumper. go make them yourself.

tried using it to dump sc screen and it crashed :(
Title: Re: iago's lockdown source (100% C)
Post by: iago on June 03, 2007, 02:43 PM
Quote from: ·RealityRipple· on June 03, 2007, 02:09 PM
So does this work with DRTL/DSHR/JSTR/SSHR as well? And if so, how do I find out what memory locations to read from? Is there a beginning and ending byte sequence to look for perhaps?
It should, assuming you can get a dump of the screen. My plugin should support all clients, but apparently it doesn't. I'll have to look into it more, but I'm not in a rush for those. I'd rather play Playstation today. :)

Perhaps you should look at the soruce? :P

But seriously, it reads the PE (portable executable) in memory, which is the image of the file (the .exe or the .dll). It uses information in that header to decide where to start and finish and where to skip and not skip.

Quote from: l2k-Shadow on June 03, 2007, 02:29 PM
Quote from: brew on June 03, 2007, 02:20 PM
if you had read the first link, iago made a screen dumper. go make them yourself.

tried using it to dump sc screen and it crashed :(

Yeah, apparently it doesn't work for everybody. Be sure you have the .exe and .dll both in Starcraft's folder. If you do, and it doesn't work, then sorry. It *should*, though!

Title: Re: iago's lockdown source (100% C)
Post by: vuther.de on June 03, 2007, 04:06 PM
Quote from: Warrior on June 03, 2007, 12:43 PM
So people (like you) who can't reverse it themselves can use it? Why else?

Stop being such a damn elitist just because Rob let you use his implementation. Before his you were QQing about it just like every other "programmer"

I'm not trying to be a "elitist", Warrior. I have never tried to be. You try to be the elitist and flame me for saying "so people (like you) who can't reverse it themselves can use it" when you can't even do it yourself. So don't try to flame me for having access to a DLL that a friend had given me.

And what are you talking about "QQing" about not having lockdown? I could give a fuck's less if I had lockdown implemented into my bot. Rob was nice enough to send me his because he found out I was truthworthy. So don't come at me with this shit, Warrior. I don't even know why you flamed me for, it was uncalled for.
Title: Re: iago's lockdown source (100% C)
Post by: Ringo on June 03, 2007, 04:22 PM
Nice work iago/rob! :P
I wunderd when somone would release a fully working lockdown source :D
Lets just hope they dont change the dlls again any time soon :(

Aside I just tolk a look at the data in STAR.bin and W2BN.bin (these interested me alot), and knowing its the screen buffer (from other posts) I tolk a look at a screen shot of the logon screen (pcx -> bmp) and it looks like the bit of screen that is hashed, is:
(http://www.geocities.com/ringomail711/Out.bmp)

This code should* output the buffer from the raw pcx from the mpq (converted into a bmp with no color/pallet changes)

Private Function GetScreenBuffer(ByVal strBMPPath As String, ByVal strDumpPath As String) As Boolean
    If Dir(strBMPPath) = vbNullString Then Exit Function
    Dim FF      As Integer
    Dim strBMP  As String
    Dim strDump As String
    FF = FreeFile
    Open strBMPPath For Binary Lock Read As #FF
        If LOF(FF) < 267351 + (48 * 640) Then
            Close #FF
            Exit Function
        End If
        strBMP = String(LOF(FF) - 267351, 0)
        Get #FF, 267351, strBMP
    Close #FF
    For FF = 1 To (48 * 640) Step 640
        strDump = Mid(strBMP, FF, 208) & strDump
    Next FF
    strDump = Left(strDump, Len(strDump) - 1)
    If Not Dir(strDumpPath) = vbNullString Then
        Call Kill(strDumpPath)
    End If
    FF = FreeFile
    Open strDumpPath For Binary Lock Write As #FF
        Put #FF, 1, strDump
    Close #FF
    GetScreenBuffer = True
End Function

I also think* SCJ/SC/BW/SCW all use the same back screen. (I could be wrong tho)
Im not sure what image d1 uses for its back ground image, or if you could get away with useing a ss rather than the back image.
Title: Re: iago's lockdown source (100% C)
Post by: Warrior on June 03, 2007, 06:15 PM
Quote from: inner.de on June 03, 2007, 04:06 PM
I'm not trying to be a "elitist", Warrior. I have never tried to be. You try to be the elitist and flame me for saying "so people (like you) who can't reverse it themselves can use it" when you can't even do it yourself. So don't try to flame me for having access to a DLL that a friend had given me.

Ok? I never excluded myself from that list. Why else would he release it?

Quote from: inner.de on June 03, 2007, 04:06 PM
And what are you talking about "QQing" about not having lockdown? I could give a fuck's less if I had lockdown implemented into my bot. Rob was nice enough to send me his because he found out I was truthworthy. So don't come at me with this shit, Warrior. I don't even know why you flamed me for, it was uncalled for.

The fact is, that if you didn't have Rob's DLL implemented in your hashing server, you'd be scrambling for iago's work.

Stop acting like a retard and use some common sense. Why would someone release code to something that has not been publicly released before? warz beat him by a day with his release, are you on his case?

Jesus christ.
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 03, 2007, 10:24 PM
Quote from: iago on June 03, 2007, 02:24 AM
I was beat to it by a day! I was going to release mine tomorrow! :(++

http://www.skullsecurity.org/wiki/index.php/Lockdown
http://www.javaop.com/~ron/code/lockdown

Pure C.

Not as pretty as Warz's code, but it's complete :P
Havent checked it out yet but thanks ;p
Title: Re: iago's lockdown source (100% C)
Post by: vuther.de on June 04, 2007, 03:17 PM
Quote from: Warrior on June 03, 2007, 06:15 PM
Quote from: inner.de on June 03, 2007, 04:06 PM
I'm not trying to be a "elitist", Warrior. I have never tried to be. You try to be the elitist and flame me for saying "so people (like you) who can't reverse it themselves can use it" when you can't even do it yourself. So don't try to flame me for having access to a DLL that a friend had given me.

Ok? I never excluded myself from that list. Why else would he release it?

Quote from: inner.de on June 03, 2007, 04:06 PM
And what are you talking about "QQing" about not having lockdown? I could give a fuck's less if I had lockdown implemented into my bot. Rob was nice enough to send me his because he found out I was truthworthy. So don't come at me with this shit, Warrior. I don't even know why you flamed me for, it was uncalled for.

The fact is, that if you didn't have Rob's DLL implemented in your hashing server, you'd be scrambling for iago's work.

Stop acting like a retard and use some common sense. Why would someone release code to something that has not been publicly released before? warz beat him by a day with his release, are you on his case?

Jesus christ.
I didn't know that warz released his, I didn't think he would because of Rob not wanting him to.

And Jesus Christ has nothing to do with this.
Title: Re: iago's lockdown source (100% C)
Post by: Warrior on June 04, 2007, 04:05 PM
Uhuh. What about Rob releasing his? Get on his case.

STFU, imho.
Title: Re: iago's lockdown source (100% C)
Post by: vuther.de on June 04, 2007, 04:31 PM
Quote from: Warrior on June 04, 2007, 04:05 PM
Uhuh. What about Rob releasing his? Get on his case.

STFU, imho.
Why would you tell me to STFU, when you know I won't?

And I wasn't talking about Rob releasing his, I was talking about Rob not wanting warz to release lockdown, because him and Rob both worked on it.

And I'm not getting on anyone's case, I was simply asking iago why would he release this.. and you get all personal like you did it. You didn't do shit Warrior, so get off iago's "case". STFU, imho (whatever the hell that means)
Title: Re: iago's lockdown source (100% C)
Post by: l2k-Shadow on June 04, 2007, 05:03 PM
in my honest opinion :D
Title: Re: iago's lockdown source (100% C)
Post by: brew on June 04, 2007, 05:05 PM
Quote
STFU, imho (whatever the hell that means)
ROFL.
"SHUT THE FUCK UP, in my humble opinion"
Title: Re: iago's lockdown source (100% C)
Post by: Don Cullen on June 04, 2007, 05:07 PM
Yes, Warz released his code. Not here at this particular forum, but over at x86's forums. Here's link to the thread in where Warz released his stuff:

http://www.x86labs.org:81/forum/index.php/topic,8679.0.html

Direct link to the Warz source code download:

http://rafm.org/files/checkrevision.zip
Title: Re: iago's lockdown source (100% C)
Post by: brew on June 04, 2007, 05:17 PM
Yeah speaking of which rob's dll doesn't work at all in vb6 when compiled









just thought i'd throw that in there...
also it randomly returns invalid checksums.
Title: Re: iago's lockdown source (100% C)
Post by: vuther.de on June 04, 2007, 05:34 PM
Quote from: brew on June 04, 2007, 05:17 PM
Yeah speaking of which rob's dll doesn't work at all in vb6 when compiled

just thought i'd throw that in there...
also it randomly returns invalid checksums.

Sure it does. Works perfectly for me :)
Title: Re: iago's lockdown source (100% C)
Post by: l2k-Shadow on June 04, 2007, 05:41 PM
Quote from: brew on June 04, 2007, 05:17 PM
Yeah speaking of which rob's dll doesn't work at all in vb6 when compiled









just thought i'd throw that in there...
also it randomly returns invalid checksums.
http://forum.valhallalegends.com/index.php?topic=16694.msg169676#msg169676
Title: Re: iago's lockdown source (100% C)
Post by: warz on June 04, 2007, 05:42 PM
Quote from: Kyro on June 04, 2007, 05:07 PM
Yes, Warz released his code. Not here at this particular forum, but over at x86's forums. Here's link to the thread in where Warz released his stuff:

http://www.x86labs.org:81/forum/index.php/topic,8679.0.html

Direct link to the Warz source code download:

http://rafm.org/files/checkrevision.zip

for the record, the url to the x86 forum post is old, and incorrect. :P
Title: Re: iago's lockdown source (100% C)
Post by: brew on June 04, 2007, 06:27 PM
Quote from: l2k-Shadow on June 04, 2007, 05:41 PM
http://forum.valhallalegends.com/index.php?topic=16694.msg169676#msg169676
Try compiling it
Title: Re: iago's lockdown source (100% C)
Post by: Denial on June 04, 2007, 10:22 PM
Intresting, Now for lockdown version 2 that comes out.
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 04, 2007, 10:23 PM
The bin dumping device seems to not like Win2k
Title: Re: iago's lockdown source (100% C)
Post by: iago on June 04, 2007, 11:05 PM
Quote from: Denial on June 04, 2007, 10:22 PM
Intresting, Now for lockdown version 2 that comes out.
See my post in the thread "Hmm"

Quote from: l)ragon on June 04, 2007, 10:23 PM
The bin dumping device seems to not like Win2k
It doesn't seem to work for most people. Don't know why, don't care really, just download the .bin file :P
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 05, 2007, 12:01 AM
Quote from: iago on June 04, 2007, 11:05 PM
Quote from: Denial on June 04, 2007, 10:22 PM
Intresting, Now for lockdown version 2 that comes out.
See my post in the thread "Hmm"

Quote from: l)ragon on June 04, 2007, 10:23 PM
The bin dumping device seems to not like Win2k
It doesn't seem to work for most people. Don't know why, don't care really, just download the .bin file :P
nm heh your useing an xp/vista api in one of the librarys, http://msdn2.microsoft.com/en-us/library/ms683215.aspx.
Title: Re: iago's lockdown source (100% C)
Post by: iago on June 05, 2007, 12:08 AM
wow, I didn't know that was XP-specific.

Maybe I'll fix that -- I'll put "Requires XP or higher" on the download page :D
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 05, 2007, 09:33 AM
Quote from: iago on June 05, 2007, 12:08 AM
wow, I didn't know that was XP-specific.

Maybe I'll fix that -- I'll put "Requires XP or higher" on the download page :D
int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, (LPDWORD)dwProcessId);
Title: Re: iago's lockdown source (100% C)
Post by: MyndFyre on June 06, 2007, 11:19 AM
Quote from: l)ragon on June 05, 2007, 09:33 AM
Quote from: iago on June 05, 2007, 12:08 AM
wow, I didn't know that was XP-specific.

Maybe I'll fix that -- I'll put "Requires XP or higher" on the download page :D
int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, (LPDWORD)dwProcessId);


That would generate a null pointer exception.  You're thinking:

int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, &dwProcessId);
Title: Re: iago's lockdown source (100% C)
Post by: K on June 06, 2007, 12:13 PM
Quote from: MyndFyre[vL] on June 06, 2007, 11:19 AM
Quote from: l)ragon on June 05, 2007, 09:33 AM
Quote from: iago on June 05, 2007, 12:08 AM
wow, I didn't know that was XP-specific.

Maybe I'll fix that -- I'll put "Requires XP or higher" on the download page :D
int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, (LPDWORD)dwProcessId);


That would generate a null pointer exception.  You're thinking:

int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, &dwProcessId);


Which also won't work because hProcess is a process HANDLE and not a HWND.
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 06, 2007, 06:15 PM
Quote from: K on June 06, 2007, 12:13 PM
Quote from: MyndFyre[vL] on June 06, 2007, 11:19 AM
Quote from: l)ragon on June 05, 2007, 09:33 AM
Quote from: iago on June 05, 2007, 12:08 AM
wow, I didn't know that was XP-specific.

Maybe I'll fix that -- I'll put "Requires XP or higher" on the download page :D
int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, (LPDWORD)dwProcessId);


That would generate a null pointer exception.  You're thinking:

int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, &dwProcessId);


Which also won't work because hProcess is a process HANDLE and not a HWND.
Ya that was my bad, thinking the wrong way heh.
Title: Re: iago's lockdown source (100% C)
Post by: MyndFyre on June 06, 2007, 08:32 PM
Quote from: K on June 06, 2007, 12:13 PM
Quote from: MyndFyre[vL] on June 06, 2007, 11:19 AM
Quote from: l)ragon on June 05, 2007, 09:33 AM
Quote from: iago on June 05, 2007, 12:08 AM
wow, I didn't know that was XP-specific.

Maybe I'll fix that -- I'll put "Requires XP or higher" on the download page :D
int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, (LPDWORD)dwProcessId);


That would generate a null pointer exception.  You're thinking:

int dwProcessId = 0;
GetWindowThreadProcessId(hProcess, &dwProcessId);


Which also won't work because hProcess is a process HANDLE and not a HWND.

Nuh uh.  You didn't see me declare it:

HWND hProcess = GetDesktopWindow(); // or some other window function
int dwProcess = 0;

GetWindowThreadProcessId(hProcess, &dwProcessId);

See??
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 07, 2007, 02:28 AM
Quote from: brew on June 03, 2007, 02:20 PM
if you had read the first link, iago made a screen dumper. go make them yourself.
If you read through this thread aswell you would notice parts are XP/Vista dependent.

edit: late reply heh my bad.
Title: Re: iago's lockdown source (100% C)
Post by: Denial on June 07, 2007, 01:25 PM
By the way im mirroring the files for iago

http://godkillme.com/lockdown/


has the .dll's as well. If you have any more files which you need hosted let me know as the project continues.
Title: Re: iago's lockdown source (100% C)
Post by: LCSBSSRHXXX on June 07, 2007, 04:44 PM
Beautiful work iago!  Thanks.
Title: Re: iago's lockdown source (100% C)
Post by: Joe[x86] on June 11, 2007, 11:09 AM
Quote from: brew on June 04, 2007, 05:17 PM
Yeah speaking of which rob's dll doesn't work at all in vb6 when compiled









just thought i'd throw that in there...
also it randomly returns invalid checksums.

Solution:

Quit using VB. Damn.
Title: Re: iago's lockdown source (100% C)
Post by: l)ragon on June 11, 2007, 10:08 PM
Quote from: Joex86] link=topic=16753.msg169999#msg169999 date=1181578183]
Quote from: brew on June 04, 2007, 05:17 PM
Yeah speaking of which rob's dll doesn't work at all in vb6 when compiled









just thought i'd throw that in there...
also it randomly returns invalid checksums.

Solution:

Quit using VB. Damn.

is that the only constructive comment you can come up with anymore?
Title: Re: iago's lockdown source (100% C)
Post by: Chriso on June 12, 2007, 04:40 AM
Rob's dll does work, you just have to use his bin files (not iagos)
Title: Re: iago's lockdown source (100% C)
Post by: rabbit on June 12, 2007, 07:40 AM
True!  Rob's works.  I pass CR with it just fine, except I get invalid version back :\
Title: Re: iago's lockdown source (100% C)
Post by: Chriso on June 12, 2007, 08:06 AM
Make sure you are using the bin files on his server:

Heres the download to his screen dumps:
http://www.onlythechosen.com/w2bn.bin
http://www.onlythechosen.com/star.bin
http://www.onlythechosen.com/sexp.bin

Updated CheckRevision.dll:
http://www.onlythechosen.com/test/CheckRevision.dll
Title: Re: iago's lockdown source (100% C)
Post by: rabbit on June 12, 2007, 12:16 PM
I'm not retarded.  I'm using his latest CheckRevision.dll and his screen dumps, as well as up-to-date hashes.  I still get 0x101 back.
Title: Re: iago's lockdown source (100% C)
Post by: brew on June 12, 2007, 06:11 PM
What client are you trying to connect with? I couldn't connect using that dll at all with w2bn, but it works just dandy with sc.. for a while (after oh-so many calls it starts returning invalid results)
Title: Re: iago's lockdown source (100% C)
Post by: rabbit on June 12, 2007, 07:32 PM
I'm using my own hashes for Brood War and Rob's Brood War screen dump.
Title: Re: iago's lockdown source (100% C)
Post by: Chriso on June 13, 2007, 02:18 AM
Quote from: brew on June 12, 2007, 06:11 PM
What client are you trying to connect with? I couldn't connect using that dll at all with w2bn, but it works just dandy with sc.. for a while (after oh-so many calls it starts returning invalid results)
He fixed that when I notified him of it, contact him for the new one, it works fine.
Title: Re: iago's lockdown source (100% C)
Post by: squeegee on July 04, 2007, 09:41 PM
I'd like to tell you all that this is not a real fix


Screen dumps? k
Title: Re: iago's lockdown source (100% C)
Post by: warz on July 04, 2007, 11:53 PM
Quote from: squeegee on July 04, 2007, 09:41 PM
I'd like to tell you all that this is not a real fix
Screen dumps? k

Oh mighty squeegee, what else may you tell us?!
Title: Re: iago's lockdown source (100% C)
Post by: TheMinistered on July 05, 2007, 12:47 AM
Oh mighty dickhead betawarz, what else may you tell us, besides the fact you're a dickhead wannabe?

In reply to Hdx's post on page 1:
Quote
not sure if hard parts is the right phrase - more like the large parts.

Yeah, so I'm kinda talking without actually having looked at your code or having looked at lockdown in a debugger/disassembler, But why would you only port portions of the code.  It would seem that if you planned on using the DLL you would only port code needed to load and call the dll.

i.e. lets say that the dll have four functions named one, two, three, and four and the application had two functions called load and call, lets say function two is small and the the rest in the dll are large.

it would seem that you should either a) port all the functions so you don't need a dll or b) port the load and call functions from the application.  it would seem a waste of time to only port function one just so you don't have to call it from the dll

I dunno, i'm talking about something i don't entirely know you reasons behind... just seemed illogical to me how you decided to take your approach.  please explain warz ;p thanks
Title: Re: iago's lockdown source (100% C)
Post by: warz on July 05, 2007, 01:12 AM
All-mighty dick head betawarz speaks:

The intention was to convert everything, of course. Naturally, beginning with pure function pointers, and calling required functions, provided lockdown implementations long before the public had them. Converting them one by one to C++ was the next step in the process. Don't try to read between the lines - there's no conspiracy.