ROM Hack Cheat Codes AMS and Sx Os, Add and Request

  • Thread starter Thread starter matias3ds
  • Start date Start date
  • Views Views 24,452,141
  • Replies Replies 73,620
  • Likes Likes 249
anyone have any luck with a working 60 fps mod for
DRAGON QUEST VII Reimagined 1.1.0
TID: 0100A9D01C446000
BID: AB06020960EDD828
im using eden and cant seem to get 60fps to work correct
[Credits for this goes to: Az91.]

{Master Code}
08000000 04F8EA70 2A0D03F7 52A88F4D
08000000 04F8EA20 B9001AC8 52807088
08000000 04F8EA50 B9011A75 52807CF5
04000000 04F8EA78 16EAC878
04000000 04F8EA28 16E93C17
04000000 04F8EA58 16E3CD3F
04000000 04F8EA64 B9011676
04000000 04F8EA68 16FADE54
04000000 00E463B4 B9011676
04000000 00881F50 B9011A75
04000000 00A71A54 0B140101
04000000 009DDA80 B9001AC8
04000000 00A40C54 0B1701B7

[HP]
80000100
04000000 00E463B4 150521AB
04000000 04F8EA60 52807CF6
20000000

[OHK]
80000200
04000000 00E463B4 150521AB
04000000 04F8EA60 52800016
20000000

[MP]
04000000 00881F50 151C32C0

[XP x4]
04000000 00A40C54 0B1709B7

[XP x16]
04000000 00A40C54 0B1711B7

[XP x64]
04000000 00A40C54 0B1719B7

[Max XP]
04000000 00A40C54 15153787

[Coin x4]
04000000 00A71A54 0B140901

[Coin x16]
04000000 00A71A54 0B141101

[Coin x64]
04000000 00A71A54 0B141901

[Items 900]
04000000 009DDA80 1516C3E8


-----------------------Additional Code --------------------------

[Inf.Gold]
580F0000 07288C58
580F1000 000001C8
780F0000 000000C8
640F0000 00000000 0098967F

[Hero Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000000
780F0000 00000110
610F0000 00000000 00000063

[Maribel Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000008
780F0000 00000110
610F0000 00000000 00000063

[Kiefer Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000010
780F0000 00000110
610F0000 00000000 00000063

[Ruff Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000018
780F0000 00000110
610F0000 00000000 00000063

[Hero Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000000
780F0000 00000114
680F0000 0001869F 0001869F

[Maribel Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000008
780F0000 00000114
680F0000 0001869F 0001869F

[Kiefer Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000010
780F0000 00000114
680F0000 0001869F 0001869F

[Ruff Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000018
780F0000 00000114
680F0000 0001869F 0001869F

[Hero Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000000
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Maribel Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000008
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Kiefer Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000010
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Ruff Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000018
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Inf.Items]
04000000 00A7806C B9401A61
04000000 00A7806C 15145A65
04000000 04F8EA00 18000061
04000000 04F8EA04 B9001A61
04000000 04F8EA08 16EBA59A
04000000 04F8EA0C 00000063
 
[Credits for this goes to: Az91.]

{Master Code}
08000000 04F8EA70 2A0D03F7 52A88F4D
08000000 04F8EA20 B9001AC8 52807088
08000000 04F8EA50 B9011A75 52807CF5
04000000 04F8EA78 16EAC878
04000000 04F8EA28 16E93C17
04000000 04F8EA58 16E3CD3F
04000000 04F8EA64 B9011676
04000000 04F8EA68 16FADE54
04000000 00E463B4 B9011676
04000000 00881F50 B9011A75
04000000 00A71A54 0B140101
04000000 009DDA80 B9001AC8
04000000 00A40C54 0B1701B7

[HP]
80000100
04000000 00E463B4 150521AB
04000000 04F8EA60 52807CF6
20000000

[OHK]
80000200
04000000 00E463B4 150521AB
04000000 04F8EA60 52800016
20000000

[MP]
04000000 00881F50 151C32C0

[XP x4]
04000000 00A40C54 0B1709B7

[XP x16]
04000000 00A40C54 0B1711B7

[XP x64]
04000000 00A40C54 0B1719B7

[Max XP]
04000000 00A40C54 15153787

[Coin x4]
04000000 00A71A54 0B140901

[Coin x16]
04000000 00A71A54 0B141101

[Coin x64]
04000000 00A71A54 0B141901

[Items 900]
04000000 009DDA80 1516C3E8


-----------------------Additional Code --------------------------

[Inf.Gold]
580F0000 07288C58
580F1000 000001C8
780F0000 000000C8
640F0000 00000000 0098967F

[Hero Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000000
780F0000 00000110
610F0000 00000000 00000063

[Maribel Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000008
780F0000 00000110
610F0000 00000000 00000063

[Kiefer Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000010
780F0000 00000110
610F0000 00000000 00000063

[Ruff Lv99]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000018
780F0000 00000110
610F0000 00000000 00000063

[Hero Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000000
780F0000 00000114
680F0000 0001869F 0001869F

[Maribel Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000008
780F0000 00000114
680F0000 0001869F 0001869F

[Kiefer Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000010
780F0000 00000114
680F0000 0001869F 0001869F

[Ruff Inf.HP&MP]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000018
780F0000 00000114
680F0000 0001869F 0001869F

[Hero Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000000
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Maribel Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000008
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Kiefer Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000010
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Ruff Max HP&MP&Status]
580F0000 07288C58
580F1000 000001C8
580F1000 000000E8
580F1000 00000018
780F0000 0000056C
30000000 0000000B
640F0000 00000000 0001869F
780F0000 00000004
31000000

[Inf.Items]
04000000 00A7806C B9401A61
04000000 00A7806C 15145A65
04000000 04F8EA00 18000061
04000000 04F8EA04 B9001A61
04000000 04F8EA08 16EBA59A
04000000 04F8EA0C 00000063
How good we are at copying and stealing other people's cheats,the additional codes(only a part)they are copied from here
 
didn't realize there was another update to Hollow Knight Silksong. So here updated my codes for 1.0.29354
https://github.com/Arch9SK7/MyNXChe.../010013C00E930000/cheats/1D71738C36145136.txt

and notes.txt for them https://github.com/Arch9SK7/MyNXChe...ht Silksong/010013C00E930000/cheats/notes.txt

Here is updated cheatLib.py
Python:
# This script was made by Eiffel2018, updated and modified for new ida and features by OblivionReign
import idc, ida_bytes, ida_search, struct, idautils, sys, ida_kernwin, ida_funcs, idaapi, ida_segment, math, os, ida_nalt, re
from idahelper import *
from keystone import *

SetDebug(True)
cheatCodes = masterCodes = restoreCodes = ''
# --- NOTES VARIABLES ---
noteDict = {}       # Stores notes waiting to be formatted
finalNoteStr = ''   # Stores the final formatted string for the text file
# -----------------------

# --- FORMAT VARIABLES ---
isBreeze = False    # Tracks if user selected Breeze format
section_stack = []  # Tracks nested sections for Breeze
# ------------------------

english=''
is32bit=False
TID=BID=VER = RGN = None
TM='A'
TM2='F'

dataAddr = BADADDR if isGDB() else ida_segment.get_segm_by_name('.bss').end_ea
            
def SetAsmRegister(register):
    global TM
    TM = register
def SetPtrRegister(register):
    global TM2
    TM2 = register

def Addr2DWord(opAddr):
    return "{:08X}".format(opAddr & 0xFFFFFFFF)
def Value2DWord(value):
    if type(value) is str: value=int(value.replace(' ',''), 16)
    return "{:08X}".format(value & 0xFFFFFFFF)
def Value2QWord(value):
    if type(value) is str: value=int(value.replace(' ',''), 16)
    return "{:08X} {:08X}".format(value // 0x100000000, value & 0xFFFFFFFF)
def Double2QWord(d):
    return Value2QWord(struct.unpack('<Q', struct.pack('<d', d))[0])
def Float2DWord(f):
    return Value2DWord(struct.unpack('<I', struct.pack('<f', f))[0])
def Char2DwordList(s):
    i=0
    result=[]
    while i<len(s): 
        result.append(int(''.join('%02X'%ord(x) for x in reversed(s[i:i+4])),16))
        i+=4
    return result
def Char2QwordList(s):
    i=0
    result=[]
    while i<len(s): 
        result.append(int(''.join('%02X'%ord(x) for x in reversed(s[i:i+8])),16))
        i+=8
    return result
def CheatCode(length,opAddr,value):
    if opAddr>base and base>0x10000000: opAddr-=base
    if type(value) not in (list,tuple):
        if type(value) is str and re.match(r"^[0-9a-fA-F]{8}$", value[0:8]) is None: value=ASM(value) 
        # if type(value) is int and length==4: value=Value2DWord(value)
        return '0{}0A0000 {} {}\n'.format(length,Addr2DWord(opAddr),Value2DWord(value) if length<=4 else Value2QWord(value))
    lastInstruction = ResultCode = ''
    for instruction in value:
        if type(instruction) is str: instruction=instruction.replace('{there}',OperandAddr(opAddr)).replace('{here}',hex(opAddr))
        if type(instruction) is str and re.match(r"^[0-9a-fA-F]{8}$", instruction[0:8]) is None: instruction=ASM(instruction) 
        if type(instruction) is int: instruction=Value2DWord(instruction)
        if lastInstruction=='':
            lastInstruction = instruction
        else:
            ResultCode += CheatCode(8,opAddr-4,instruction+lastInstruction)
            lastInstruction = ''
        opAddr+=4
    if (lastInstruction != ''): ResultCode += CheatCode(4,opAddr-4,lastInstruction)
    return ResultCode
def RestoreCode(length,opAddr):
    if isGDB(): return ''
    if length>=8: return CheatCode(length,opAddr,[ 0 if (opAddr+i>=GetCodeK() and opAddr+i<codeEnd) else (ida_bytes.get_dword(opAddr+i)) for i in range(0,length,4) ]) # IDA 9.2 Update
    return CheatCode(length,opAddr,0 if (opAddr>=GetCodeK() and opAddr<codeEnd) else (GetBytes(length,opAddr) if length<=4 else GetQword(opAddr)))
    
def PointerCodeHeader(offsets,register=None,length=8): # offsets use tuples/list with at least 2 element
    if isGDB(): return ''
    if register == None: register = TM2
    if type(offsets) not in (tuple, list): offsets=[offsets]
    code = '5{}0{}0000 {:08X}\n'.format(length,register,offsets[0])
    if len(offsets)>1: code += PointerCodeAddOffset(offsets[1:],register)
    return code
def PointerCodeReadOffset(offset,register=None,length=8):
    return PointerCodeAddOffset(offset,register,length)
def PointerCodeAddOffset(offsets,register=None,length=8):
    if isGDB(): return ''
    if register == None: register = TM2
    if type(offsets) not in (tuple, list): offsets=[offsets]
    if len(offsets)<1: return ''
    code=''
    if len(offsets)>1:
        for offset in offsets[:-1]: 
            code += '5{}0{}1000 {:08X}\n'.format(8,register,offset)
    code += '5{}0{}1000 {:08X}\n'.format(length,register,offsets[-1])
    return code
def PointerCodeAddRegister(offset,register=None):
    if isGDB(): return ''
    return '780{}0000 {:08X}\n'.format(register,offset) if offset>=0 else '780{}1000 {:08X}\n'.format(register,-offset)
def PointerCodeSetValue(value,register='D',length=8):
    if isGDB(): return ''
    return '4{}0{}0000 {}\n'.format(length,register,Value2QWord(value))
def PointerCodeWrite(length, value, value2=None, register=None, use_D=True, increase=False):
    if use_D==True: use_D='D'
    if isGDB(): return ''
    if register == None: register = TM2
    if value2!=None and length==8: 
        code = '6{}0{}{}{}0 {} {}\n'.format(length, register,'1' if increase else '0','1'+use_D if use_D!=False else '00',Value2DWord(value2), Value2DWord(value))
    else:
        code = '6{}0{}{}{}0 {}\n'.format(length, register,'1' if increase else '0', '1'+use_D if use_D!=False else '00', Value2QWord(value))
    return code
def PointerCodeBody(offset, length, value, value2=None, register=None):
    if isGDB(): return ''
    if register == None: register = TM2
    return PointerCodeSetValue(offset) + PointerCodeWrite(length, value, value2, register)
def PointerCodeArithmetic(operater,r0=None,r1=None,r2=None,length=8): # Code Type 0x9
    if isGDB(): return ''
    if r0 == None: r0 = TM2
    if r1 == None: r1 = TM2
    operations = {'+':'0', '-':'1', '*':'2', '<<':'3', '>>':'4', 'and':'5', 'or':'6', 'not':'7', 'xor':'8', 'mov':'9'}
    if r2==None or type(r2) is str: # 9TCRS0s0
        if r2==None: r2='0'
        result = '9{}{}{}{}0{}0\n'.format(length,operations[operater.lower()],r0,r1,r2)
    else: # 9TCRS100 VVVVVVVV 
        result = '9{}{}{}{}100 {}\n'.format(length,operations[operater.lower()],r0,r1, Value2DWord(r2) if length<8 else Value2QWord(r2))
    return result
def PointerCodeStoreRegisterValueToRegisterAddress(valueRegister='D', addrRegister=None, length=4, offset=0, increase=False): # Code Type 0xA  A4SR1000
    if isGDB(): return ''
    if addrRegister == None: addrRegister = TM2
    if offset==0:
        return 'A{}{}{}{}000\n'.format(length,valueRegister, addrRegister, 1 if increase else 0) 
    elif type(offset) is str:
        return 'A{}{}{}{}1{}0\n'.format(length,valueRegister, addrRegister, 1 if increase else 0, offset)
    else:
        return 'A{}{}{}{}200 {}\n'.format(length,valueRegister, addrRegister, 1 if increase else 0, Value2DWord(offset)) # seem buggy
def PointerCodeStoreRegisterValueToMemoryAddress(valueRegister=None, addr='B', length=4, offset=None, increase=False): # Code Type 0xA
    if isGDB(): return ''
    if valueRegister == None: valueRegister = TM2
    if type(addr) is str and offset==None:
        return 'A{}{}{}{}300\n'.format(length, valueRegister, addr, 1 if increase else 0)
    elif type(addr) is not str:
        return 'A{}{}0{}400 {:08X}\n'.format(length, valueRegister, 1 if increase else 0, addr)
    else:
        return 'A{}{}{}{}500 {:08X}\n'.format(length, valueRegister, addr, 1 if increase else 0, offset)
def PointerCodeCopyRegister(dest, source): 
    if isGDB(): return ''
    return PointerCodeArithmetic('mov', dest, source)
def PointerCodeCondition(register,condition,value,length=4):
    if isGDB(): return ''
    Conditions={'>':'1', '>=':'2', '<':'3', '<=':'4', '==':'5', '=':'5', '!=':'6'}
    if type(value) is str and len(value)==1:
        return 'C0{}{}{}5{}0\n'.format(length,Conditions[condition],register,value)
    else:
        return 'C0{}{}{}400 {}\n'.format(length,Conditions[condition],register,Value2DWord(value) if length<8 else Value2QWord(value))
def PointerCodeEndBlock():
    if isGDB(): return ''
    return '20000000\n'
def PointerCodeElseBlock():
    if isGDB(): return ''
    return '21000000\n'
def PointerCodeStartLoop(size,register='C'):
    if isGDB(): return ''
    return '300{}0000 {:08X}\n'.format(register,size)
def PointerCodeEndLoop(register='C'):
    if isGDB(): return ''
    return '310{}0000\n'.format(register)
def PointerHack(offsets,values,length=4,useButton=None,default=None,appendCodes=None):
    if isGDB(): return ''
    codes=PointerCodeHeader(offsets[:-1])
    if offsets[-1]>0: codes+=PointerCodeAddRegister(offsets[-1])
    if type(values) not in (tuple, list): values=[values]
    finalCode=''
    useCombine=length==4 and len(values)>=2
    if useCombine: 
        idx=0
        while idx+1<len(values):
            finalCode+=PointerCodeWrite(8,values[idx],values[idx+1],use_D=False,increase=True)
            idx+=2
        if idx<len(values):
            finalCode+=PointerCodeWrite(4,values[idx],use_D=False,increase=True)
    else:
        for value in values:
            finalCode+=PointerCodeWrite(length,value,use_D=False,increase=True)
    if appendCodes!=None: finalCode+=appendCodes
    defaultCode = '' if default==None else PointerCodeWrite(length,default,use_D=False)
    if useButton != None: finalCode= defaultCode + ButtonCode(useButton,finalCode)
    AddCheatCode(codes+finalCode)
def PointerCopyValue(dest,source,length=4):
    common = []
    for idx in range(len(source)):
        if source[idx]!=dest[idx]: break
        common.append(source[idx])
    if len(common)==0: 
        codes = PointerCodeHeader(source[:-1],'F') 
        codes += PointerCodeHeader(dest[:-1],'A') 
    else:
        codes = PointerCodeHeader(common,'F') 
        codes += PointerCodeCopyRegister('A','F')
        codes += PointerCodeAddOffset(source[len(common):-1],'F')
        codes += PointerCodeAddOffset(dest[len(common):-1],'A')
    if length<=8:
        codes += PointerCodeReadOffset(source[-1],'F',length)
        codes += PointerCodeStoreRegisterValueToRegisterAddress('F', 'A', length, dest[-1])
    else:
        codes += PointerCodeCopyRegister('B','F')
        sourceoffset=source[-1]
        while length>0:
            codes += PointerCodeReadOffset(sourceoffset,'F',length if length<8 else 8)
            codes += PointerCodeStoreRegisterValueToRegisterAddress('F', 'A', length if length<8 else 8, dest[-1], increase=True)
            sourceoffset+=8
            length-=8
            if length>0: codes += PointerCodeCopyRegister('F','B')
    AddCheatCode(codes)
def PointerFillRange(basePointer, maxSize, value, length=4, condition=None, conditionValue=None):
    codes = PointerCodeHeader(basePointer[:-1],'F')
    if basePointer[-1]!=0: codes += PointerCodeAddRegister(basePointer[-1],'F')
    codes += PointerCodeStartLoop(maxSize)
    if condition!=None and conditionValue!=None:
        codes += PointerCodeCopyRegister('B','F')
        codes += PointerCodeReadOffset(0,'B',length)
        codes += PointerCodeCondition('B',condition,conditionValue,length)
    codes += PointerCodeWrite(length, value, None, 'F', use_D=False, increase=True)
    if condition!=None and conditionValue!=None: 
        codes += PointerCodeElseBlock()
        codes += PointerCodeAddRegister(0x8,'F')
        codes += PointerCodeEndBlock()
    codes += PointerCodeEndLoop()
    AddCheatCode(codes)
def PointerFillArray(basePointer, maxSize, finalOffset, value, length=4, check=False, condition=None, conditionValue=None):
    codes = PointerCodeHeader(basePointer,'F')
    codes += PointerCodeAddRegister(0x18,'F')
    codes += PointerCodeSetValue(finalOffset,'D')
    if check:
        codes += PointerCodeCopyRegister('A','F')
        codes += PointerCodeReadOffset(0,'A',2)
    codes += PointerCodeStartLoop(maxSize)
    codes += PointerCodeAddRegister(0x8,'F')
    if check: 
        codes += PointerCodeCondition('A','>',0,2)
        codes += PointerCodeArithmetic('-','A','A',1,2)
    if condition!=None and conditionValue!=None:
        codes += PointerCodeCopyRegister('B','F')
        codes += PointerCodeReadOffset(finalOffset,'B',length)
        codes += PointerCodeCondition('B',condition,conditionValue,length)
    codes += PointerCodeCopyRegister('B','F')
    codes += PointerCodeAddOffset([0],'B')
    codes += PointerCodeWrite(length, value, None, 'B')
    if condition!=None and conditionValue!=None: 
        codes += PointerCodeEndBlock()
    if check: 
        codes += PointerCodeEndBlock()
    codes += PointerCodeEndLoop()
    AddCheatCode(codes)
def ButtonCode(key,code=None,elseCode=None): # note: the ElseCode is not supported by Yuzu currently 
    if isGDB(): return ''
    
    if isEMU: return ''
    
    if type(key) in (tuple, list): key=MixButtons(key)
    keymap={'a':0x1,'b':0x2,'x':0x4,'y':0x8,'l3':0x10,'r3':0x20,'l':0x40,'r':0x80,'zl':0x100,'zr':0x200,'+':0x400,'-':0x800,'left':0x1000,'up':0x2000,'right':0x4000,'down':0x8000,'l3left':0x10000,'l3up':0x20000,'l3right':0x40000,'l3down':0x80000,'r3left':0x100000,'r3up':0x200000,'r3right':0x400000,'r3down':0x800000,'sl':0x1000000,'sr':0x2000000}
    if isinstance(key, str) and key.lower() in keymap: key=keymap[key.lower()]
    key=key & 0xFFFFFFF
    return '8{:07X}\n{}\n{}20000000\n'.format(key,code.strip('\n '),'' if elseCode==None else '21000000\n%s\n'%(elseCode.strip('\n '))) if code != None else '8%07X\n'%key
def MixButtons(keys):
    if isGDB(): return ''
    result=0
    for key in keys:
        result=result|int(ButtonCode(key),16)
    return result
def ConditionCode(length,opAddr,value,commands,otherwise=None):
    if isGDB(): return ''
    if type(value) is str and re.match(r"^[0-9a-fA-F]{8}$", value[0:8]) is None: value=ASM(value) 
    result = '1%d050000 %s %s\n%s'%(length,Addr2DWord(opAddr),Value2DWord(value) if length<=4 else Value2QWord(value),commands)
    if otherwise != None: result += '21000000\n%s'%(otherwise)
    result += '20000000\n'
    return result
def ToggleCode(button,length,opAddr,code1,code2=None):
    if isGDB(): return ''
    if code2==None: code2=RestoreCode(length,opAddr)
    return ButtonCode(button,ConditionCode(length,opAddr,code2,CheatCode(length,opAddr,code1),CheatCode(length,opAddr,code2)))
def ASM(asm_code):
    # IDA 9.2 Update: Corrected Keystone mode parameter
    ks = Ks(KS_ARCH_ARM if is32bit else KS_ARCH_ARM64, KS_MODE_ARM if is32bit else KS_MODE_LITTLE_ENDIAN)
    try:
        bytecode, cnt = ks.asm(asm_code, as_bytes=True)
    except:
        idaapi.warning("Error in code: %s"%asm_code)
        bytecode=b'FFFFFFFF'
    if bytecode is None: 
        idaapi.warning("Error in code: %s"%asm_code);
        return '????????'
    return ''.join(map('{:02X}'.format, reversed(bytecode)))
def isEMU():
    return isEMU;
def OperandAddr(addr):  # return something like "B.NE 0x12345678" become "B 0x12345678"
    if not isCode(addr): return '__ERROR__'
    # IDA 9.2 Update
    import ida_ua
    cmd = ida_ua.insn_t()
    if ida_ua.decode_insn(cmd, addr) == 0:
        return '__ERROR__'
    mnem = ida_ua.print_insn_mnem(addr).upper()
    
    operand_index = 1 
    if mnem in ('B', 'BL', 'B.CC', 'B.HI', 'B.GE', 'B.LE', 'B.EQ', 'B.NE', 'CBNZ', 'CBZ'):
        operand_index = 0
    elif mnem in ('TBZ', 'TBNZ'):
        operand_index = 2
    target_addr = idc.get_operand_value(addr, operand_index)
    return hex(target_addr - addr)
def Hack(pattern,codes,showRestoreCode=True,useButton=None,elseCode=None,returnCode=False,searchStart=codeStart,searchEnd=codeEnd):
    if isGDB(): return
    global cheatCodes, restoreCodes, masterCodes
    output=''
    cheatAddr=AOB(pattern,searchStart,searchEnd) if type(pattern) is str else pattern
    if notFound(cheatAddr): 
        idaapi.warning(cheatName+': AOB broken!\n%s'%(pattern if type(pattern) is str else hex(pattern)))
    else:
        if type(codes) is str and re.match(r"^[0-9a-fA-F]{8} $", codes[0:9]) is not None: codes=list(reversed(codes.split(' ')))
        if type(codes) is str or type(codes) is int: codes=[codes]
        length = len(codes)*4
        if showRestoreCode=='masterCodes': 
            masterCodes += RestoreCode(length,cheatAddr)
        elif showRestoreCode and useButton==None: 
            restoreCodes += RestoreCode(length,cheatAddr)
        output += CheatCode(length, cheatAddr, codes)
        if useButton != None: 
            if isEMU: return ''
            output=(RestoreCode(length,cheatAddr) if showRestoreCode and showRestoreCode!='masterCodes' else '') + ButtonCode(useButton,output,elseCode)
        if not returnCode: cheatCodes += output
    return output
def HackAll(pattern,codes,offset=0,showRestoreCode=True,useButton=None,elseCode=None,searchStart=codeStart,searchEnd=codeEnd,returnCode=False):
    if isGDB(): return
    global cheatCodes
    output=''
    cheatAddrs=AllOccur(pattern,offset,searchStart,searchEnd)
    if len(cheatAddrs)<1: 
        idaapi.warning(cheatName+': AOB broken!')
    else:
        if useButton != None and showRestoreCode and elseCode == None: 
            for cheatAddr in cheatAddrs: output += RestoreCode(len(codes)*4,cheatAddr)
        if useButton != None: output += ButtonCode(useButton) # Note: EMU cheat-vm does not support button activator on ASM codes
        for cheatAddr in cheatAddrs: output += Hack(cheatAddr, codes, useButton == None and showRestoreCode and elseCode == None, None, returnCode=True)
        if useButton != None and elseCode!=None: output += '21000000\n%s\n'%(elseCode.strip('\n '))
        if useButton != None: output += '20000000\n'
        if not returnCode: cheatCodes += output
    return output
def CodeFunc(codes,retAddr=None,targetAddr=None):
    global codeK
    if isGDB(): return
    ResultCode=lastInstruction=''
    end=GetCodeK()
    if type(codes) is str: idaapi.warning("Cannot be type of string: %s"%codes); return
    for instruction in reversed(codes):
        if type(instruction) is str: instruction = instruction.strip()
        if not instruction: continue
        codeK-=4
        if type(instruction) is int: instruction='%08X'%instruction
        
        instruction=instruction.replace('{here}',hex(codeK)).replace('{end}',hex(end-codeK)).replace('{start}',hex(end-len(codes)*4-codeK))
        
        if retAddr!=None: instruction=instruction.replace('{back}',hex(retAddr-codeK))
            
        if targetAddr!=None: instruction=instruction.replace('{there}',hex(targetAddr-codeK))
        
        if re.match(r"^[0-9a-fA-F]{8}$", instruction[0:8]) is None: instruction=ASM(instruction) 
        
        if lastInstruction=='':
            lastInstruction = instruction
        else:
            ResultCode += CheatCode(8,codeK,(lastInstruction)+(instruction))
            lastInstruction = ''
            
    if (lastInstruction != ''): ResultCode += CheatCode(4,codeK,(lastInstruction))
    return ResultCode
def CodeCave(cheatAddr, codes, showRestoreCode=True, use_BL=True, returnCode=False, data_size=0):
    if isGDB(): return ''
    global cheatCodes, masterCodes, restoreCodes, codeK
    output = CodeFunc(codes, cheatAddr + 4, idc.get_operand_value(cheatAddr, 0)) or ''
    asm_start_addr = GetCodeK() # GetCodeK() now holds the start of the instructions
    
    if not output:
        idaapi.warning(cheatName+': CodeCave assembly failed!')
        return ''
        
    if showRestoreCode=="masterCodes": 
        masterCodes += RestoreCode(4,cheatAddr)
    elif showRestoreCode: 
        restoreCodes += RestoreCode(4,cheatAddr)
        
    hook_jump = ('BL ' if use_BL else 'B ') + hex(asm_start_addr - cheatAddr)
    output += Hack(cheatAddr, hook_jump, False, None, returnCode=True) 

    if not returnCode: cheatCodes += output
    return output
def GetCodeK():
    if isGDB(): return BADADDR
    return codeK
def SetCodeK(addr):
    if isGDB(): return
    global codeK
    codeK=addr
def RegCodeK(size=4):
    if isGDB(): return BADADDR
    global codeK
    codeK-=size
    return codeK
def RegData(assignValue,size=4): 
    if isGDB(): return ''
    if type(assignValue) in (tuple, list): size=size*len(assignValue)
    return CheatCode(size,RegCodeK(size),assignValue)

def DefineWriteableAddress(size=4):
    if isGDB(): return BADADDR
    global dataAddr
    dataAddr-=size
    return dataAddr
def Either(aob1,aob2):
    if isGDB(): return
    if type(aob1) is str: aob1=AOB(aob1)
    if type(aob2) is str: aob2=AOB(aob2)
    return aob1 if isFound(aob1) else aob2
def GetADRP(addr):
    if notFound(addr): return BADADDR
    # IDA 9.2 Update
    register = idc.get_op_text(addr,1)[1:4].replace(',','')
    baseAddr = SearchPrevASM(addr,'ADRP',register)
    return idc.get_operand_value(baseAddr,1)+idc.get_operand_value(addr,1)
def WriteFile(filepath,content):
    folder = os.path.dirname(filepath)
    if not os.path.exists(folder): os.makedirs(folder)
    with open(filepath, "w", encoding='utf-8') as out:
        out.write(content)

def GetTID():
    global TID
    if isGDB(): return None
    if TID is None:
        TIDs = re.findall(r"[0-9a-fA-F]{16}", os.path.basename(idc.get_idb_path()).replace('800 ','000 ').replace('800]','000]'))
        TID = TIDs[0] if len(TIDs)>0 else None
    return TID
def GetBID(length=8):
    global BID
    if isGDB(): return None
    if BID is None:
        gnu=AOB("00 00 00 47 4E 55 00",dataStart,dataEnd)
        # IDA 9.2 Update
        BID = ''.join('%02X'%ida_bytes.get_byte(gnu+7+i) for i in range(length)) if isFound(gnu) else None
    return BID
def SetBID(bid):
    global BID
    BID = bid
def SetTID(tid):
    global TID
    TID = tid
def SetVersion(ver):
    global VER
    VER = ver
def GetVersion():
    global VER
    if VER == None:
        try:
            VERs = re.findall('v\d[\d\.a-z]*',os.path.basename(idc.get_idb_path()))
            VER=VERs[0] if len(VERs)>0 else None
        except IndexError:
            VER = None
    return VER
    
def GetRegion():
    global RGN
    if RGN == None:
        try:
            RGNs = re.findall('[\[\(](US|GB|JP|AU|HK|PL|CN|TW|FR|KR|NL|NO|NZ|PE|PT|RU|SE|ZA|CZ|DE|DK|ES|FI|GR|HU|IT|MX|AR|AT|BE|CA|CL|CO)[\]\)]',os.path.basename(idc.get_idb_path()))
            RGN = RGNs[0] if len(RGNs)>0 else None
        except IndexError:
            RGN = None
    return RGN

def AddMasterCode(codes):
    if isGDB(): return
    global masterCodes
    masterCodes+=codes
def AddCheatCode(codes):
    if isGDB(): return
    global cheatCodes
    cheatCodes+=codes
def InsertCheatCode(line,codes):
    if isGDB(): return
    global cheatCodes
    cheatlines=cheatCodes.split('\n')
    cheatlines.insert(-line-1,codes[0:-1])
    cheatCodes='\n'.join(cheatlines)
def AddRestoreCode(codes):
    if isGDB(): return
    global restoreCodes
    restoreCodes+=codes

# --- ADD NOTE FUNCTION ---
# This stores the note in a list until AddCheat is called
def AddNote(name, description):
    if isGDB(): return
    global noteDict
    # Normalize name to lower case for reliable matching
    noteDict[name] = description

def AddCheat(nameEN,nameZH=None,newOption=0,isSuggest=False,showOption=True): # newOption=0(不是)/1(新)/2(接上)
    if isGDB(): return
    global cheatCnt, idx, cheatCodes, cheatName
    cheatName=nameEN if english or nameZH==None else nameZH
    if newOption<2: 
        cheatCnt+=1
        idx=ord('a')
    else:
        idx+=1
    title = '№%2d. %s'%(cheatCnt,cheatName) if newOption==0 else '№%2d%s %s'%(cheatCnt,chr(idx) if showOption else '',cheatName)
    if isSuggest: title+=' ★'
    Show(title)
    cheatCodes += '\n[%s]\n'%title
    
    # --- CHECK IF NOTE EXISTS FOR THIS CHEAT ---
    global noteDict, finalNoteStr
    if cheatName in noteDict:
        # Match found: Format as [Title] then note=Description
        finalNoteStr += '[%s]\nnote=%s\n\n' % (title, noteDict[cheatName])

def AddSection(nameEN,nameZH=None): 
    if isGDB(): return
    global cheatCnt, idx, cheatCodes, cheatName, isBreeze, section_stack
    cheatName=nameEN if english or nameZH==None else nameZH
    
    if isBreeze:
        # Breeze: Use brackets with Folder Start Opcode (20000000)
        title = '%s'%(cheatName)
        section_stack.append(title)
        Show('Section: ' + title)
        cheatCodes += '\n[%s]\n20000000\n'%title
    else:
        # Atmosphere: Use --SectionStart-- and block opener
        title = '--SectionStart:%s--'%(cheatName)
        Show(title)
        cheatCodes += '\n[%s]\n20000000\n'%title
    return
    
def EndSection(nameEN,nameZH=None): 
    if isGDB(): return
    global cheatCnt, idx, cheatCodes, cheatName, isBreeze, section_stack
    cheatName=nameEN if english or nameZH==None else nameZH
    
    if isBreeze:
        # Breeze: Pop current section, then close using Opcode 20000001
        if len(section_stack) > 0:
            parent_title = section_stack.pop()
            # In Breeze, you close the section with the SAME title as you opened it
            cheatCodes += '\n[%s]\n20000001\n'%parent_title
            Show('End Section: ' + parent_title)
    else:
        # Atmosphere: Use --SectionEnd-- and block closer
        title = '--SectionEnd:%s--'%(cheatName)
        Show(title)
        cheatCodes += '\n[%s]\n20000001\n'%title
    return  

def HackComplete():
    if isGDB(): return
    header = ("[%s %s TID=%s BID=%s]\n"%(gameName,VER,TID,BID))
    footer = ('[This set of cheats is created by All Credited, enjoy!]' if english else '[此套金手指由 OblivionReign 制作, 免費提供, 歡迎轉載, 敬請註明來源出處]')
    
    # --- CHECK FOR RESTORE CODE NOTE ---
    global noteDict, finalNoteStr, isBreeze
    restoreTitle = 'Restore Code (Use after unchecking any cheats below)' if english else '還原碼 (當取消以下金手指時使用)'
    if restoreTitle in noteDict:
        finalNoteStr += '[%s]\nnote=%s\n\n' % (restoreTitle, noteDict[restoreTitle])
    # -----------------------------------

    if isEMU: 
        cheats=cheatCodes.replace('\r','').split('\n\n')
        if masterCodes!='':
            cheatfilename="# Master Code (include share functions)"
            cheat = '{%s}\n%s'%(cheatfilename,masterCodes.strip('\n '))
            cheats= [cheat]+cheats
        
        for i in range(len(cheats)):
            cheat=cheats[i]=cheats[i].strip('\n ')
            if cheat=='': continue
            
            raw_name = (cheat.split('\n'))[0].strip('{}[] ')
            cheatfilename = re.sub(r'[\\/*?:"<>|]', "_", raw_name)

            path='%s\\%s for Yuzu\\%s\\cheats\\%s.txt'%(os.path.dirname(idc.get_idb_path()),TID,cheatfilename,BID)
            content = '%s\n'%cheat
            
            if codeK<ida_segment.get_segm_by_name('.bss').end_ea: WriteFile(path,content) 
        
        path='%s\\%s for Ryujinx\\%s %s\\cheats\\%s.txt'%(os.path.dirname(idc.get_idb_path()),TID,gameName,VER,BID)
        content = '%s\n'%('\n\n'.join(cheats))
        WriteFile(path,content)
        
    else:
        # Standard Switch output
        if masterCodes != '': 
            header += (('\n{%s}\n'%('Master Code (includes share functions)' if english else '關鍵碼 (含共用函式)'))+masterCodes)
        restoreCode = '' if restoreCodes=='' else '\n[%s]\n%s'%('Restore Code (Use after unchecking any cheats below)' if english else '還原碼 (當取消以下金手指時使用)', restoreCodes)
            
        if isBreeze:
            # Breeze Output Path: breeze/cheats/TID/BID.txt
            path='%s\\breeze\\cheats\\%s\\%s.txt'%(os.path.dirname(idc.get_idb_path()),TID,BID)
            content = '%s%s%s\n%s\n'%(header,restoreCode,cheatCodes,footer)
            WriteFile(path,content)
            
            # Write Breeze Notes: breeze/cheats/TID/notes.txt
            if finalNoteStr != '':
                # Append Breeze config lines to notes
                finalNoteStr += '\n[Breeze]\nfont_size=20\nshow_notes=true\n'
                
                notePath = '%s\\breeze\\cheats\\%s\\notes.txt'%(os.path.dirname(idc.get_idb_path()),TID)
                WriteFile(notePath, finalNoteStr)
        else:
            # Atmosphere Output Path
            path='%s\\%s\\%s\\cheats\\%s.txt'%(os.path.dirname(idc.get_idb_path()),gameName,TID,BID)
            content = '%s%s%s\n%s\n'%(header,restoreCode,cheatCodes,footer)
            WriteFile(path,content)
            
            # Write Atmosphere Notes
            if finalNoteStr != '':
                notePath = '%s\\%s\\%s\\cheats\\notes.txt'%(os.path.dirname(idc.get_idb_path()),gameName,TID)
                WriteFile(notePath, finalNoteStr)
    
    cls()
    print('ApplyPatch(\'\'\'\n'+header+cheatCodes+'\'\'\')')

def MarkLabel(name,type='Class'):
    if isGDB(): 
        addr=ptr(eval(name),returnResult=True)
        if type=='Address':
            MarkOffset(addr)
        elif type=='Class':
            MarkOffset(addr)
            ApplyStruct(GetQword(addr), 'ObjHeader') # Ungine only
        elif type=='Float':
            MarkFloat(addr,4)
        elif type=='Long':
            MarkBytes(addr,8)
        elif type=='DWord':
            MarkBytes(addr,4)
        elif type=='Word':
            MarkBytes(addr,2)
        elif type=='Byte':
            MarkBytes(addr,1)
        elif type=='Bits':
            MarkBytes(addr,1)
        Patch(GetQword(addr) if type in ('Class','Address') else addr,name)
            
def Init(enName,zhName=None,EMU=None, is64bit=True):
    if isGDB(): return
    cls()
    global isEMU, english, TID, BID, VER, RGN, gameName, cheatCnt, cheatCodes, masterCodes, restoreCodes, is32bit, noteDict, finalNoteStr, isBreeze, section_stack

    isNRO = '.nro.' in os.path.basename(idc.get_idb_path())

    TID = GetTID()
    if TID==None and not isNRO: TID=ida_kernwin.ask_str('', 11, "Please enter TID")
    
    BID = GetBID()
    if BID==None and not isNRO: BID=ida_kernwin.ask_str('', 11, "Please enter BID")

    VER = GetVersion()
    if VER==None and not isNRO: VER = ida_kernwin.ask_str('v0', 12, "Please enter VER")
    
    RGN = GetRegion()
    # if RGN==None: RGN = ida_kernwin.ask_str('US', 13, "Please enter Region")

    isEMU = ida_kernwin.ask_yn(False, 'HIDECANCEL\nUse RyujinX / Yuzu?') if EMU == None else EMU
    
    if not isEMU:
        # Prompt for Breeze Format
        isBreeze = ida_kernwin.ask_yn(False, 'HIDECANCEL\nUse Breeze Format?')
    else:
        isBreeze = False
    
    english = True if isEMU or zhName==None else ida_kernwin.ask_yn(True, 'HIDECANCEL\nUse english?')

    gameName= (enName if english else zhName) + ('' if RGN==None else ' (%s)'%RGN)

    cheatCnt=0
    cheatCodes = masterCodes = restoreCodes = finalNoteStr = ''
    noteDict = {}
    section_stack = []
    SetCodeK(GetCodeEnd())
    is32bit = not is64bit
    
def FpsCode(methods,SDK_FPS_Addr=None):
    if type(methods) not in (tuple, list): methods=[methods]
    cheatAddr1 = cheatAddr1b = cheatAddr1c = cheatAddr2 = cheatAddr3 = cheatAddr4 = cheatAddr5 = cheatAddr6 = cheatAddr7 = cheatAddr8 = BADADDR
    if 1 in methods:
        cheatAddr1=AOB('? ? ? 97 F4 00 00 34 68 3A 42 B9')
        cheatAddr1b=Either('00 01 62 1E C8 09 E8 D2','00 03 62 1E 01 01 67 9E')
        cheatAddr1c=Either('00 D8 61 5E 0A 18 61 1E','20 01 62 1E C9 09 E8 D2 21 01 67 9E 0A 18 61 1E')
    if 2 in methods and SDK_FPS_Addr != None:
        nnmusl_init_dso=AOB('? ? ? 94 80 ? ? B9 88 ? ? B9') #i.e. ida_segment.get_segm_by_name('.got.plt').start_ea + 0x18
        cheatAddr2=GetADRP(idc.get_operand_value(nnmusl_init_dso,0)+4) if isFound(nnmusl_init_dso) else ida_segment.get_segm_by_name('.got.plt').start_ea + 0x18
        # SDK_FPS_Addr = 0x7a66c # find in sdk: p( AOB("AB 26 4F B9") - get_name_ea(0,'__nnmusl_init_dso') )
    if 3 in methods:
        targetAddrs = AllOccur('88 01 00 34 ? ? ? 94 ? ? ? 94 ? ? ? ? 08 ? ? F9 08 01 40 B9 1F 01 00 6B E8 07 9F 1A 60 7A 68 BC ? ? ? ? ? ? ? ? C0 03 5F D6 E8 03 1F AA 60 7A 68 BC ? ? ? ? ? ? ? ? C0 03 5F D6')
        cheatAddr3= GetADRP(SearchPrevASM(targetAddrs[1], 'LDR', 'X19', limit=0x40)) if len(targetAddrs)==2 else BADADDR
    if 4 in methods:
        temp=AOB('08 ? ? F9 01 01 40 F9 ? ? ? ? 08 ? ? F9 08 01 40 F9 A0 23 03 D1 00 01 3F D6 ? ? ? ? ? 02 40 B9 A0 23 03 D1 08 ? ? F9 08 01 40 F9 00 01 3F D6')  # unity
        if isFound(temp):
            cheatAddr4=[GetQword(GetADRP(temp))]
        else:
            # temp=AOB('08 ? ? F9 01 01 40 F9 ? ? ? ? 08 ? ? F9 08 01 40 F9 A0 ? ? D1 00 01 3F D6 ? ? ? ? ? 02 40 B9  08 ? ? F9 08 01 40 F9 A0 ? ? D1 00 01 3F D6 ? ? ? ? 81 02 40 B9 08 ? ? F9 08 01 40 F9 A0 ? ? D1 00 01 3F D6')  # old version unity
            temp=AOB('08 ? ? F9 01 01 40 F9 ? ? ? ? 08 ? ? F9 08 01 40 F9 A0 ? ? D1 00 01 3F D6 ? ? ? ? ? 02 40 B9 A0 ? ? D1 08 ? ? F9 08 01 40 F9 00 01 3F D6')  # old version unity
            if isFound(temp): cheatAddr4=[GetQword(GetADRP(temp))]
    if 5 in methods:
        temp=AOB('1A ? ? F9 28 03 40 39')
        if isFound(temp):
            cheatAddr5=GetADRP(temp)
    if 8 in methods:
        temp=AOB('? ? ? ? ? ? ? 91 09 09 80 B9 C9 02 00 34 08 01 40 F9 0A 05 80 52')
        if isFound(temp):
            cheatAddr8=GetADRL(temp)
    if 6 in methods: # search sysFps::m_flipSync
        cheatAddr6=AOB('F3 03 00 2A ? ? ? 97 ? ? ? ? 08 ? ? F9')
    if 7 in methods and SDK_FPS_Addr != None:
        cheatAddr7=SDK_FPS_Addr

    AddCheat('60 FPS',None,1)
    if isFound(cheatAddr1):
        Hack(cheatAddr1,'MOV W0, #1', False)
        Hack(cheatAddr1b,'FMOV D0, #1.0', False)
        Hack(cheatAddr1c,'FMOV D0, #1.0', False)
    if isFound(cheatAddr2):
        AddCheatCode(PointerCodeHeader((cheatAddr2))) 
        AddCheatCode(PointerCodeAddRegister(SDK_FPS_Addr))
        AddCheatCode(PointerCodeWrite(4,ASM('MOV W11, #1'),use_D=False))
    if isFound(cheatAddr3): 
        AddCheatCode(PointerCodeHeader((cheatAddr3)))
        AddCheatCode(PointerCodeWrite(8,Float2DWord(60),Float2DWord(60),use_D=False))
    if isFound(cheatAddr4): 
        AddCheatCode(PointerCodeHeader(cheatAddr4))
        AddCheatCode(PointerCodeAddRegister(0xF14))
        AddCheatCode(PointerCodeWrite(4,1,use_D=False))
    if isFound(cheatAddr5): 
        AddCheatCode(PointerCodeHeader((cheatAddr5)))
        AddCheatCode(PointerCodeWrite(8, 1, 1, use_D=False))
    if isFound(cheatAddr8): 
        AddCheatCode(PointerCodeHeader((cheatAddr8)))
        AddCheatCode(PointerCodeAddRegister(0x1F24))
        AddCheatCode(PointerCodeWrite(4, 1, use_D=False))
    if isFound(cheatAddr6): 
        Hack('62 6A 68 B8 08 26 86 52', 'MOV W2, #1', False)
        Hack(cheatAddr6, 'MOV W0, #1', False)
        Hack(GetQword(GetADRP(cheatAddr6+12)), 1, False)
    if isFound(cheatAddr7): 
        Hack(SDK_FPS_Addr,'MOV W11, #1', False)
        
    AddCheat('30 FPS',None,2)
    if isFound(cheatAddr1):
        Hack(cheatAddr1,'MOV W0, #2', False)
        Hack(cheatAddr1b,'FMOV D0, #2.0', False)
        Hack(cheatAddr1c,'FMOV D0, #2.0', False)
    if isFound(cheatAddr2):
        AddCheatCode(PointerCodeHeader((cheatAddr2))) 
        AddCheatCode(PointerCodeAddRegister(SDK_FPS_Addr))
        AddCheatCode(PointerCodeWrite(4,ASM('MOV W11, #2'),use_D=False))
    if isFound(cheatAddr3): 
        AddCheatCode(PointerCodeHeader((cheatAddr3)))
        AddCheatCode(PointerCodeWrite(8,Float2DWord(30),Float2DWord(30),use_D=False))
        # FPS method 3 if fail
        # search 60 D2 4B BD  check something like LDR S0, [X21,X8,LSL#2] or LDR S8, [X21,X8,LSL#2]
    if isFound(cheatAddr4): 
        AddCheatCode(PointerCodeHeader(cheatAddr4))
        AddCheatCode(PointerCodeAddRegister(0xF14))
        AddCheatCode(PointerCodeWrite(4,2,use_D=False))
    if isFound(cheatAddr5): 
        AddCheatCode(PointerCodeHeader((cheatAddr5)))
        AddCheatCode(PointerCodeWrite(8, 2, 2, use_D=False))
    if isFound(cheatAddr8): 
        AddCheatCode(PointerCodeHeader((cheatAddr8)))
        AddCheatCode(PointerCodeAddRegister(0x1F24))
        AddCheatCode(PointerCodeWrite(4, 2, use_D=False))
    if isFound(cheatAddr6): 
        Hack('62 6A 68 B8 08 26 86 52', 'MOV W2, #2', False)
        Hack(cheatAddr6, 'MOV W0, #2', False)
        Hack(GetQword(GetADRP(cheatAddr6+12)), 2, False)
    if isFound(cheatAddr7): 
        Hack(cheatAddr7,'MOV W11, #2', False)
[COLOR=rgb(42, 72, 121)]
[/COLOR]

Here is my Silksong script *AOB was changed slightly for shells/rosaries/infinite tools going from 1.0.28891 to 1.0.29354 so you wont be able to downgrade those codes using this*
Python:
# This script was made by OblivionReign
# Hollow Knight: Silksong Generator
import sys
sys.path.insert(1,'C:\Program Files\IDA Professional 9.2\scripts')
from importlib import reload
try:
    if 'cheatlib' in sys.modules:
        del sys.modules['cheatlib']
except NameError:
    pass

import cheatLib
cheatLib = reload(cheatLib)
from cheatLib import *
cls()
################################ START ######################################

Init('Hollow Knight Silksong')

AddSection('Currency/Resources')

AddNote('Max Shells', "Gain huge amount on pickup / No loss on buy")
AddCheat('Max Shells')
# Line 1: add w8, w8, w21, lsl #16
# Line 2: nop
cheatAddr1 = AOB('08 01 15 0B 08 48 09 B9')
cheatAddr2 = AOB('08 01 15 4B 08 48 09 B9')
Hack(cheatAddr1, 'add w8, w8, w21, lsl #16')
Hack(cheatAddr2, 'nop')

AddNote('Max Rosaries', "Gain huge amount on pickup / No loss on buy")
AddCheat('Max Rosaries')
# Line 1: add w8, w8, w21, lsl #20
# Line 2: nop
cheatAddr1 = AOB('08 01 15 0B 08 80 00 B9')
cheatAddr2 = AOB('08 01 15 4B 08 7D A8 0A 08 80 00 B9')
Hack(cheatAddr1, 'add w8, w8, w21, lsl #20')
Hack(cheatAddr2, 'nop')

EndSection('Currency/Resources')

AddSection('Player Stats')

AddCheat('Infinite HP')
# Original: str w8, [x19, #0x60] -> Cheat: nop
cheatAddr = AOB('68 62 00 B9 F4 4F 46 A9 F6 57 45 A9 F8 5F 44 A9 FA 67 43 A9 FC 6F 42 A9')
Hack(cheatAddr, 'nop')

AddNote('Max/Inf Silk', "Attack an enemy with needle to instantly fill silk.")
AddCheat('Max/Inf Silk')
# Line 1: mov w8, w0
# Line 2: mov w8, w23
cheatAddr1 = AOB('1F 01 00 6B AA 06 00 54')
cheatAddr2 = AOB('E8 02 15 4B 08 7D A8 0A C8 86 00 B9 68 9A 42 F9 09 85 40 B9 29 04 F8 37')
Hack(cheatAddr1, 'mov w8, w0')
Hack(cheatAddr2, 'mov w8, w23')

EndSection('Player Stats')

AddSection('Inventory/Tools')

AddNote('Complete All Maps', "Save and quit, then return to see all maps completed.")
AddCheat('Complete All Maps')
cheatAddr = AOB('08 84 4B 39 08 02 00 34')
cheatAddr1 = AOB('08 02 00 34 20 00 80 52 F4 4F 42 A9 F5 0B 40 F9')
# 20 00 80 52 = MOV W8, #1
# C0 03 5F D6 = RET
Hack(cheatAddr, 'mov w8, #1')
Hack(cheatAddr1, 'strb w8, [x0, #0x2e1]')

AddNote('Max/Infinite All Items', "Gain or lose an item to have 999 of it.")
AddCheat('Max/Infinite All Items')
cheatAddr = AOB('20 00 80 52 FA 1A 00 B9 E8 0A 00 F9 ? ? ? ? E0 03 1F AA ? ? ? ? A0 00 80 52 ? ? ? ? 1F 20 03 D5')
Hack(cheatAddr, 'mov w0, #0x3e7')

AddCheat('Infinite Tools')
# Original: str x9, [x8, #0x10] -> Cheat: nop
cheatAddr = AOB('09 09 00 F9 ? ? ? ? E0 03 1F AA ? ? ? ? A0 00 80 52 ? ? ? ? 1F 20 03 D5')
Hack(AllOccur('09 09 00 F9 ? ? ? ? E0 03 1F AA ? ? ? ? A0 00 80 52 ? ? ? ? 1F 20 03 D5')[8],('NOP'))

AddNote('Have All Crests', "Issues may arise when using the bugged ones.")
AddCheat('Have All Crests')
cheatAddr = AOB('FF 83 01 D1 FD 7B 02 A9 F7 1B 00 F9 F6 57 04 A9 F4 4F 05 A9 FD 83 00 91 ? ? ? ? F3 03 00 AA 88 ? ? 39 28 02 00 36 ? ? ? ? 74 6E 40 F9 A0 ? ? F9 08 E4 40 B9 08 03 00 34 ? ? ? ? C8 ? ? 39 28 03 00 36 A0 ? ? F9 08 E4 40 B9 08 04 00 34 ? ? ? ? C8 ? ? 39 28 04 00 36 14 05 00 B5 ? ? ? ? ? ? ? ? ? ? ? 91 21 00 80 52 35 00 80 52 ? ? ? ? BF 3B 03 D5 95 ? ? 39 ? ? ? ? 74 6E 40 F9 A0 ? ? F9 08 E4 40 B9 48 FD FF 35 ? ? ? ? ? ? ? ? C8 ? ? 39 28 FD 07 37 ? ? ? ? ? ? ? 91 21 00 80 52 37 00 80 52 ? ? ? ? BF 3B 03 D5 D7 ? ? 39 A0 ? ? F9 08 E4 40 B9 48 FC FF 35 ? ? ? ? ? ? ? ? C8 ? ? 39 28 FC 07 37 ? ? ? ? ? ? ? 91 21 00 80 52 37 00 80 52 ? ? ? ? BF 3B 03 D5 D7 ? ? 39 F4 01 00 B4')
cheatAddr1 = AOB('FD 7B 02 A9 F7 1B 00 F9 F6 57 04 A9 F4 4F 05 A9 FD 83 00 91 ? ? ? ? F3 03 00 AA 88 ? ? 39 28 02 00 36 ? ? ? ? 74 6E 40 F9 A0 ? ? F9 08 E4 40 B9 08 03 00 34 ? ? ? ? C8 ? ? 39 28 03 00 36 A0 ? ? F9 08 E4 40 B9 08 04 00 34 ? ? ? ? C8 ? ? 39 28 04 00 36 14 05 00 B5 ? ? ? ? ? ? ? ? ? ? ? 91 21 00 80 52 35 00 80 52 ? ? ? ? BF 3B 03 D5 95 ? ? 39 ? ? ? ? 74 6E 40 F9 A0 ? ? F9 08 E4 40 B9 48 FD FF 35 ? ? ? ? ? ? ? ? C8 ? ? 39 28 FD 07 37 ? ? ? ? ? ? ? 91 21 00 80 52 37 00 80 52 ? ? ? ? BF 3B 03 D5 D7 ? ? 39 A0 ? ? F9 08 E4 40 B9 48 FC FF 35 ? ? ? ? ? ? ? ? C8 ? ? 39 28 FC 07 37 ? ? ? ? ? ? ? 91 21 00 80 52 37 00 80 52 ? ? ? ? BF 3B 03 D5 D7 ? ? 39 F4 01 00 B4')
# 20 00 80 52 = MOV W0, #1
# C0 03 5F D6 = RET
Hack(cheatAddr, 'mov w0, #1')
Hack(cheatAddr1, 'ret')

EndSection('Inventory/Tools')

AddSection('Movement/Combat')

AddNote('One Hit Kill', "Bosses with full or micro phases will still take a few hits.")
AddCheat('One Hit Kill')
# Original: sub w9, w9, w21 -> Cheat: mov w9, #0
cheatAddr = AOB('29 01 15 4B 3F A1 0F 31')
Hack(cheatAddr, 'mov w9, #0')

AddNote('Faster Walk Speed', "This doesnt affect your dashing speed.")
AddCheat('Faster Walk Speed')
# AOB for HeroController$$Move
cheatAddr = AOB('00 01 40 BD 49 09 20 1E')
Hack(cheatAddr, 'fmov s0, #31')

AddNote('Infinite Air Jump', "Lets you keep jumping.")
AddCheat('Infinite Air Jump')
# AOB for HeroController$$CanJump
cheatAddr = AOB('FD 7B BE A9 F3 0B 00 F9 FD 03 00 91 F3 03 00 AA ? ? ? ? C0 02 00 37')
cheatAddr1 = AOB('F3 0B 00 F9 FD 03 00 91 F3 03 00 AA ? ? ? ? C0 02 00 37')
# 20 00 80 52 = MOV W0, #1
# C0 03 5F D6 = RET
Hack(cheatAddr, 'mov w0, #1')
Hack(cheatAddr1, 'ret')

AddNote('Moonjump', "Hold B to ascend. This will crash your game if used inside the Sands of Karak.")
AddCheat('Moonjump')
# AOB for: ldr s0, [x9]
cheatAddr = AOB('20 01 40 BD 00 05 00 BD')

if isFound(cheatAddr):
    moonjump_activate = CodeCave(cheatAddr, (
        'ldr s0, {end}-4',      # Load the float value (30.0) from end of cave
        'str s0, [x9]',         # Write it to the velocity pointer
        'b {back}',             # Jump back to game
        '41F00000'              # Float 30.0 (0x41F00000 in little endian hex bytes)
    ), use_BL=False, returnCode=True)

    moonjump_restore = Hack(cheatAddr, 'ldr s0, [x9]', showRestoreCode=False, returnCode=True)

    if not cheatLib.isEMU:
        AddCheatCode(ButtonCode('B', moonjump_activate, elseCode=moonjump_restore))
    else:
        AddCheatCode(moonjump_activate)

EndSection('Movement/Combat')

################################# END #######################################

HackComplete()
 
Version 105.1111
Post automatically merged:

Does anyone have cheats for Dave the diver version 1.0.5.1111 ?
TID 010097f018538000
BID E7F88252816EE27F
Post automatically merged:



I found these, but one doesn't work and I haven't been able to test the other yet.


https://www.cheatslips.com/game/dave-the-diver
Breeze Beta99 works just fine here, thanks boo! <3
 
credits to @zzpong & @soemone

:!: code updater update

tested/working

if not working best option downgrade game version with the working cheats @soemone v1.0.0

Unofficial Cheat Update

Croc Legend of the Gobbos v1.0.1
TID: 0100FB2021B0E000
BID: 0B4044A6FC5A14B8

[Croc Legend of the Gobbos v1.0.1 TID: 0100FB2021B0E000 BID: 0B4044A6FC5A14B8]

[Restore Code]
04000000 00180064 51000529
04000000 0015AFEC 11000529
04000000 0015ABE0 11000529
04000000 0015AE70 B90002BF
04000000 00180124 B900011F

[Life]
04000000 00180064 51000529
04000000 00180064 4B1F0129

[Diamond +10]
04000000 0015AFEC 11002929
04000000 0015ABE0 11002929

[Diamond Not Lost]
04000000 0015AE70 D503201F
04000000 00180124 D503201F
Do you have the codes for version 1.0.2 + the moon jump?
 
No luck to find the cheat 😭
ive just made max pp although i named inf P points i am also going to try to make inf spirit bar and energy is ther any others you want me to try to make
Post automatically merged:

No idea. I never bothered to update to even 1.8.0 for the like 4 or 5 codes i bothered to make for that game.
gamerjin is working on updating his codes already just be patient
 
BOTW has been updated.
 
Last edited by Gamerjin,
does anyone have an update cheats file for
Hyrule Warriors: Age of Calamity 1.3.0

TID: 01002B00111A2000
BID: C3CF52BF2B05D731

the only cheat from previous posts that works is Unlimited Special.

im using Eden Emulator, v0.2.0
 
Ended up creating my first cheat that actually works.

[99 Moves]
010F0000 0051C15E 00000063


See the cheat file attached.
Cheat is for the USA version of the game.
Update:

[99 Moves]
010F0000 0051C15E 00000063

[Current card Power 9999 for first battle]
02000000 0051C029 0000270F
*best I could do

[Medallion x99]
01000000 0051C0A7 00000063
*Don't know if using this before you get at least one crashes the game. So wait a little.

[Milanor lv 3]
01000000 0041E7F0 00000003
[Milanor lv 4]
01000000 0041E7F0 00000004
[Milanor lv 20]
01000000 0041E7F0 00000014
*at level 3, the next level up gives you GEN, TEC and ATK
*at level 4 the next gives you LUK (and something else)
*The point of this is to keep you character at level 3 till the GEN, TEC and ATK are maxed, then keep at 4, till the LUK is maxed and after, change to the max level of 20.

[Yggdra lv 04]
01000000 0041E828 00000004
[Yggdra lv 05]
01000000 0041E828 00000005
[Yggdra lv 20]
01000000 0041E828 00000014
*Normal Yggdra ie: the one you start with. Not tested on the Yggdra - La Pucelle
Update: La Pucelle and starting Yggdra is the same code wise so this cheat works for both

[Mistel lv 09?]
01000000 0041EA90 00000009
[Mistel lv 20]
01000000 0041EA90 00000014
*You get Mistel at level 9. Don't know what levels she gets GEN, ATK, TEC and LUK.
*Just have this as a placeholder for further testing

[Roswell lv 09]
01000000 0041E8D0 00000009
[Roswell lv 10]
01000000 0041E8D0 0000000A
[Roswell lv 20]
01000000 0041E8D0 00000014


[Russel lv 09]
01000000 0041E940 00000009
[Russel lv 11]
01000000 0041E940 0000000B
[Russel lv 20]
01000000 0041E940 00000014

UPDATE:
[All others lv 10 *guess]
01000000 0041E860 0000000A
01000000 0041E898 0000000A
01000000 0041E908 0000000A
01000000 0041E978 0000000A
01000000 0041E9B0 0000000A
01000000 0041E9E8 0000000A
01000000 0041EA20 0000000A
01000000 0041EA90 0000000A
*guessing the address of all the characters in the game based on the ones I looked up. Will test later.

Update:
My guess was correct.
Unknown for Pamela since I have not played on hard mode.

Guess was based on Yggdra code minus Milanor code being 56. Thus I assume that each character’s code had a 56 difference from each other. And from memory I know how many characters are in the game.
 

Attachments

Last edited by moneychild,
just leaving this here, i take no credit, but they might help someone else:
[disable hitbox ptr]
580F0000 08729438
580F1000 00000000
580F1000 000000B8
580F1000 00000000
580F1000 00000058
580F1000 00000048
780F0000 00000028
610F0000 00000000 00000000

[hp ptr trace]
580F0000 08729438
580F1000 00000000
580F1000 000000B8
580F1000 00000000
580F1000 00000058
580F1000 00000070
989EF000
540E1000 00000064
780F0000 00000054
A4EF0000

[mp ptr trace]
580F0000 08729438
580F1000 00000000
580F1000 000000B8
580F1000 00000000
580F1000 00000058
580F1000 00000070
989EF000
580F1000 000000A8
580E1000 000000B0
780F0000 00000034
540E1000 00000034
A4EF0000

[sp ptr trace]
580F0000 08729438
580F1000 00000000
580F1000 000000B8
580F1000 00000000
580F1000 00000058
580F1000 00000070
989EF000
580F1000 000000A8
580E1000 000000B0
780F0000 0000003C
540E1000 0000003C
A4EF0000

[flask ptr trace]
580F0000 08729438
580F1000 00000000
580F1000 000000B8
580F1000 00000000
580F1000 00000058
580F1000 00000070
780F0000 000000D0
640E0000 00000000 00000000
 
Diablo II: Resurrected 1.0.31.0
TID: 0100726014352000
BID: 2C7F979610E99119
[Diablo II: Resurrected 1.0.31.0 TID: 0100726014352000 BID: 2C7F979610E99119]

[pspmaster updated, credits to 七支剑, for NS1 or NS Emulator]

{master code}
04000000 005B0204 F94046A1
04000000 005AD80C 8B0D0D8C
04000000 005AD808 934389AD
04000000 005B0208 2A1303E2
04000000 005AD810 B9400580
04000000 005B020C 2A1403E3
04000000 005AFABC 2A0303F6
04000000 005AD67C B9400560
04000000 007C708C 2A0203F5
04000000 005BCF90 1E220100
04000000 005BD218 0B16011A
04000000 002CF030 5280003C
04000000 002CF034 5280003A

[Fixed offline]
04000000 00196EE4 D503201F

[Inf. HP]
04000000 01B4F790 2A1703F4
04000000 01B4F794 17A9829D
04000000 01B4F788 71001A7F
04000000 01B4F78C 54000041
04000000 01B4F780 7100049F
04000000 01B4F784 54000081
04000000 01B4F778 540000EA
04000000 01B4F77C B9400C24
04000000 01B4F770 F94046A1
04000000 01B4F774 6B17029F
04000000 005B0204 14567D5B

[Inf. Mana ]
04000000 01B4F768 A97E1FE6
04000000 01B4F76C 17A97829
04000000 01B4F760 54000041
04000000 01B4F764 B9000587
04000000 01B4F758 B9400D87
04000000 01B4F75C 714200DF
04000000 01B4F750 540000C1
04000000 01B4F754 B9400186
04000000 01B4F748 B9400D06
04000000 01B4F74C 710004DF
04000000 01B4F740 A93E1FE6
04000000 01B4F744 8B0D0D8C
04000000 005AD80C 145687CD

[Inf. Stamina]
04000000 01B4F738 A97E1FE6
04000000 01B4F73C 17A97834
04000000 01B4F730 54000041
04000000 01B4F734 B90004E6
04000000 01B4F728 714280DF
04000000 01B4F72C B9400CE6
04000000 01B4F720 540000C1
04000000 01B4F724 B94000E6
04000000 01B4F718 B9400D06
04000000 01B4F71C 710004DF
04000000 01B4F710 934389AD
04000000 01B4F714 8B0D0D87
04000000 01B4F70C A93E1FE6
04000000 005AD808 145687C1

[One Hit Kill]
04000000 01B4F704 2A1303E2
04000000 01B4F708 17A982C1
04000000 01B4F6FC 54000041
04000000 01B4F700 52800014
04000000 01B4F6F4 54000080
04000000 01B4F6F8 71001A7F
04000000 01B4F6EC B9400C24
04000000 01B4F6F0 7100049F
04000000 005B0208 14567D39

[Money 1M]
04000000 01B4F6E4 17A9784C
04000000 01B4F6E8 000F4240
04000000 01B4F6DC B9400580
04000000 01B4F6E0 A97E1FE6
04000000 01B4F6D4 54000041
04000000 01B4F6D8 B9000587
04000000 01B4F6CC 180000E7
04000000 01B4F6D0 714380DF
04000000 01B4F6C4 540000C1
04000000 01B4F6C8 B9400186
04000000 01B4F6BC B9400D06
04000000 01B4F6C0 710004DF
04000000 01B4F6B8 A93E1FE6
04000000 005AD810 145687AA

[Gain 10 attribute points each time a change is made]
04000000 01B4F6B0 2A1403E3
04000000 01B4F6B4 17A982D7
04000000 01B4F6A8 54000041
04000000 01B4F6AC 0B0302F4
04000000 01B4F6A0 52800143
04000000 01B4F6A4 7100127F
04000000 005B020C 14567D25
04000000 01B4F698 2A0303F6
04000000 01B4F69C 17A98109
04000000 01B4F690 54000041
04000000 01B4F694 52800143
04000000 01B4F68C 7100105F
04000000 005AFABC 14567EF4

[Skill Points 999]
04000000 01B4F684 A97E1FE6
04000000 01B4F688 17A977FE
04000000 01B4F67C B9000560
04000000 01B4F680 B9400560
04000000 01B4F674 714140DF
04000000 01B4F678 54000041
04000000 01B4F66C B9400166
04000000 01B4F670 52807CE0
04000000 01B4F664 710004DF
04000000 01B4F668 540000C1
04000000 01B4F65C A93E1FE6
04000000 01B4F660 B9400D46
04000000 005AD67C 145687F8

[Exp. 250x ]
04000000 01B4F654 17B1DE8F
04000000 01B4F658 000000FA
04000000 01B4F64C 1B017C63
04000000 01B4F650 2A0203F5
04000000 01B4F648 18000081
04000000 007C708C 144E216F

[Exp. 500x ]
04000000 01B4F654 17B1DE8F
04000000 01B4F658 000001F4
04000000 01B4F64C 1B017C63
04000000 01B4F650 2A0203F5
04000000 01B4F648 18000081
04000000 007C708C 144E216F

[Exp. 1000x ]
04000000 01B4F654 17B1DE8F
04000000 01B4F658 000003E8
04000000 01B4F64C 1B017C63
04000000 01B4F650 2A0203F5
04000000 01B4F648 18000081
04000000 007C708C 144E216F

[Move Speed 1.5x ]
04000000 01B4F640 A97E1FE6
04000000 01B4F644 17A9B654
04000000 01B4F638 54000041
04000000 01B4F63C 1E210800
04000000 01B4F630 B9400CC6
04000000 01B4F634 710004DF
04000000 01B4F628 1E2F1001
04000000 01B4F62C F9404666
04000000 01B4F620 A93E1FE6
04000000 01B4F624 1E220100
04000000 005BCF90 145649A4

[Move Speed 2x ]
04000000 01B4F640 A97E1FE6
04000000 01B4F644 17A9B654
04000000 01B4F638 54000041
04000000 01B4F63C 1E210800
04000000 01B4F630 B9400CC6
04000000 01B4F634 710004DF
04000000 01B4F628 1E201001
04000000 01B4F62C F9404666
04000000 01B4F620 A93E1FE6
04000000 01B4F624 1E220100
04000000 005BCF90 145649A4

[Move Speed 3x ]
04000000 01B4F640 A97E1FE6
04000000 01B4F644 17A9B654
04000000 01B4F638 54000041
04000000 01B4F63C 1E210800
04000000 01B4F630 B9400CC6
04000000 01B4F634 710004DF
04000000 01B4F628 1E211001
04000000 01B4F62C F9404666
04000000 01B4F620 A93E1FE6
04000000 01B4F624 1E220100
04000000 005BCF90 145649A4

[Normal Attack Speed 3x ]
04000000 01B4F618 A97E1FE6
04000000 01B4F61C 17A9B700
04000000 01B4F610 54000041
04000000 01B4F614 1B077F5A
04000000 01B4F608 B9400CC6
04000000 01B4F60C 710004DF
04000000 01B4F600 52800067
04000000 01B4F604 F9404666
04000000 01B4F5F8 A93E1FE6
04000000 01B4F5FC 0B16011A
04000000 005BD218 145648F8

.txt for NS1, .zip for eden emulator etc.
 

Attachments

Site & Scene News

Popular threads in this forum