+ Reply to Thread
Showing results 1 to 9 of 9

Thread: SC Mod, how to implement for all who wish?

  1. #1

    Advocate
    zonemikel has a spectacular aura about zonemikel's Avatar
    Join Date
    Jul 2007
    Location
    TeXaS
    Posts
    308

    Default SC Mod, how to implement for all who wish?

    well after spending hordes of time on LC just trying to debug it i dont care anymore, screw last chaos, good job lc developers.

    Since im really just looking for something to do I turned my attention to good ol starcraft.

    This is what i want to do, everything has a "kill" counter but it does nothing but keep track of how many things a certain thing has killed. I want to make it so with more kills, more power.

    something like this, if a marine kills 15 things it will get like 10 more hp or something of that sort. Basically so units get more powerful as they do stuff, and some units are more expendable than others.

    I think this would add a nice twist to the game, if nothing else me and my friends could play it this way against each other.

    I have already found a place to code cave in and add stuff when something is killed. eg incrament kills () {jmp to my function, incrament hp}
    I have also found most of the upgrade locations for toss and terrain.

    My question is how can i make this work for all clients, would it be sufficent for us both to have the same hack injected? What causes the disconnects? How could I make a mod/hack that users could use across the inet?

    thanks everyone, oh and in case anyone is interested
    Code:
    0058D2B7  ground armor
    0058D2C7  ground machine armor
    0058D2C7  air armor
    
    0058D2A7  seige ability ??
    0058D2C7  footsoldier wepon upgrade
    0058D2C7  ground machine wepon upgrade
    0058D2C7  air wepon upgrade
    // others
    0058D2C7-01  marine +atk range
    
    // as protoss eax = 2E 
    DS:[0058D2A8] = ?? maybe enimie ? i just attacked ? 
    DS:[0058D2D5] = protoss sheilds
    DS:[0058D2D3] = toss melee wepons
    DS:[0058D2CB] = melee armor
    DS:[0058D2E7] = dragoon attack range
    DS:[0058D2E9] = scarab damage
    = mind control didnt break is it in another location ? 
    DS:[0058D2E8] = zlot leg enhance
    those are all the locations this is the actuall function that does it, dl is the new value of the upgrade, ecx is which upgrade (location) and eax is which race. Im pretty sure all three races are stored in the same location with a different mutiplyer for the array eg. marine eax=0x0 toss eax=0x2E

    Code:
    004CE3BC  |. 889408 98D2580>MOV BYTE PTR DS:[EAX+ECX+58D298],DL
    Not sure how each client knows how upgraded each other client is when they are connected, guess thats the core of my question

    BTW** ya i know those arent all the upgrades but they are mostly in that area and readily available, also i know things like max hp might be static and span across a class . . . n e way TIA
    Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

    "Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."




  2. #2
    Gold Member

    High Priest
    ViperSRT3g is a jewel in the rough
    Join Date
    Feb 2006
    Posts
    1,452

    Default

    Here are some potentially helpful offsets ^^ These were not found by me.
    Code:
    0058CE0C        Technologies Available (SC) (12 * 24)
    0058CF2C        Technologies Researched (SC) (12 * 24)
    0058D04C        Research in Progress (SC; Unused) (3 * 12)
    0058D070        Upgrades Available (SC) (12 * 46)
    0058D298        Upgrades Researched (SC)  (12 * 46)
    0058D4C0        Upgrades in Progress lvl 1 (SC; Unused) (6 * 12)
    0058D508        Upgrades in Progress lvl 2 (SC; Unused) (6 * 12)
    0058D550        Upgrades in Progress lvl 3 (SC; Unused) (6 * 12)

  3. #3

    Advocate
    zonemikel has a spectacular aura about zonemikel's Avatar
    Join Date
    Jul 2007
    Location
    TeXaS
    Posts
    308

    Default

    Quote Originally Posted by ViperSRT3g View Post
    Here are some potentially helpful offsets ^^ These were not found by me.
    Sweet thanks.
    Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

    "Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."




  4. #4
    Trance Addict Senior Member

    Evangelist
    Jakor is a glorious beacon of light Jakor is a glorious beacon of light Jakor is a glorious beacon of light Jakor's Avatar
    Join Date
    Jan 2005
    Posts
    1,202

    Default

    I almost told you to just do it through a ums game, as many people have done something similar to this, but then you couldn't use it on just any map, so I will stop myself and let you go about your work!

    edit: for your question...

    having the same hack injected (as long as it is coded to modify every unit that kills something not just your own) is enough. I wrote a backdoor for starcraft in one of the old hacks. One feature I would press F6 or whatever and I would send the command for cheats which were 5 bytes long they command and a dword parameter. with this I could make a command saying "00 01 02 ff ff" where 00 was the command for cheat (which if you weren't running my backdoor would be just thrown away during a multiplayer game) 01 was my backdoor command (I had one for pinging to see who was running my hack one to change minerals one to change gas) 02 is the playernumber for the action and ff ff was the amount of gas/minerals.
    Last edited by Jakor : 11-02-2008 at 04:19 PM
    There are 10 kinds of people in the world...
    Those who know binary and those who don't...

  5. #5

    Advocate
    zonemikel has a spectacular aura about zonemikel's Avatar
    Join Date
    Jul 2007
    Location
    TeXaS
    Posts
    308

    Default

    Thanks jakor, im pretty sure i have it figured out. As long as each client has the mod injected and all the memory addresses are the same through each client it should be ok.

    I've been finding stuff all day, i really need to give it a rest . . .

    This is the place where im thinking about using a jmp patch, not sure how ill do that in c++ though
    Code:
    // 00479CB1 mov     eax, ebx ; at this point
       ebx = pointer to object killed, +0x64 is type 
       esi = pointer to killing object, +0x64 type
       unit ptr + 0x09 = current hp
       unit ptr + 0x64 = type
       unit ptr + 16d = going to (mouse click)
       // if you change these below werid things happen
       // including jumping across the screen, overlapping and stuffs
       unit ptr + 20d = current location (cant change manually ?)
       unit ptr + 24d = current location (cant change manually ?)
       unit ptr + 27d = current location (cant change manually ?)
    so this way i can know who killed who, now i need to find the offset for which player killed which player, i pretty much already found it im just looking in a better place. I might implement something simple at first like when a unit kills another it gets +5hp, so if a unit is killing tons of others it would have more hit points, but 85/35 would suck, i think max hp is static of the unit class (cant change one without changing them all).
    Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

    "Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."




  6. #6

    Advocate
    zonemikel has a spectacular aura about zonemikel's Avatar
    Join Date
    Jul 2007
    Location
    TeXaS
    Posts
    308

    Default Progress

    Well i got the code cave to work in c++, pretty easy. Its nice to see some asm in my naked function, so i can tell wtf is going on when i look at my code in the debugger. BTW thanks to hellinsect for some code in a old post, i used some of his code to implement the writing for the patch, wpm was not doing it for me. I like his style.

    Code:
    void SCMod::jmpPatch(void *pDest, void *pSrc)
    {   // credits to hellinsect, i tried to make one from wpm but this is 
        // sweet, im not going to reinvent the wheel!
        DWORD OldAccessRights = 0;
        VirtualProtect(pSrc, 5, PAGE_EXECUTE_READWRITE, &OldAccessRights);
        *(BYTE*)((DWORD)pSrc)    = 0xE9;
        *(DWORD*)((DWORD)pSrc+1) = (DWORD)pDest - (DWORD)pSrc - 5;
        VirtualProtect(pSrc, 5, OldAccessRights, &OldAccessRights);
    }
    void SCMod::nopIt(void *pDest, int nops)
    {   // just another implementation of the code above
        DWORD OldAccessRights = 0;
        VirtualProtect(pDest, nops, PAGE_EXECUTE_READWRITE, &OldAccessRights);
        for(BYTE i = 0; i<nops; i++)
        *(BYTE*)((DWORD)pDest + i) = 0x90;
        VirtualProtect(pDest, nops, OldAccessRights, &OldAccessRights);
    }
    I made the code cave just give the killer 100 hp to test and it works pretty good. Now its just a matter of bringning everything together so that different types of things happen depending on what attacks what. But for the time being im fed up with it.

    Code:
    __declspec(naked) void codecave1(void)
    {
        __asm{
        PUSHAD
        ADD DWORD PTR DS:[ESI+9],64
        POPAD
        MOV EAX,EBX
        MOV DWORD PTR DS:[EBX+8],0
        JMP retpt
        }
    }
    --UPDATE--
    Well i dont want to double post so i am editing this. Everything is coming along nicely, that code cave is a nightmare though, it was hashed out, im making a much better one. Also i've gotten text to print out on the screen, almost it prints just gibberish, it will be finished soon.

    Im thinking of making it so there is like a random time based upgrades and stuff to switch it up, like you might get better ground attack upgrade while the other team gets air attack upgrade and the other team gets def upgrade or something of that sort, it will last for like 2 minutes then "wear off".

    Also im doing this all in c++ in a very modular way. Once i clean up my code it will be very useful to anyone who wants to mess with starcraft. It will have stuff like .codecave .bwpubprint and lots of other stuff that are basic to most hacks/mods.

    I just got a new puter today (core2 duo) so i was setting that up with windows xp 64. But ill get back to this in a few days.
    Last edited by zonemikel : 11-05-2008 at 02:26 AM
    Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

    "Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."




  7. #7

    Advocate
    zonemikel has a spectacular aura about zonemikel's Avatar
    Join Date
    Jul 2007
    Location
    TeXaS
    Posts
    308

    Default

    This are still going along well, everything is working. Its just a matter of figuring out which triggers should give which upgrades to make it fun. If you just get a upgrade every time you kill five people it would be very linear and boring (any ideas welcome here!!). So i currently have it setup so it will give a upgrade based on whatever unit killed the 5th enemy unit, so if you kill like 5 people with your marines you will get a ground armor upgrade if you kill 5 more people with your wraith you'll get a air attack upgrade.

    I'm going to give it a break for a while while i "brood" over the best way to continue. I'll upload the .dll if anyone wants to try it out, i havent made a injector yet.

    Attached Images  
    Last edited by zonemikel : 12-20-2008 at 02:54 PM
    Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

    "Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."




  8. #8

    Heretic
    poiuy_qwert is on a distinguished road
    Join Date
    Jun 2005
    Posts
    39

    Default

    You should look into using MPQDraft/FireGraft plugins to do this, much less messy then injecting dlls and requiring everyone to run a hack. I can supply more info when I get home tomorrow if you want.

  9. #9

    Advocate
    zonemikel has a spectacular aura about zonemikel's Avatar
    Join Date
    Jul 2007
    Location
    TeXaS
    Posts
    308

    Default

    Quote Originally Posted by poiuy_qwert View Post
    You should look into using MPQDraft/FireGraft plugins to do this, much less messy then injecting dlls and requiring everyone to run a hack. I can supply more info when I get home tomorrow if you want.
    Ya, that would be the smart way to do things. Those look like nice programs, not sure how they work. I just did this to get my mind off of other things, i have already moved on to several other things.

    I did get this to work as desired and played my friend online, he beat me badly (he never beats me). It was fun.
    Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

    "Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [Movie] The Fall
    By Empathy in forum Music and Movies
    Replies: 1
    Last Post: 06-02-2008, 07:22 PM
  2. If I fill out another app, my fingers will fall off
    By Fallen in forum World of Warcraft
    Replies: 19
    Last Post: 04-05-2008, 01:12 AM
  3. Fall Out Boy
    By dragonnas in forum Music and Movies
    Replies: 6
    Last Post: 12-29-2007, 10:17 PM
  4. Fall Out Boy
    By Empathy in forum Music and Movies
    Replies: 31
    Last Post: 03-07-2006, 03:57 AM
  5. Music: The Fall of Troy
    By Empathy in forum Music and Movies
    Replies: 0
    Last Post: 02-28-2006, 12:35 AM

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts