Homebrew RAM editing glitch on any 3DS, might lead to an exploit?

Trinitro21

Well-Known Member
OP
Member
Joined
Oct 14, 2015
Messages
133
Trophies
0
Location
Userland
XP
206
Country
United States
TL;DR there's an oversight in SmileBASIC that leads to RAM viewing and editing on any 3DS, hacked or unhacked. It could lead to a primary exploit, but it probably won't. I don't know for sure though, so I'm posting it here to see what comes of it.

In the SmileBASIC interpreter, there's a bug with the BGSCREEN command, which resizes the background layer. The area of the background layer isn't supposed to exceed 16383, but the checks the interpreter performs on the parameters are insufficient and can be bypassed with large enough numbers.

The game will crash if the area is too large; however, there's a window where the game doesn't crash and the BG layer occupies sizes never meant to be possible. Because of this, it contains memory allocated for other purposes by the interpreter, like variable and function storage and the current program's code.

With the BG commands, this area of memory can be edited by any 3DS, hacked or unhacked.

All that is needed to trigger this glitch is this one line of code:
Code:
BGSCREEN 0,134217728,16

Could a primary exploit be made with this bug?

It is an area of RAM allocated for the interpreter, so it's probably not executable and so likely not exploitable. However I know that there are pointers in the memory that can be edited, as well as many unknown segments of memory. Perhaps a variable's pointer could be edited to use executable memory or some other attack could be developed that could lead to an exploit?

EDIT: I'm stupid and forgot to give credit.
This glitch was found by a group of users at smilebasicsource.com, including slackerSnail, 12Me21, and incvoid.
I was somewhat part of it.
 
Last edited by Trinitro21,

proflayton123

The Temp Loaf'
Member
Joined
Jan 11, 2016
Messages
6,032
Trophies
1
Age
24
Location
日本
Website
www.facebook.com
XP
3,218
Country
Japan
TL;DR there's an oversight in SmileBASIC that leads to RAM viewing and editing on any 3DS, hacked or unhacked. It could lead to a primary exploit, but it probably won't. I don't know for sure though, so I'm posting it here to see what comes of it.

In the SmileBASIC interpreter, there's a bug with the BGSCREEN command, which resizes the background layer. The area of the background layer isn't supposed to exceed 16383, but the checks the interpreter performs on the parameters are insufficient and can be bypassed with large enough numbers.

The game will crash if the area is too large; however, there's a window where the game doesn't crash and the BG layer occupies sizes never meant to be possible. Because of this, it contains memory allocated for other purposes by the interpreter, like variable and function storage and the current program's code.

With the BG commands, this area of memory can be edited by any 3DS, hacked or unhacked.

All that is needed to trigger this glitch is this one line of code:
Code:
BGSCREEN 0,134217728,16

Could a primary exploit be made with this bug?

It is an area of RAM allocated for the interpreter, so it's probably not executable and so likely not exploitable. However I know that there are pointers in the memory that can be edited, as well as many unknown segments of memory. Perhaps a variable's pointer could be edited to use executable memory or some other attack could be developed that could lead to an exploit?

Finally, a thread with a theory of possible hax with good explanation with it
 

seijinshu

...
Member
Joined
Jan 6, 2016
Messages
483
Trophies
0
Location
...
XP
248
Country
United States
TL;DR there's an oversight in SmileBASIC that leads to RAM viewing and editing on any 3DS, hacked or unhacked. It could lead to a primary exploit, but it probably won't. I don't know for sure though, so I'm posting it here to see what comes of it.

In the SmileBASIC interpreter, there's a bug with the BGSCREEN command, which resizes the background layer. The area of the background layer isn't supposed to exceed 16383, but the checks the interpreter performs on the parameters are insufficient and can be bypassed with large enough numbers.

The game will crash if the area is too large; however, there's a window where the game doesn't crash and the BG layer occupies sizes never meant to be possible. Because of this, it contains memory allocated for other purposes by the interpreter, like variable and function storage and the current program's code.

With the BG commands, this area of memory can be edited by any 3DS, hacked or unhacked.

All that is needed to trigger this glitch is this one line of code:
Code:
BGSCREEN 0,134217728,16

Could a primary exploit be made with this bug?

It is an area of RAM allocated for the interpreter, so it's probably not executable and so likely not exploitable. However I know that there are pointers in the memory that can be edited, as well as many unknown segments of memory. Perhaps a variable's pointer could be edited to use executable memory or some other attack could be developed that could lead to an exploit?

Excellent. I think one of these games would be better for hacking than my theory with FE:Fates.
 

PF2M

Ex-Miiverse Hacker
Member
Joined
Sep 8, 2015
Messages
552
Trophies
0
Age
23
Location
Ohio
XP
1,000
Country
United States
Just tested the crashing version of it and it worked. Reminds me of that one line of Petit Computer code that crashed the game. My question is, how can the line of code you provided be used to edit the RAM? Is there other commands you can type in to do so?
 

Trinitro21

Well-Known Member
OP
Member
Joined
Oct 14, 2015
Messages
133
Trophies
0
Location
Userland
XP
206
Country
United States
Just tested the crashing version of it and it worked. Reminds me of that one line of Petit Computer code that crashed the game. My question is, how can the line of code you provided be used to edit the RAM? Is there other commands you can type in to do so?
BGGET can be used to get the two bytes at each tile and BGPUT can be used to write a new value.
RAM editors have already been made, but aren't on the SmileBASIC servers for secrecy. One can be downloaded here and injected into your extdata to be used.
 

Trinitro21

Well-Known Member
OP
Member
Joined
Oct 14, 2015
Messages
133
Trophies
0
Location
Userland
XP
206
Country
United States
You mentioned ram viewing was possible, how is that done?
The glitch makes the background layer data extend into the rest of the RAM, so simply triggering it and offsetting the background layer is enough to view the RAM. The data can also be retrieved with the BGGET command.
 

seijinshu

...
Member
Joined
Jan 6, 2016
Messages
483
Trophies
0
Location
...
XP
248
Country
United States
The glitch makes the background layer data extend into the rest of the RAM, so simply triggering it and offsetting the background layer is enough to view the RAM. The data can also be retrieved with the BGGET command.
Hmm. This would actually work with more investigating. Getting the ability to edit RAM would be such an excellent approach. If I successfully get my exploit working, we might be able to do a dual release kinda similar to IronHax/TubeHax.
 

proflayton123

The Temp Loaf'
Member
Joined
Jan 11, 2016
Messages
6,032
Trophies
1
Age
24
Location
日本
Website
www.facebook.com
XP
3,218
Country
Japan
Hmm. This would actually work with more investigating. Getting the ability to edit RAM would be such an excellent approach. If I successfully get my exploit working, we might be able to do a dual release kinda similar to IronHax/TubeHax.

.-.


Sent from my iPhone using Tapatalk
 
  • Like
Reactions: Deleted User

Damon_girl

Well-Known Member
Member
Joined
Oct 27, 2015
Messages
961
Trophies
0
Age
31
XP
553
Country
United States
Can this RAM editing be used for games too? Like on SSB or Hyrule Warriors Legends to make it play better on the old 3DS?
 

KaduPSE

Revolution and cake
Member
Joined
Dec 26, 2015
Messages
260
Trophies
0
XP
408
Country
Brazil
Can this RAM editing be used for games too? Like on SSB or Hyrule Warriors Legends to make it play better on the old 3DS?
RAM editing means changing the code/values stored on RAM. The goal would be to replace them with exploitable code. It's not related to performance at all. RAM editing could be used to cheat on games, but since in this case the RAM is filled with data for this title it wouldn't be possible.
 

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
not possible because of memory mapping: you can sure read executable memory but not write into it
you need a rop or a way to be even able to use gspwn
 
  • Like
Reactions: Ricken

Clector

Well-Known Member
Member
Joined
Mar 15, 2016
Messages
1,078
Trophies
0
Location
Not here
XP
460
Country
Bangladesh
Well I was going to buy it, but because some things I wanted to buy before I will buy a eShop card this Thursday, but if there"s going to be an exploit it will be better to know so then I will buy it before since we know what Nintendo uses to do whit 3rd Party exploitable games.
 
Last edited by Clector,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    I played Fallout 4 on PC, I enjoyed it honestly. Not my favorite game on earth but at the same time I didn't hate it at all lol
  • BigOnYa @ BigOnYa:
    That's cool you got a ps3... Glad to hear. Game on!
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Ironic this was posted today lol
  • BigOnYa @ BigOnYa:
    I think the tv series has boasted play of, I did see they said playing of it Is up, way more than norm
    +1
  • BigOnYa @ BigOnYa:
    I've been playing the next gen version on Series X all day, I love it. :wub:
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Downloading some random stuff, damn almost 400GBs in like 4 hours lol
  • Psionic Roshambo @ Psionic Roshambo:
    Gonna be over 1TB this month.... damn lol
  • Xdqwerty @ Xdqwerty:
    good night
    +1
  • BigOnYa @ BigOnYa:
    At least you have some fast speeds. What a drag that used to be, I remb downloading 1 pic back in the day, and seeing line by line show
    +1
  • BigOnYa @ BigOnYa:
    Nighty night.
  • BigOnYa @ BigOnYa:
    Or worse, you downloading something, and someone calls your phone and interupts the download, good ole AOL. Of course that's before most you guys even were born yet.
  • Psionic Roshambo @ Psionic Roshambo:
    Lol I think my first modem was 48K but it had some sort of firmware or software update that let me get 56K
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I had EarthLink lol
  • Psionic Roshambo @ Psionic Roshambo:
    A bunch of NetZero accounts that I used for things... Lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    So glad I'm not in prison lol
  • BigOnYa @ BigOnYa:
    Yea marriage is a bitch sometimes...
  • Psionic Roshambo @ Psionic Roshambo:
    I legit think they passed the cyber terrorism laws from some of my hmm pranks lol
  • Psionic Roshambo @ Psionic Roshambo:
    I knocked the east coast backbone of EarthLink offline for like 6 hours one time, was on the news and everything well I mean I wasn't on the news.... Just they where having "technical difficulties" lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Was just one single custom packet. I miss when Internet security was an afterthought lol almost all modems and network hardware operated in promiscuous mode.
  • Psionic Roshambo @ Psionic Roshambo:
    Now these days they do sanity checks.... The source IP can't also be the destination IP lol
  • Psionic Roshambo @ Psionic Roshambo:
    They did end up using some of my stuff in the first Gulf war though lol
  • BakerMan @ BakerMan:
    GUYS I JUST COMMENTED A YOUR MOM JOKE ON A GACHA YT COMMUNITY POST (the algorithm has cursed me in terms of community posts, bc I fuck around on that sort of community post, just commenting and being a jackass)
    +1
  • BakerMan @ BakerMan:
    IT FELT SO GOOD
    +1
  • BakerMan @ BakerMan:
    the OP made a couple vocaloid characters, and the post had the caption "Guess who I did 💙💛❤️

    hint: they're from vocaloid"
    +1
    BakerMan @ BakerMan: the OP made a couple vocaloid characters, and the post had the caption "Guess who I did 💙💛❤️... +1