Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shared Item Detection
#1
Shared Item Detection

This code aims to detect when a player tries to obtain a Shared Item, but the item they intended to cheat is not available. It will display the slot of the player who received the No Item value (0x14) in the milliseconds of the timer. Due the nature of the No Item value, this is not 100% accurate, as it can happen legitimately. This is meant to gauge the amount of occurrences in attempt to out suspicious players. It is impossible to detect a successfully cheated item as it looks identical to one legitimately received. This will not work for God Code. Finally, the code can be modified to detect other types of hacked items, if anyone wishes to add onto it.

(NTSC-U)
C265EE14 0000000E
9421FFB0 BDC10008
88030001 1D960010
3D8C8168 980C0150
8A230002 1D960010
3D8C8168 9A2C0151
8A430003 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608053 627310A0
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
C265EE30 0000000E
9421FFB0 BDC10008
88100011 1D960010
3D8C8168 980C0150
8A300012 1D960010
3D8C8168 9A2C0151
8A500013 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608053 627310A0
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
2834XXXX YYYYZZZZ
045310A0 80A10024
E0000000 80008000

(PAL)
C265E18C 0000000E
9421FFB0 BDC10008
88030001 1D960010
3D8C8168 980C0150
8A230002 1D960010
3D8C8168 9A2C0151
8A430003 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608053 62735BE8
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
C265E1A8 0000000E
9421FFB0 BDC10008
88100011 1D960010
3D8C8168 980C0150
8A300012 1D960010
3D8C8168 9A2C0151
8A500013 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608053 62735BE8
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
2834XXXX YYYYZZZZ
04535BE8 80A10024
E0000000 80008000

(NTSC-J)
C265D7F8 0000000E
9421FFB0 BDC10008
88030001 1D960010
3D8C8168 980C0150
8A230002 1D960010
3D8C8168 9A2C0151
8A430003 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608053 62735568
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
C265D814 0000000E
9421FFB0 BDC10008
88100011 1D960010
3D8C8168 980C0150
8A300012 1D960010
3D8C8168 9A2C0151
8A500013 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608053 62735568
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
2834XXXX YYYYZZZZ
04535568 80A10024
E0000000 80008000

(NTSC-K)
C264C4A4 0000000E
9421FFB0 BDC10008
88030001 1D960010
3D8C8168 980C0150
8A230002 1D960010
3D8C8168 9A2C0151
8A430003 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608052 62733C40
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
C264C4C0 0000000E
9421FFB0 BDC10008
88100011 1D960010
3D8C8168 980C0150
8A300012 1D960010
3D8C8168 9A2C0151
8A500013 1D960010
3D8C8168 9A4C0152
2C120007 40820024
2C000014 4082001C
3E608052 62733C40
3EA038A0 62B50000
7EB5B214 92B30000
B9C10008 38210050
60000000 00000000
2833XXXX YYYYZZZZ
04523C40 80A10024
E0000000 80008000



# Source

# Handshake values
# 1 - Item player wants # This can be used to out players using Shared Items in impossible positions
# 2 - Item player will receive
# 3 -
# 4 - Ready to fire triple items
# 5 -
# 6 - Ready to fire single item
# 7 - No Item Available

# 8065D7F8 (NTSC-J) - Local Player's ITEM Record
# 0(r3) = Start time of item
# 1(r3) = Local Player's Held Item
# 2(r3) = Local Player's Trailed Item
# 3(r3) = Activation Mode
# r22 = Local Player's Slot

stwu r1, -80(r1) # Make space for 18 registers
stmw r14, 8(r1) # Push r14-r31 onto the stack

lbz r0, 1(r3) # Load the byte in address in r3 offset by 1 and store it in r0
mulli r12, r22, 16 # Multiply the value in r22 (Local Player's Slot) by 16 and place the lower 32 bits of the result in r12
subis r12, r12, 32408 # Subtract the value in r12 by 32408, then shift r12 16 bits to the left and store the result in r12
stb r0, 336(r12) # Store the byte in r0 (Local Player's Held Item) to the address in r12 offset by 336

lbz r17, 2(r3) # Load the byte in address in r3 offset by 2 and store it in r17
mulli r12, r22, 16 # Multiply the value in r22 (Local Player's Slot) by 16 and place the lower 32 bits of the result in r12
subis r12, r12, 32408 # Subtract the value in r12 by 32408, then shift r12 16 bits to the left and store the result in r12
stb r17, 337(r12) # Store the byte in r17 (Local Player's Trailed Item) to the address in r12 offset by 337

lbz r18, 3(r3) # Load the byte in address in r3 offset by 3 and store it in r18
mulli r12, r22, 16 # Multiply the value in r22 (Local Player's Slot) by 16 and place the lower 32 bits of the result in r12
subis r12, r12, 32408 # Subtract the value in r12 by 32408, then shift r12 16 bits to the left and store the result in r12
stb r18, 338(r12) # Store the byte in r18 (Activation Mode) to the address in r12 offset by 338

cmpwi r18, 0x7 # Compare the word in r16 (Activation Mode) to 0x7
bne- branch_not_phase_7_handshake

cmpwi r0, 0x14 # Compare the word in r0 (Local Player's Held Item) to 0x14
bne- branch_item_available

lis r19, 0x8053 # Set the higher 16 bits of r19 to 0x8053
ori r19, r19, 0x5568 # Set the lower 16 bits of r19 to 0x5568
lis r21, 0x38A0 # Set the higher 16 bits of r21 to 0x38A0
ori r21, r21, 0x0000 # Set the lower 16 bits of r21 to 0x0000
add r21, r21, r22 # Add the value in r21 (Millisecond Display Modifier) to the value in r22 (Local Player's Slot), and store the result in r21
stw r21, 0(r19) # Store the word in r21 (Millisecond Display Modifier) to the address in r19

branch_not_phase_7_handshake:

branch_item_available:

lmw r14, 8(r1) # Pop r14-r31 off the stack
addi r1, r1, 80 # Release the space


# 8065D814 (NTSC-J) -  Players ITEM Record
# 16(r16) = Start time of item
# 17(r16) = Held Item
# 18(r16) = Trailed Item
# 19(r16) = Activation Mode
# r22 = Player Slot

stwu r1, -80(r1) # Make space for 18 registers
stmw r14, 8(r1) # Push r14-r31 onto the stack

lbz r0, 17(r16)  # Load the byte in address in r16 offset by 17 and store it in r0
mulli r12, r22, 16 # Multiply the value in r22 (Player Slot) by 16 and place the lower 32 bits of the result in r12
subis r12, r12, 32408 # Subtract the value in r12 by 32408, then shift r12 16 bits to the left and store the result in r12
stb r0, 336(r12) # Store the byte in r0 (Player's Held Item) to the address in r12 offset by 336

lbz r17, 18(r16) # Load the byte in address in r16 offset by 18 and store it in r17
mulli r12, r22, 16 # Multiply the value in r22 (Player Slot) by 16 and place the lower 32 bits of the result in r12
subis r12, r12, 32408 # Subtract the value in r12 by 32408, then shift r12 16 bits to the left and store the result in r12
stb r17, 337(r12) # Store the byte in r17 (Player's Trailed Item) to the address in r12 offset by 337

lbz r18, 19(r16) # Load the byte in address in r16 offset by 19 and store it in r18
mulli r12, r22, 16 # Multiply the value in r22 (Player Slot) by 16 and place the lower 32 bits of the result in r12
subis r12, r12, 32408 # Subtract the value in r12 by 32408, then shift r12 16 bits to the left and store the result in r12
stb r18, 338(r12) # Store the byte in r18 (Activation Mode) to the address in r12 offset by 338

cmpwi r18, 0x7 # Compare the word in r16 (Activation Mode) to 0x7
bne- branch_not_phase_7_handshake

cmpwi r0, 0x14 # Compare the word in r0 (Player's Held Item) to 0x14
bne- branch_item_available

lis r19, 0x8053 # Set the higher 16 bits of r19 to 0x8053
ori r19, r19, 0x5568 # Set the lower 16 bits of r19 to 0x5568
lis r21, 0x38A0 # Set the higher 16 bits of r21 to 0x38A0
ori r21, r21, 0x0000 # Set the lower 16 bits of r21 to 0x0000
add r21, r21, r22 # Add the value in r21 (Millisecond Display Modifier) to the value in r22 (Player Slot), and store the result in r21
stw r21, 0(r19) # Store the word in r21 (Millisecond Display Modifier) to the address in r19

branch_not_phase_7_handshake:

branch_item_available:

lmw r14, 8(r1) # Pop r14-r31 off the stack
addi r1, r1, 80 # Release the space



Notes:
- The milliseconds of the timer show the slot of the player who received the No Item Available (0x14) value.
- The deactivator at the bottom is meant to reset the timer after a detection, make sure to use an Inclusive activator. (FFFF - YYYY = ZZZZ)
- If the timer does not reset after hitting the deactivator, wait until the player uses their Mushroom and try again.
- If multiple players obtain the No Item value at once, the higher player slot will be displayed.

The code is not affected by:
- Mushroom Glitch

The code is affected by:
- Mushrooms Only Code

Code Creator: Star
Code Credits: Bully@Wiiplaza (USB Gecko Item Spy, Millisecond Display Modifier)
Reply
#2
Updated in regard to register safety.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)