Loading ...
Sorry, an error occurred while loading the content.

Re: [metamod] Re: Memory Searching / Editing

Expand Messages
  • David Anderson
    TFC has a CurWeapon message and we ve got a bunch of TFC helpers (including ammo functions) for AMX Mod X. So my same message as before still applies. Source:
    Message 1 of 6 , Mar 22, 2007
    View Source
    • 0 Attachment
      TFC has a CurWeapon message and we've got a bunch of
      TFC helpers (including ammo functions) for AMX Mod X.
      So my same message as before still applies.

      Source:
      http://svn.alliedmods.net/viewvc.cgi/trunk/dlls/tfcx/?root=amxmodx

      If you really want to go into memory hacks, it
      unfortunately goes beyond the scope of normal
      Metamod/HL1 API coding. However, I can tell you a few
      things you'll need:
      * learn x86 assembly
      * read about mprotect() / VirtualProtect()
      * get a cross-platform disassembler, such as IDA. If
      you just want quick disassemblies you can use
      'objdump' on linux.

      Once you've got that, you can start looking for the
      TFC function that depletes a player's ammo, and
      patches it out. The HL1SDK will help you find this
      easily.

      ---David "BAILOPAN" Anderson
      http://www.amxmodx.org/

      --- altpluzf4 <altpluzf4@...> wrote:

      > No not counterstrike, TFC. But, I'm not really
      > looking to use it for
      > the ammo of a weapon. I'm just wanting the general
      > knowledge for other
      > things.
      >
      > Thanks though, but I'm actually looking for the
      > Memory editing
      > information...
      >
      > --- In metamod@yahoogroups.com, David Anderson
      > <player220101@...> wrote:
      > >
      > > You don't need memory hacks to do this. You can
      > just
      > > restore ammo values when you've detected
      > low/depleted
      > > clips in the CurWeapon network message.
      > >
      > > Assuming it's Counter-Strike you're dealing with,
      > of
      > > course. If that's the case, you may want to take
      > a
      > > look at the AMX Mod X code for hacking common
      > > Counter-Strike properties:
      > >
      > >
      >
      http://svn.alliedmods.net/viewvc.cgi/trunk/dlls/cstrike/cstrike/?root=amxmodx
      > >
      > > ---David "BAILOPAN" Anderson
      > > http://www.amxmodx.org/
      > >
      > > --- altpluzf4 <altpluzf4@...> wrote:
      > >
      > > > Hello. I'm new to this group (or any group
      > > > actually.)
      > > >
      > > > Does anyone have any idea how I could use a
      > metamod
      > > > plugin to 'search'
      > > > and/or 'alter' memory in Half-Life?
      > > >
      > > > I used to have a plugin that did this (or
      > something
      > > > similar) to 'lock'
      > > > the ammo count in the current clip of whatever
      > gun
      > > > you were using. The
      > > > result being infinite ammo without needing to
      > > > reload.
      > > >
      > > > It's been several years, and I just keep drawing
      > > > blanks when trying to
      > > > recall how it was done. The original code (for
      > the
      > > > altering of the
      > > > ammo) was given to me by someone, and I have no
      > way
      > > > of contacting them
      > > > now.
      > > >
      > > > Thanks for any help or suggestions!
      > > >
      > > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      >
      ____________________________________________________________________________________
      > > Don't get soaked. Take a quick peek at the
      > forecast
      > > with the Yahoo! Search weather shortcut.
      > >
      > http://tools.search.yahoo.com/shortcuts/#loc_weather
      > >
      >
      >
      >




      ____________________________________________________________________________________
      Sucker-punch spam with award-winning protection.
      Try the free Yahoo! Mail Beta.
      http://advision.webevents.yahoo.com/mailbeta/features_spam.html
    • altpluzf4
      Thank you for your time. I ve learned basic assembly (via a cracking tutorial *for educational purposes*) I ll look around and test some things and see what
      Message 2 of 6 , Mar 22, 2007
      View Source
      • 0 Attachment
        Thank you for your time.

        I've learned basic assembly (via a 'cracking' tutorial *for
        educational purposes*)

        I'll look around and test some things and see what I come up with.

        Thank you for the information.

        Also, a while ago, I tried using something like, a for loop, checking
        something like

        if (*((int*)pEntity->pvPrivateData + i) == 6)
        and set it to a clientcommand of "test"
        Of course, that didn't help at all.... it just always said when i was
        554, it was equal to 6

        Apparently I'm not really understanding what pvPrivateData is. If you
        have any information on this value, could you please explain.
        Honestly, I've never learned any programming... I just saw metamod one
        day, and got interested. So I downloaded simple sources like
        ChickenMod, that I could easily read and understand, and I taught
        myself the basics.

        So, Thanks again for your help!

        --- In metamod@yahoogroups.com, David Anderson <player220101@...> wrote:
        >
        > TFC has a CurWeapon message and we've got a bunch of
        > TFC helpers (including ammo functions) for AMX Mod X.
        > So my same message as before still applies.
        >
        > Source:
        > http://svn.alliedmods.net/viewvc.cgi/trunk/dlls/tfcx/?root=amxmodx
        >
        > If you really want to go into memory hacks, it
        > unfortunately goes beyond the scope of normal
        > Metamod/HL1 API coding. However, I can tell you a few
        > things you'll need:
        > * learn x86 assembly
        > * read about mprotect() / VirtualProtect()
        > * get a cross-platform disassembler, such as IDA. If
        > you just want quick disassemblies you can use
        > 'objdump' on linux.
        >
        > Once you've got that, you can start looking for the
        > TFC function that depletes a player's ammo, and
        > patches it out. The HL1SDK will help you find this
        > easily.
        >
        > ---David "BAILOPAN" Anderson
        > http://www.amxmodx.org/
        >
      • David Anderson
        pvPrivateData is a void * pointer to the CBaseEntity structure in the HL1SDK. This structure is mod specific, but you can get an idea of the information in it
        Message 3 of 6 , Mar 22, 2007
        View Source
        • 0 Attachment
          pvPrivateData is a void * pointer to the CBaseEntity
          structure in the HL1SDK. This structure is mod
          specific, but you can get an idea of the information
          in it by reading dlls/cbase.h

          Note that doing this:
          (int *)ptr + offs

          Is a bad idea. The reason is that the compiler will
          multiply your offset by sizeof(int). This results in
          DWORD addressing. If information you want is at an
          unaligned offset, you won't be able to access it
          nicely.

          This is a common mistake in a lot of HL1 code. If you
          see someone doing:
          *(int *)ptr + OFFS
          It should be:
          *(int *)((char *)ptr + OFFS)

          (Of course, when converting a dword offset to a byte
          offset, you must multiply by four.)

          Anyway, the best idea for analyizing pvPrivateData is
          to dump roughly 2-3K bytes of memory where
          pvPrivateData is, byte by byte. For example:

          unsigned char *ptr = (unsigned char
          *)ent->pvPrivateData;
          for (size_t i=0; i<=125; i++)
          {
          for (size_t j=0; j<16; j++,ptr++)
          printf("%02X-", *(unsigned char *)ptr);
          printf("\n");
          }

          Then analyze the data by hand. Of course you could
          spruce this up to be a lot nicer but it's just an
          example.

          ---David "BAILOPAN" Anderson
          http://www.amxmodx.org/

          --- altpluzf4 <altpluzf4@...> wrote:

          > Thank you for your time.
          >
          > I've learned basic assembly (via a 'cracking'
          > tutorial *for
          > educational purposes*)
          >
          > I'll look around and test some things and see what I
          > come up with.
          >
          > Thank you for the information.
          >
          > Also, a while ago, I tried using something like, a
          > for loop, checking
          > something like
          >
          > if (*((int*)pEntity->pvPrivateData + i) == 6)
          > and set it to a clientcommand of "test"
          > Of course, that didn't help at all.... it just
          > always said when i was
          > 554, it was equal to 6
          >
          > Apparently I'm not really understanding what
          > pvPrivateData is. If you
          > have any information on this value, could you please
          > explain.
          > Honestly, I've never learned any programming... I
          > just saw metamod one
          > day, and got interested. So I downloaded simple
          > sources like
          > ChickenMod, that I could easily read and understand,
          > and I taught
          > myself the basics.
          >
          > So, Thanks again for your help!
          >
          > --- In metamod@yahoogroups.com, David Anderson
          > <player220101@...> wrote:
          > >
          > > TFC has a CurWeapon message and we've got a bunch
          > of
          > > TFC helpers (including ammo functions) for AMX Mod
          > X.
          > > So my same message as before still applies.
          > >
          > > Source:
          > >
          >
          http://svn.alliedmods.net/viewvc.cgi/trunk/dlls/tfcx/?root=amxmodx
          > >
          > > If you really want to go into memory hacks, it
          > > unfortunately goes beyond the scope of normal
          > > Metamod/HL1 API coding. However, I can tell you a
          > few
          > > things you'll need:
          > > * learn x86 assembly
          > > * read about mprotect() / VirtualProtect()
          > > * get a cross-platform disassembler, such as IDA.
          > If
          > > you just want quick disassemblies you can use
          > > 'objdump' on linux.
          > >
          > > Once you've got that, you can start looking for
          > the
          > > TFC function that depletes a player's ammo, and
          > > patches it out. The HL1SDK will help you find
          > this
          > > easily.
          > >
          > > ---David "BAILOPAN" Anderson
          > > http://www.amxmodx.org/
          > >
          >
          >
          >




          ____________________________________________________________________________________
          Be a PS3 game guru.
          Get your game face on with the latest PS3 news and previews at Yahoo! Games.
          http://videogames.yahoo.com/platform?platform=120121
        Your message has been successfully submitted and would be delivered to recipients shortly.