Professional Documents
Culture Documents
sxos作弊指南(中、英文)
sxos作弊指南(中、英文)
========================
--[ 1. Introduction
This small guide attempts to shed some light on finding your own
cheat codes
for Switch games using the SX OS Cheat finder as well as detailing
the specifics
about the SX OS Cheat Code Format.
When working with pointers in the SX OS Cheat Engine you can have
three different
type of pointers:
* MAIN - memory addresses/pointers relative to the game's NSO
executable
* HEAP - memory addresses/pointers relative to the start of the
game's heap
* BASE - memory addresses/pointers that are neither part of
MAIN/HEAP,
they are displayed a relative to the address space base
(usually 0x8000000)
Remember that having cheat codes which write to a magic HEAP address
are most of
the time not very stable/reliable cheat codes, because the layout of
the HEAP is
not always fully deterministic and often times depends on how someone
navigates
through a game. In these cases it is better to study the game logic
more and find
pointers (or pointers to pointers, etc.) until you traced back to an
address that
resides in MAIN (a pointer in BSS or RO for example). At the end of
this guide
you will find a small case study of how the included codes for
"Mega Man Legacy Collection" work.
Cheat codes are placed inside the sxos folder on your microSD card.
In order
for SX OS to pick up your cheat codes they need to be correctly
placed in the
right subfolders. This subfolder format works like this:
/sxos/titles/<titleID>/cheats/<buildID>.txt
Where titleID is the titleID of the game and buildID are the first
8bytes of the
game's build ID formatted as ascii hexadecimals. Both the titleID and
buildID for
a running game are displayed below the SXOS logo when you navigate to
the cheats
tab in the SX OS Menu. The buildID is needed to properly deal with
different
versions of the same game, which might lead to incompatibilities for
cheat codes.
When SX OS detects you have cheats on your SD cards for the currently
running game
but the buildID mismatches, it offers you to copy over the cheats
from the other
buildID to the one of the version you are currently running, if you
want to
experiment with (or fix) the compatibility of certain cheat codes.
[Infinite Health]
11111111 22222222
11111111 22222222
11111111 22222222
Where 'Infinite Health' is the displayed name of the code and the
lines containing
'11111111 22222222' are all the codes that belong to this cheat.
There is one special type of code. The "master code" which is not
defined by
enclosing the name in '[' and ']' but using '{' and '}' instead. The
master code
cannot be disabled and is executed before any other (enabled) cheat
code. These
exists to avoid duplication in multiple cheats which share certain
characteristics.
An example of master code usage can be seen in the case study for the
"Mega Man Legacy Collection" cheats you will find further down in
this guide.
20000000
300R0000 VVVVVVVV
310R0000
This code type is used at the end of the loop, use the same R value
as
for the start of the loop.
# Code Type 4: Load register with value
This code type will load one of the registers with a specific value
R = Register to be filled
V = Value to be put in register
5TMRI0AA AAAAAAAA
7T0RC000 VVVVVVVV
8kkkkkkk
k = keypad value to check against. the hex values for the various
keys are:
0000001 - A
0000002 - B
0000004 - X
0000008 - Y
0000010 - Left Stick Pressed
0000020 - Right Stick Pressed
0000040 - L
0000080 - R
0000100 - ZL
0000200 - ZR
0000400 - Plus
0000800 - Minus
0001000 - Left
0002000 - Up
0004000 - Right
0008000 - Down
0010000 - Left Stick Left
0020000 - Left Stick Up
0040000 - Left Stick Right
0080000 - Left Stick Down
0100000 - Right Stick Left
0200000 - Right Stick Up
0400000 - Right Stick Right
0800000 - Right Stick Down
1000000 - SL
2000000 - SR
This code type otherwise behaves the same as the conditional code
type 1.
Once you select the data type a memory dump for the running game will
be created
on your microSD card. This initial memory dump will take a while, it
is advised
to use a fast microSD card with enough free space. If you are
looking for a
specific/exact value, you can now select "Next Search" and pick
"Exact Value",
here you can enter the exact value you're looking for (in
hexadecimal). Once the
comparison is done it will tell you how many candidate memory
locations it found
and whether they are few enough to manually explore.
If there's too many candidates left, you simply exit the SX OS Rom
Menu and go
back to the game. Try to grab/lose some coins (or whatever item
you're trying
to cheat) and head back into the SX OS menu's cheat tab, pick "Next
Search" and
specify the condition. This can be "exact value" again if you know
the value
you're looking for, or simply "less than" if you know you just lost
some of the
desired item/stats. Keep iterating the searches until the cheat
searcher tells
you there's few enough candidate memory locations left for you to
start
exploring manually.
-- 8< ------------------------
{Master Code}
580f0000 00d3a2a0
580f1000 038cb840
580f1000 00000008
780f0000 0000000f
-- 8< ------------------------
The usage of '{' and '}' indicates that this is a master code, eg. a
code that
cannot be disabled and is always ran at the start of your cheat code
list.
Code type 5 is 'Load register with value from memory', here we load a
8 byte (64bit)
value, relative from MAIN (0) into register 'f' (15). The offset from
the start of
MAIN is 0xd3a2a0.
This one is very similar to the first code, but notice how we have an
'1' there.
if you look this up in the SX OS Code Format description above you
can see this
is the 'Load from register flag'. If set to '1' we will take the
address from the
register specified in the register index field rather than a memory
location
relative from MAIN or HEAP. In pseudocode this would be:
Then finally we we end with '780f0000 0000000f'. Which uses code type
7 to do
some basic arithmic to the memory location in register f. In pseudo
code this
would be:
register_f = register_f + 15
Let's have a quick look at one of the game specific cheat codes for
Mega Man 1:
We hope this guide outlines the possibilities of the cheat engine and
the
need for decent master codes a bit. We are looking forward to many
community
contributions with new cheat codes and of course suggestions for
improving our
cheat code finder and engine.
Yours Sincerely,
-[1.简介
这本小指南试图为您找到自己的作弊代码提供一些启示
使用 SX OS 作弊查找器的 Switch 游戏,以及详细说明
关于 SX OS 作弊代码格式。
-[2.地址空间布局随机化
在 SX OS 作弊引擎中使用指针时,您可以使用三种不同的指针
指针类型:
* MAIN-相对于游戏 NSO 可执行文件的内存地址/指针
* HEAP-相对于游戏堆开始的内存地址/指针
* BASE-不属于 MAIN / HEAP 的内存地址/指针,
它们显示为相对于地址空间基础的地址(通常为 0x8000000)
因此,在整个 SX OS 作弊查找器中,每个内存地址都显示为:
[MAIN + xxxx],[HEAP + xxxx],[BASE + xxxx]
在编写实际的作弊代码时,您需要指定您的地址类型
读取/写入,我们支持对 MAIN 和 HEAP 存储器的读取/写入。
-[3. SX OS 作弊代码格式
SX OS 作弊代码大致是由较早的作弊引擎(如动作重播)启发而来。
虽然旧的 Action Replay 作弊代码通常每个代码具有固定的宽度,但某些代码
SX OS 作弊引擎中的类型可以具有不同的长度。
基本的作弊代码定义如下所示:
[无限健康]
11111111 22222222
11111111 22222222
11111111 22222222
作弊引擎最多支持 16 个“ scratch”寄存器,可用于
任意用途,例如存储偏移量或内存位置。
有一种特殊类型的代码。未定义的“主代码”
将该名称括在“ [”和“]”中,但改用“ {”和“}”。主码
不能被禁用,并且必须在任何其他(启用的)作弊代码之前执行。这些
避免重复具有某些特征的多个作弊。
主代码用法的示例可以在针对
“ Mega Man Legacy Collection”作弊技巧将在本指南中进一步介绍。
以下是 SX 中当前实现的各种代码类型的概述
操作系统作弊引擎。
#代码类型 0:写入内存
使用代码类型 0,您可以对内存进行写操作。
#代码类型 1:条件语句
T =比较值的宽度(1/2/4/8)
M =内存类型(0 =主 nso,1 =堆)
C =用于比较的条件
A =相对于(M)的地址
Y =要比较的值
有效条件列表:
-1:大于
-2:大于或等于
-3:比
-4:低于或等于
-5:等于
-6:不等于
#代码类型 2:条件语句的结尾
20000000
此代码类型终止条件块(代码类型 3 或 8)
#代码类型 3:循环
300R0000 VVVVVVVVV
R =用于循环计数器的寄存器
V =循环计数
310R0000
此代码类型在循环结束时使用,使用与 R 相同的 R 值
为循环的开始。
#代码类型 4:使用值加载寄存器
此代码类型将使用特定值加载其中一个寄存器
R =要填写的寄存器
V =要存入寄存器的值
#代码类型 5:使用内存中的值加载寄存器
5TMRI0AA AAAAAAAA
T =要从内存中加载的值的宽度(1/2/4/8)
M =内存类型(0 =主 nso,1 =堆)
R =从寄存器索引加载
I =从寄存器加载标志,设置为 1 从寄存器 R 而不是地址 A 加载
A =相对于(M)的地址
#代码类型 6:将值从寄存器存储到内存地址
T =要存储到存储器中的值的宽度
R =包含存储器地址的寄存器索引
I =递增寄存器标志,设置为 1 以便在存储后将寄存器递增 T
o =从寄存器'r'添加额外的偏移量
r =偏移寄存器索引
V =要存储到存储器的值
#代码类型 7:应用算术运算进行注册
7T0RC000 VVVVVVVV
T =值的宽度(1/2/4/8)
R =寄存器索引,将算术运算应用于
C =适用的算术运算:
0 =加法,1 =减法,2 =乘法,3 =左移,4 =右移
V =在算术运算中使用的值
#代码类型 8:检查按钮是否被按下
8kkkkkkk
k =要检查的键盘值。各种键的十六进制值为:
0000001-
0000002-B
0000004-X
0000008-是
0000010-按下左摇杆
0000020-按下右摇杆
0000040-大
0000080-R
0000100-ZL
0000200-ZR
0000400-加
0000800-减号
0001000-左
0002000-以上
0004000-对
0008000-下
0010000-左摇杆左
0020000-左摇杆
0040000-左摇杆右
0080000-左踩
0100000-右摇杆左
0200000-右粘
0400000-右摇杆右
0800000-右踩
1000000-SL
2000000-SR
可以通过将多个按钮值进行“或”运算来组合多个按钮值。例如
A + B 变为 0000003,而 A + B + X + Y 变为 000000f。
否则,此代码类型的行为与条件代码类型 1 相同。
-[4.在 SX OS 中使用作弊查找器
SX OS 带有作弊搜索器功能,可帮助您识别
您需要编写自己的作弊代码的存储位置。你先来
通过启动游戏,当您到达游戏中要开始的位置时
要搜索作弊,请单击主页按钮,然后导航到相册查看器(SX OS 菜单)。
您可以通过导航到“作弊搜索器”中的作弊标签来开始作弊搜索。
SX OS 菜单。系统将提示您选择要启动的价值类型
作弊搜索。如果您不知道答案,则可以尝试近似。可以说
您想寻找游戏中硬币的存储位置,并且您知道
您可以累积超过 1000 个硬币,您肯定知道您所使用的数据类型
寻找大于 8 位。这需要一些实验,
专业知识以适应。
选择数据类型后,将为正在运行的游戏创建内存转储
在您的 microSD 卡上。建议此初始内存转储需要一段时间。
使用具有足够可用空间的快速 microSD 卡。如果您正在寻找
具体/确切值,您现在可以选择“下一个搜索”并选择“确切值”,
在这里,您可以输入要查找的确切值(十六进制)。一旦
比较完成后,它将告诉您找到了多少个候选内存位置
以及它们是否足够少以至于无法手动探索。
手动浏览内存位置候选者可以通过转到“查看候选者”来完成
在秘籍菜单中。当您从列表中选择候选人时,您将被带到
到内置的十六进制编辑器,您可以在其中更改这些存储位置的值。
更改值后,您可以返回游戏并查看您的更改是否
任何/期望的效果,以帮助确定您是否找到了正确的记忆
位置。
目前,我们仅提供一个有效的作弊代码示例。我们会喜欢
将所有时间都花在寻找更多作弊上,但是我们有不同的优先级。;-)
我们发现的作弊是各种代码的一个有趣的例子
输入 SX OS 作弊引擎当前提供的类型。
洛克人:遗产收藏最初是旧洛克人游戏的集合
当天为 NES 发布。这些游戏的切换“端口”实际上是
变相的 NES 模拟器。我们的《洛克人》作弊代码的内容取决于
从那里找到虚拟 NES 的内存起始地址的“主代码”
可以根据需要将任何 RAM 补丁应用于 NES 存储器。让我们来看看如何
这可行。
完整的主代码如下所示:
-8 <------------------------
{主码}
580f0000 00d3a2a0
580f1000 038cb840
580f1000 00000008
780f0000 0000000f
-8 <------------------------
“ {”和“}”的用法表示这是一个主代码,例如。一个代码
不能被禁用,并且总是在作弊代码列表的开头运行。
让我们逐行分解主代码:
580f0000 00d3a2a0
用伪代码,这将类似于:
下一行显示为:
580f1000 038cb840
这与第一个代码非常相似,但是请注意我们那里有一个“ 1”。
如果您在上面的 SX OS 代码格式说明中查找此内容,则可以看到此内容
是“从寄存器加载标志”。如果设置为“ 1”,我们将从
在寄存器索引字段而不是内存位置中指定的寄存器
来自 MAIN 或 HEAP 的亲戚。用伪代码可以是:
因此,实质上,所有“主代码”所做的就是遵循一堆指针,
最终以寄存器 F 中的指针结尾,该指针保存虚拟的开始
NES 的记忆。然后,该寄存器 f 值可用于任何需要的作弊代码中
从虚拟 NES 的内存中写入/读取,以使《洛克人》令人兴奋
超级大国!;-)
让我们快速看一下《洛克人 1》的游戏特定作弊代码之一:
[MM1 无限生命]
400e0000 00000000 0000006a
610f01e0 00000000 0000001c
-[6.结束语
我们希望本指南概述了作弊引擎和
需要体面的主码。我们期待着许多社区
具有新的作弊代码的贡献,当然还有改进我们的建议
作弊代码查找器和引擎。
此致,