我正在尝试为一款游戏创建插件,该插件对用户创建的内容没有任何官方支持。目的是解码一个文件,该文件用于将内容从一台服务器传输到另一台服务器,以便我可以对其进行编辑。
我要更改的此群集文件中的数据已编码并存储在数字数组中。我可以通过使用String.fromCharCode()对其进行解码,但是它仍然不是完全人类可读的,无法准确更改。
下面的块是我当前试图用来解码数组的内容。我将其限制为1到127之间的数字,因为某些字符无法识别,并且很难粘贴到此帖子中。
let text = '';
mysteryNumbers.forEach(code => {
if (code >= 1 && code <= 127) {
text += String.fromCharCode(code);
}else{
text += code;
}
});
console.log(text);
注意:我要包括大约10%的数组,以使该帖子的大小易于管理。第一个块是我要解码的整数数组。第二个块是尝试使用上述函数将整数解码为它们的预期字符。
[62, -108, 18, 72, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 0, 0, 0, 0, -94, -75, 66, 71, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 1, 0, 0, 0, -103, 123, 58, 69, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 3, 0, 0, 0, 0, -64, -58, 68, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 4, 0, 0, 0, 123, -4, 75, 70, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, -56, 66, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 7, 0, 0, 0, 0, 0, -92, 65, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 8, 0, 0, 0, 2, -106, -48, 64, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 9, 0, 0, 0, -102, -103, -23, 63, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 67, 117, 114, 114, 101, 110, 116, 83, 116, 97, 116, 117, 115, 86, 97, 108, 117, 101, 115, 0, 14, 0, 0, 0, 70, 108, 111, 97, 116, 80, 114, 111, 112, 101, 114, 116, 121, 0, 4, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 78, 111, 110, 101, 0, 0, 0, 0, 0, 5, 0, 0, 0, 78, 111, 110, 101, 0, 0, 0, 0, 0]
>-108H000CurrentStatusValues0000FloatProperty00000000-94-75BG000CurrentStatusValues0000FloatProperty0000000-103{:E000CurrentStatusValues0000FloatProperty00000000000000CurrentStatusValues0000FloatProperty00000000-64-58D000CurrentStatusValues0000FloatProperty0000000{-4KF000CurrentStatusValues0000FloatProperty000000000-56B000CurrentStatusValues0000FloatProperty00000000000000CurrentStatusValues0000FloatProperty000000000-92A000CurrentStatusValues0000FloatProperty0000000-106-48@000CurrentStatusValues0000FloatProperty0000 000-102-103-23?000CurrentStatusValues0000FloatProperty0000
0000000000CurrentStatusValues0000FloatProperty00000000000000None00000000None00000
答案 0 :(得分:0)
这没有不正确的地方:
const codes = [66, 65, 110, 65, 110, 65]
const word = codes.map(x => String.fromCharCode(x)).join('')
console.log(word) //"BAnAnA"
逻辑很好,问题在于您不能只将代码转换为char并期望它能工作,开发团队可能使用秘密协议对信息进行编码,因此只有它们才能正确解析数据并读取代码。