熵丢失:任天堂的32 767位非随机序列

Trang Ngo, A. Williams
{"title":"熵丢失:任天堂的32 767位非随机序列","authors":"Trang Ngo, A. Williams","doi":"10.1145/3555858.3563265","DOIUrl":null,"url":null,"abstract":"Early video games didn’t have hardware support for random number generation, so developers used software-based RNG. We show that hundreds of games in the Nintendo Famicom / NES library regenerate the same pseudorandom sequence of 32, 767 bits, although the machine code for doing so comes in more than one hundred variants. We identified the disparate implementations using a simple regular expression that matches the following “fingerprint” of operations: LDA, AND, STA, LDA, AND, EOR, CLC, BEQ, SEC, ROR. These instructions implement a classic 15-bit linear feedback shift register associated with x15 + x7 + 1 (i.e., tap the 15th and 7th bits). However, many games devoted more memory to the LFSR’s state. For example, Donkey Kong (1983) used 8 bytes (or 8 · 8 = 64 bits), The Legend of Zelda (1986) used 13 bytes, and Super Mario Bros. 3 (1988) used 9 bytes. In each case, additional entropy is lost by a simple programming error: the bits are shifted in the wrong direction.","PeriodicalId":290159,"journal":{"name":"Proceedings of the 17th International Conference on the Foundations of Digital Games","volume":"227 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Entropy Lost: Nintendo’s Not-So-Random Sequence of 32, 767 Bits\",\"authors\":\"Trang Ngo, A. Williams\",\"doi\":\"10.1145/3555858.3563265\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Early video games didn’t have hardware support for random number generation, so developers used software-based RNG. We show that hundreds of games in the Nintendo Famicom / NES library regenerate the same pseudorandom sequence of 32, 767 bits, although the machine code for doing so comes in more than one hundred variants. We identified the disparate implementations using a simple regular expression that matches the following “fingerprint” of operations: LDA, AND, STA, LDA, AND, EOR, CLC, BEQ, SEC, ROR. These instructions implement a classic 15-bit linear feedback shift register associated with x15 + x7 + 1 (i.e., tap the 15th and 7th bits). However, many games devoted more memory to the LFSR’s state. For example, Donkey Kong (1983) used 8 bytes (or 8 · 8 = 64 bits), The Legend of Zelda (1986) used 13 bytes, and Super Mario Bros. 3 (1988) used 9 bytes. In each case, additional entropy is lost by a simple programming error: the bits are shifted in the wrong direction.\",\"PeriodicalId\":290159,\"journal\":{\"name\":\"Proceedings of the 17th International Conference on the Foundations of Digital Games\",\"volume\":\"227 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2022-09-05\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 17th International Conference on the Foundations of Digital Games\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3555858.3563265\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 17th International Conference on the Foundations of Digital Games","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3555858.3563265","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

早期的电子游戏没有硬件支持随机数生成,所以开发者使用基于软件的RNG。我们展示了任天堂Famicom / NES库中的数百个游戏生成了相同的32,767位伪随机序列,尽管这样做的机器码有一百多种变体。我们使用匹配以下操作“指纹”的简单正则表达式来识别不同的实现:LDA、AND、STA、LDA、AND、EOR、CLC、BEQ、SEC、ROR。这些指令实现了与x15 + x7 + 1相关的经典15位线性反馈移位寄存器(即,点击第15位和第7位)。然而,许多游戏将更多内存用于LFSR状态。例如,1983年的《大金刚》使用了8个字节,1986年的《塞尔达传说》使用了13个字节,1988年的《超级马里奥兄弟3》使用了9个字节。在每一种情况下,额外的熵都会因为一个简单的编程错误而损失:比特向错误的方向移动。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Entropy Lost: Nintendo’s Not-So-Random Sequence of 32, 767 Bits
Early video games didn’t have hardware support for random number generation, so developers used software-based RNG. We show that hundreds of games in the Nintendo Famicom / NES library regenerate the same pseudorandom sequence of 32, 767 bits, although the machine code for doing so comes in more than one hundred variants. We identified the disparate implementations using a simple regular expression that matches the following “fingerprint” of operations: LDA, AND, STA, LDA, AND, EOR, CLC, BEQ, SEC, ROR. These instructions implement a classic 15-bit linear feedback shift register associated with x15 + x7 + 1 (i.e., tap the 15th and 7th bits). However, many games devoted more memory to the LFSR’s state. For example, Donkey Kong (1983) used 8 bytes (or 8 · 8 = 64 bits), The Legend of Zelda (1986) used 13 bytes, and Super Mario Bros. 3 (1988) used 9 bytes. In each case, additional entropy is lost by a simple programming error: the bits are shifted in the wrong direction.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信