Arbitrary code on SMW with human input

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Arbitrary code on SMW with human input

Post by rainwarrior »

thenewguy
Posts: 32
Joined: Wed Feb 03, 2016 10:39 pm

Re: Arbitrary code on SMW with human input

Post by thenewguy »

It's really cool that this is HUMAN INPUT. I've never seen that before. There have been some really excellent examples of arbitrary code execution in recent AGDQs. For example:

Mario 1 running on Super Mario World
https://youtu.be/YHyaTCuZRzM?t=318

Mario 3 modification using arbitrary code execution:
https://youtu.be/IasavgjMYDQ?t=184

Here's one that recreates mario maker inside Super Mario World:
https://www.youtube.com/watch?v=9pOU28liqi8
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Arbitrary code on SMW with human input

Post by koitsu »

Spent about 20 minutes today talking to old emulation folks (i.e. people who were around during the mid-to-late-90s during the initial start of the emulation boom) about this. I wanted to see what other people's opinions were vs. my own, and it seems I'm not the only one who looks at it this way.

My opinion: very cool/unique, and kudos to the degree of dedication involved, but it borders on insane. You really have to watch the first 4 minutes or so to get a full understanding of all the absolute nonsense involved to accomplish said task (I about lost it when I saw the use of a multitap and taped-up SNES controllers). Now, I happen to know who the guy (SethBling) is -- he participated in a panel talk at TwitchCon last year that I found very neat/fun and I have respect for him and what he did. Honest -- two thumbs up. But that said...

What really irks me (as in this reaction) is the fact that he had to rely on someone who could write 65816/SNES code, the p4plus2 fellow, to implement the flappy-bird-like feature. Let me be more specific: an assembly programmer had to write assembly code for any of this to work. It couldn't have been done without it.

So with that in mind, I'm having tremendous difficulty understanding why Seth went through all the ridiculous pain when he could have just had p4plus2 modify the code in an SMW ROM. This would've taken probably an extra 15 minutes (since SMW happens to be one of the all-time hacked and reverse-engineered games), and all the nonsense would've been removed from the picture? The only difference is this would have required a SNES copier, EverDrive, SD2SNES, or whatever -- rather than just non-modified hardware and no flash carts.

That's the part I'm having trouble grasping: this wasn't done just "the hard way", but "the most crazy/insane/ridiculous way", when doing it the easier way already existed (and to some degree had to be done anyway, re: p4plus2 having to write the code to begin with).

So while this was pretty amazing, I would say the more impressive -- and super neat -- project is what's at 5:37 in the video. When I saw this, I immediately thought of the San Andreas Deer Cam, which I still consider to be one of the funniest and neatest things in a long while (and Rachel Simone Weil agrees). I like to imagine that project, rather than as a "mod", generates joypad/controller input in a random fashion (rather than through some scripting language or mod). But I think it's just a mod script that does the work.

That's all from me for now. And remember: this is just my opinion (though apparently shared by several old emulation people), which means I'm just as wrong and right as anyone else. Thumbs up to those who have a different opinion/view of it too. No debates or arguments from me. :-)
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Arbitrary code on SMW with human input

Post by rainwarrior »

The whole point is doing it the hard way, though.

Like, my own feeling is that finding the arbitrary code exploit in the first place, and then making the first demo TAS is great. Anything beyond that isn't very interesting (if you can run one arbitrary program you can run any), unless there's something novel.

Demonstrating it can be done with human input is quite novel. I especially liked seeing him having to line up pixel-perfect shell spitting until he could get the coin display hacked.

The actual code that is eventually run, who cares? Flappy bird, nibbles, whatever, doesn't matter, it just had to be something. Similarly I wouldn't find it very interesting if someone did this again with a different program. The whole point here was just demonstrating that the exploit can be accomplished by human input.


As far as why do the TASBot things at AGDQ, it's just because it's a fun abuse of the "speedrun" category. It adds variety to the AGDQ exhibition while at the same time it's just a nice gag that this is still within the category somehow. A ROM hack, on the other hand, would be as out of category at AGDQ as, say, a musical performance.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Arbitrary code on SMW with human input

Post by tokumaru »

koitsu wrote:So with that in mind, I'm having tremendous difficulty understanding why Seth went through all the ridiculous pain when he could have just had p4plus2 modify the code in an SMW ROM. This would've taken probably an extra 15 minutes (since SMW happens to be one of the all-time hacked and reverse-engineered games), and all the nonsense would've been removed from the picture? The only difference is this would have required a SNES copier, EverDrive, SD2SNES, or whatever -- rather than just non-modified hardware and no flash carts.
But then it would be just another uninteresting hack. The incredible thing here is that, given the proper instructions, people could do this even back in 1990, since it requires no hardware tinkering at all! Injecting new code into a retail game by hand without any tools whatsoever, that's fucking amazing!

That being said, the cool factor in this wears off pretty quickly. The final result isn't particularly fun to play with, compared all the cool games you can play on the SNES, and you start wondering: "what's the point?". The time a person has to spend in order to achieve this is definitely not worth it, IMO.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Arbitrary code on SMW with human input

Post by tepples »

koitsu wrote:I'm having tremendous difficulty understanding why Seth went through all the ridiculous pain when he could have just had p4plus2 modify the code in an SMW ROM.
Because it can be done without making a copy. No "fixation" of the combined work means the Galoob v. Nintendo defense applies.
The only difference is this would have required a SNES copier, EverDrive, SD2SNES, or whatever
Exactly. This exploit can be performed even if a country's customs department enforces an import ban on said devices on request from a video game's copyright owner. Jeroen tells me the Netherlands has banned flash adapters that fit in a Nintendo DS's Game Card slot, for example.
That's the part I'm having trouble grasping: this wasn't done just "the hard way", but "the most crazy/insane/ridiculous way"
Unless the undertone is that "copyright is crazy/insane/ridiculous".
rainwarrior wrote:The whole point here was just demonstrating that the exploit can be accomplished by human input.
In other words, homebrew will find a way despite the technical and legal obstacles that a certain Japanese company erects. It strikes a blow against game approval policies banning downloading code by showing that Nintendo ought to have rejected its own software. I imagine that by now, all console makers have a policy that parallels Apple's:
In [url=https://developer.apple.com/app-store/review/guidelines/]App Store Review Guidelines[/url], Apple wrote:2.7 Apps that download code in any way or form will be rejected

2.8 Apps that install or launch other executable code will be rejected
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Arbitrary code on SMW with human input

Post by koitsu »

This is mainly for tepples (tokumaru hits on this point in his 2nd paragraph), but:

Sarcastically: I look forward to all the homebrew games that take 53+ minutes, without any mistakes being made, to enter ~330 bytes of code/data! Rephrased, without sarcasm: this is a completely impractical form of development. (If you aren't sure what the word impractical means, please look it up.)

I say all this with full admission that there is definitely a "hey, that's pretty clever/neat" aspect to it. But any other aspects fall short.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Arbitrary code on SMW with human input

Post by Sik »

The concept is not as crazy as it sounds though:
http://devster.monkeeh.com/sega/lakabajo/
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Arbitrary code on SMW with human input

Post by rainwarrior »

It kinda reminded me of people programming the Altair 8800 with switches on its front panel: https://www.youtube.com/watch?v=ZKeiQ8e18QY
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Arbitrary code on SMW with human input

Post by tepples »

koitsu wrote:Sarcastically: I look forward to all the homebrew games that take 53+ minutes, without any mistakes being made, to enter ~330 bytes of code/data! Rephrased, without sarcasm: this is a completely impractical form of development. (If you aren't sure what the word impractical means, please look it up.)
Like some other proofs of concept of surmounting an entry barrier, such as Hush-A-Phone and Carterfone, I agree that this is not the most practical. Use of SMW as a serious means of entry would involve use of TASBot. But it forms a landmark in the spectrum of automation versus legality.

I seem to remember reading that the Carterfone case had a witness testify to the following effect, though it may be apocryphal:

--Is it legal to use a third-party device this far away from the leased telephone? [device is across the room]
--Yes.
--How about this close? [device is closer]
--Yes.
--How about this close? [device is one inch from the phone]
--Yes.
--How about this close? [they come in contact]
--No.

Essentially, the attorney and the witness were bisecting the conceptual space of telephone accessories to reduce AT&T's argument to an absurdity.

The question then becomes "Should the line be drawn between TASBot and this demo?"
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Arbitrary code on SMW with human input

Post by koitsu »

I've completely lost interesting in this subject. Sweet.
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Arbitrary code on SMW with human input

Post by Drew Sebastino »

I was really hoping I wouldn't hear "Flappy Bird" again.
koitsu wrote:I look forward to all the homebrew games that take 53+ minutes, without any mistakes being made, to enter ~330 bytes of code/data!
They probably should have implemented a backspace...
rainwarrior wrote:The whole point is doing it the hard way, though.
Like writing a modern video game on punch cards? :lol:
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Arbitrary code on SMW with human input

Post by rainwarrior »

espozo wrote:
rainwarrior wrote:The whole point is doing it the hard way, though.
Like writing a modern video game on punch cards? :lol:
Well, yes. If someone made a 5 minute video about writing a new game on punch cards, I'd probably find it interesting, the first time.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Arbitrary code on SMW with human input

Post by Sik »

koitsu wrote:I've completely lost interesting in this subject. Sweet.
Thank tepples turning it into a legal discussion when the whole point was "look how I'm pulling off something crazily absurd" =P
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Arbitrary code on SMW with human input

Post by tepples »

I apologize for derailing it. I was just trying to provide one reason why some people would find doing it the hard way to be interesting. Should I delete my posts?
Post Reply