Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How do I find a hex string  (Read 9098 times)

0 Members and 1 Guest are viewing this topic.

caltroon

    Topic Starter


    Greenhorn

    • Experience: Experienced
    • OS: Windows 7
    How do I find a hex string
    « on: July 25, 2017, 12:32:50 PM »
    I want to "cheat" on an old DOS game.  The cheats can be found at 00004F0B, OC, OD and OE also 00004AA3, 4, 5, 6 and 00004A8E, F, 90 and 91 and 00001A14:     I have a hex editor and can clearly view the exe file but the numbers end in 10, 20, 30 etc.  How do I find, for example, 00004F0B if all I see is 00004F00 and then the next line shows 00004F10, then 4F20, etc.  Is there a way I'm supposed to count into the string?

    Thank you for any help you can give.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: How do I find a hex string
    « Reply #1 on: July 25, 2017, 01:15:13 PM »
    Editing old COM files was something done years ago. But the use of 16 bit COM programs is not a good idea with modern versions of Windows.
    Anyway, if you don't already know how it is done, it is not easy to teach somebody how to do it. The methods are not reliable noways.
    If the program is an EXE, it is very, very hard to edit.


    caltroon

      Topic Starter


      Greenhorn

      • Experience: Experienced
      • OS: Windows 7
      Re: How do I find a hex string
      « Reply #2 on: July 25, 2017, 01:39:24 PM »
      Thank you for your response.  I know how to enter the correct values.  I just don't know how to find the hex values that I listed.   They must be somewhere in one of these lines below.

      [attachment deleted by admin to conserve space]

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: How do I find a hex string
      « Reply #3 on: July 25, 2017, 01:54:06 PM »
      What is the name of the hex editor you are using?
      The old standard thing was called 'DEBUG' and was once a part of the MS-DOS tool set. Here is some information you may find useful.

      https://www.computerhope.com/jargon/d/debug.htm
      Which links to:
      https://www.computerhope.com/debughlp.htm
      Which will send you to:
      https://www.computerhope.com/rdebug.htm
      You will need to read all, or most all of this  before you catch on to what it does and how it works.
      Here is a typical screen of what DEBUG  will show you.
      Code: [Select]
      C000:0040     00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00     ................
      C000:0050 E9 63 7B 00 B4 10 49 27 - E9 FE 2B E9 F7 2B 50 4D .c{...I'..+..+PM
      C000:0060 49 44 58 00 5B 00 00 00 - 00 A0 00 B0 00 B8 00 C0 IDX.[...........
      C000:0070 00 5B 53 54 42 20 6E 56 - 49 44 49 41 20 54 4E 54 .[STB nVIDIA TNT
      C000:0080 20 76 65 72 2E 20 31 2E - 31 30 20 0D 0A 00 1B 43 ver. 1.10 ....C
      C000:0090 6F 70 79 72 69 67 68 74 - 28 43 29 31 39 39 38 20 opyright(C)1998
      C000:00A0 53 54 42 20 53 79 73 74 - 65 6D 73 20 49 6E 63 0D STB Systems Inc.
      C000:00B0 0A 00 22 6C 2C 0A 01 00 - C3 50 24 7F E8 60 36 58 .."1,....P$..'6X
      For now, that is as much as I can do for you.

      caltroon

        Topic Starter


        Greenhorn

        • Experience: Experienced
        • OS: Windows 7
        Re: How do I find a hex string
        « Reply #4 on: July 25, 2017, 02:21:27 PM »
        Thank you.  I'm using HxD Hexeditor.  I used to do this back in the DOS and early Windows days using XTREE Gold, but I've forgotten how to read it.  I'll look up your links.

        Geek-9pm


          Mastermind
        • Geek After Dark
        • Thanked: 1026
          • Gekk9pm bnlog
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: How do I find a hex string
        « Reply #5 on: July 25, 2017, 06:07:08 PM »
        Ah, XTREE Gold. How I remember those days of yesteryear.
        https://en.wikipedia.org/wiki/XTree

        XTree is a file manager program originally designed for use under MS-DOS. It was published by Underwear Systems (later Executive Systems) and first released on 1 April 1985, and became highly popular.[1] The program uses a character-mode interface, which has many elements typically associated with a graphical user interface.

        In 1993, the XTree Company was sold to Central Point Software,[11] which was in turn acquired by Symantec in 1994,[12] and in 1995 production of XTree products was halted.

        Just Google XTREE and find a bunch of help about the program and how to get it and use it. The program may or may not work with current windows. You can check with any of the user groups that still love it.
        http://xtreefanpage.org/







        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: How do I find a hex string
        « Reply #6 on: July 25, 2017, 06:48:05 PM »
        The Numbers are byte offsets into the file. Most Hex editors show groups of 16 or 32 bytes per line. Hexadecimal values are simply numbers. Instead of 0 through 9, the digits are 0 through F (9+1 is A, 9+2 is B, etc)

        If a line is labelled 00004F00 and the next is labelled 00004F10, then there are 16 bytes shown and 00004F0B is the 11th. (B in hexadecimal is 11 in decimal). For example if the Hex editor shows:

        Code: [Select]
        00004F10  E8 83 B8 15 15 78 67 92 0D E1 81 3C 25 AF 70 A4
        Then 00004F1B is 81, 00004F1C is 3C, 00004F1D is 25, until A4 which is 00004F1F and then 00004F20 starts on the next line.
        I was trying to dereference Null Pointers before it was cool.

        caltroon

          Topic Starter


          Greenhorn

          • Experience: Experienced
          • OS: Windows 7
          Re: How do I find a hex string
          « Reply #7 on: July 27, 2017, 08:35:15 AM »
          Thank you - this is exactly what I was looking for.

          caltroon

            Topic Starter


            Greenhorn

            • Experience: Experienced
            • OS: Windows 7
            Re: How do I find a hex string
            « Reply #8 on: July 27, 2017, 10:10:05 AM »
            One more question.  This are a couple of changes I want to make:

            00004FOB:  28 90
            00004F0C:  06 90
            00004F0D:  ED 90
            00004F0E:  08 90
            00004AA3:  8B B9
            00004AA4:  0E 0A

            But you show only one change per number.  You showed 00004F1B is 81 as an example.  So how would I put two numbers in there?  Below is a line of the code that I believe you're talking about:
            00004F00:   FD E9 08 02 2E 80 7C 05 7F 74 22 2E 80 7C 05 7E

            also there's a change that says set 0X00246e =9         What does that mean and where would I find it?  I really appreciate the help!

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: How do I find a hex string
            « Reply #9 on: July 27, 2017, 07:02:35 PM »
            the way the changes are specified are either nonsense, not a byte offset, or could be little endian, which means you'd flip them around halfway.

            offset 0X00246e would be  0000246e. but that's a programming notation. Where is this information from?
            I was trying to dereference Null Pointers before it was cool.

            caltroon

              Topic Starter


              Greenhorn

              • Experience: Experienced
              • OS: Windows 7
              Re: How do I find a hex string
              « Reply #10 on: July 27, 2017, 07:17:50 PM »
              It's a really old DOS computer game called captain comic 2.  i bought it back when shareware was the big thing.  I think we're talking about even before windows 3.1!  I know I have it on 5.25 disks but copied it to flash drives and cds long ago.   It's a really cute game but I keep getting killed!

              BC_Programmer


                Mastermind
              • Typing is no substitute for thinking.
              • Thanked: 1140
                • Yes
                • Yes
                • BC-Programming.com
              • Certifications: List
              • Computer: Specs
              • Experience: Beginner
              • OS: Windows 11
              Re: How do I find a hex string
              « Reply #11 on: July 27, 2017, 07:32:01 PM »
              No, where is the information about the changes you want to make from?
              I was trying to dereference Null Pointers before it was cool.

              caltroon

                Topic Starter


                Greenhorn

                • Experience: Experienced
                • OS: Windows 7
                Re: How do I find a hex string
                « Reply #12 on: July 27, 2017, 08:56:49 PM »
                The game exe file

                BC_Programmer


                  Mastermind
                • Typing is no substitute for thinking.
                • Thanked: 1140
                  • Yes
                  • Yes
                  • BC-Programming.com
                • Certifications: List
                • Computer: Specs
                • Experience: Beginner
                • OS: Windows 11
                Re: How do I find a hex string
                « Reply #13 on: July 27, 2017, 10:35:49 PM »
                The game exe file is what you want to change. Where did you find the information about what you needed to change? Basically Where did you find these "cheats"?

                it occurs to me that perhaps it is being specified and telling you the value you will find there and what you need to replace it with.
                I was trying to dereference Null Pointers before it was cool.

                caltroon

                  Topic Starter


                  Greenhorn

                  • Experience: Experienced
                  • OS: Windows 7
                  Re: How do I find a hex string
                  « Reply #14 on: July 28, 2017, 08:28:49 AM »

                  BC_Programmer


                    Mastermind
                  • Typing is no substitute for thinking.
                  • Thanked: 1140
                    • Yes
                    • Yes
                    • BC-Programming.com
                  • Certifications: List
                  • Computer: Specs
                  • Experience: Beginner
                  • OS: Windows 11
                  Re: How do I find a hex string
                  « Reply #15 on: July 28, 2017, 12:21:53 PM »
                  I'm guessing the ones giving two numbers indicate the current value with the first of the pair. So "00004F0B: 28 90" means the current value is 28 and it should be 90.
                  I was trying to dereference Null Pointers before it was cool.

                  caltroon

                    Topic Starter


                    Greenhorn

                    • Experience: Experienced
                    • OS: Windows 7
                    Re: How do I find a hex string
                    « Reply #16 on: July 28, 2017, 12:55:44 PM »
                    Oh of course, that makes sense!  Thank you.