The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 795 errorHandler->error





Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests
10-10-2013, 03:14 AM (This post was last modified: 10-10-2013 03:24 AM by dlanor.)
Post: #1
Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests
As stated in the title, I've found a bug in CwCheat.cpp of the latest master repository (downloaded 2013-10-10 05:57 AM).
It isn't a new bug, but has been with us for many beta builds.
(I'm not sure exactly how far back it goes.)

The bug causes all Exxxxxxx codes to be interpreted as 16-bit tests, even when it is in fact an E1xxxxxx code, which should be interpreted as 8-bit.

The significant section of the code is:
Code:
            case 0xE: // Test commands, multiple skip
                {
                    bool is8Bit = (comm >> 24) == 0x1;

The problem with this is that (comm >> 24) will be 0xE1 for 8-bit usage, not 0x1 as the code above assumes.

As I see it this needs to be changed into either one of two forms:
Code:
            case 0xE: // Test commands, multiple skip
                {
                    bool is8Bit = ((comm >> 24) & 0x0F) == 0x1;

Or achieving the same result by a different method:
Code:
            case 0xE: // Test commands, multiple skip
                {
                    bool is8Bit = (comm >> 24) == 0xE1;

The latter form may be marginally faster, but only by a very tiny amount.

Best regards: dlanor
Find all posts by this user
Thread Closed 


Messages In This Thread
Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests - dlanor - 10-10-2013 03:14 AM

Forum Jump: