• Welcome to Valhalla Legends Archive.
 

ExtraWork

Started by UserLoser., June 14, 2004, 01:17 AM

Previous topic - Next topic

UserLoser.

How many of you out there are recieving packet 0x4A right now as you log on and have absolutely oblivious to what it's for?!  Well, if you're in that crowd, then here's the code for you! (Well, not all of it):

Special thanks to TheMinistered!


typedef BOOL (__fastcall ExtraWorkProc)(void *);

enum GameType {
  Diablo2 = 1,
  Warcraft3 = 2,
  Starcraft = 3,
  WorldOfWarcraft = 4
};

struct EXTRAWORK {
  WORD GameType;
  WORD Length;
  char OutBuffer[1024];
};

   BOOL bReturn;
   EXTRAWORK ew;

   ew.GameType = Starcraft;
   ew.Length = 4;   // should always be four
   *(DWORD*)&ew.OutBuffer = GetSystemDefaultLangID();


It's up to you to figure out how to load it, and call it!  Also, here's the catch, you have to figure out what to pass into OutBuffer for it to work with Diablo II!

Make sure HKEY_CURRENT_USER\Software\Battle.net\Optimize\SysDesc (REG_DWORD) is set to 1, or this may not work!

For whole source,  send $5 via paypal to my paypal address at [email protected].

Also, in the future near you; the equivlent of ExtraWork() may also be available in C/C++ code!
Complaints?  Take a hike.


Packet format (id=0x4B):
(WORD) Unknown (1)
(WORD) Length of data returned by ExtraWork
(STRING) Data returned from ExtraWork

TheMinistered

I think blizzard is gay for using the buffer as an in/out parameter anyways.  I think blizzard is gay for doing lots of things though, but I guess that's just me! :D

UserLoser.

Quote from: hismajesty[yL] on June 14, 2004, 11:31 AM
I thought it was Maddox and Telos in the beginning, and you and iago. Wow, I'm misinformed. Anyway, didn't you (or somebody else) already explain what 0x4A was for?

AFAIK, Telos was there for only one function, but I could be wrong.

0x4A responds with various information about your computer, example output:


System Debug Info 1.03
Game: Starcraft
CPU:  GenuineIntel Type 0 Family F Model 1 Stepping 2 Brand 8 1794 MHz
RAM:  511 MB
OS:   WinNT 5.2 "" Build 3790
DX:   4.09.00.0902
Vid1: Vendor 000010de Device 00000150 "NVIDIA GeForce2 GTS/GeForce2 Pro (Microso
ft Corporation)"
Aud1: Module "WaveOut 0" Device "Modem #0 Line Playback (emulated)"
Aud2: Module "ac97intc.sys" Device "Intel(r) Integrated Audio"

Maddox

#3
What is the point of this?
asdf.

UserLoser.

#4
Quote from: Maddox on June 14, 2004, 01:07 PM
Quote from: UserLoser. on June 14, 2004, 01:17 AM
   ew.Length = 4;   // should always be four

Should be ew.Length = sizeof(EXTRAWORK);

Also, this is generally referred to as "size," not "length."

Setting it to not equal 4 (example: 5), would return something like "ERR: Length 5" - that's where we got the "Length" from

Maddox

Well, I looked at the struct again and found out I was incorrect so I edited my post a few seconds later. You're just too quick.
asdf.

Forged

Why don't you just block the extrawork.dll  It is a bad function anyway -_-
QuoteI wish my grass was Goth so it would cut itself

TheMinistered

Actually, it could proove useful for further game development.  This extrawork.dll lets blizzard know what the majority of the population on battle.net's computer specs are like!  Thus, they can target certain cards or certain processors to make optimizations.

Forged

It can also detect what they do while in game i.e memory injections, so it is an effective tool for hack detections. (I think)
QuoteI wish my grass was Goth so it would cut itself

dxoigmn

Here is my old code combined with this new code that works for all 3 possible GameTypes:

Looking at IX86ExtraWork.dll, it doesn't seem to handle GameType = WorldOfWarcraft (4).  Where did you get this from?


#include <windows.h>
#include <iostream>

using namespace std;

typedef bool (__fastcall *ExtraWorkProc)(void *);

enum GameType {
 Diablo2 = 1,
 Warcraft3 = 2,
 Starcraft = 3
};

struct EXTRAWORK {
 WORD GameType;
 WORD Length;
 char OutBuffer[1024];
};

int main() {
   HINSTANCE      hLib;
   ExtraWorkProc   lpfnExtraWork;
   BOOL         bReturn;
   EXTRAWORK      ew;

   ew.GameType = Starcraft; // Change this to specified GameType
   ew.Length = 4;

   if (ew.GameType == Diablo2) {
      *(DWORD*)&ew.OutBuffer = 0;
   } else {
      *(DWORD*)&ew.OutBuffer = GetSystemDefaultLangID();
   }

   hLib = LoadLibrary("IX86ExtraWork.dll");

   if (hLib) {
      lpfnExtraWork = (ExtraWorkProc)GetProcAddress(hLib, "ExtraWork");

      if (lpfnExtraWork) {
         bReturn = (*lpfnExtraWork)(&ew);

         cout << "ExtraWork returned " << (bReturn?"TRUE":"FALSE") << endl;
         cout << "GameType: " << ew.GameType << "\t\t" << "Length: " << ew.Length << endl << endl;
         cout << "Message: " << ew.OutBuffer << endl;
      }

      FreeLibrary(hLib);
   }

   return 0;
}

UserLoser.

Quote from: Forged on June 14, 2004, 05:51 PM
It can also detect what they do while in game i.e memory injections, so it is an effective tool for hack detections. (I think)

Nah

BaDDBLooD

Anyone mind explaining the importance of parsing this packet, and how you would go about it in Visual Basic 6.0?
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Tuberload

Quote from: BaDDBLooD on June 14, 2004, 11:08 PM
Anyone mind explaining the importance of parsing this packet, and how you would go about it in Visual Basic 6.0?

Get a reference for C/C++ and then one for VB, and go through the code step by step converting the C/C++ functions to there VB equivalent.

I don't think it would be very useful though.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

BaDDBLooD

well i don't know c/c++
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Tuberload

Quote from: BaDDBLooD on June 14, 2004, 11:49 PM
well i don't know c/c++

The idea with the reference is you can look up what a method does, and then find the method in VB that does the same thing and convert it. If you don't know C/C++ I would recommend learning the language syntax and getting a basic understanding of it before attempting to convert the code.

I don't know C/C++ very well either, but the limited knowledge I do have, and my ability to read has allowed me to convert C/C++ code to Java a number of times.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown