BIG UPS

Posted on 15th May 2011 in Something Daily

Yesterday was certainly one of the strangest days in recent memory, likely due to the fact that I, in a rare move against my antisocial tendencies, decided to go out. I presented my game Spaceratops to the Music Technology open house, where people who were considering joining the program came and checked out everyone’s projects from the past year. There were also a lot of people there who weren’t considering, but were just acquainted with somebody in the program and came to see cool stuff. So I had a more or less constant stream of people coming up to talk to me about my game. It was the only game at the open house, and the one that arguably had the least to do with “music technology”. But there were middle school kids (one of whom became seriously addicted to Spaceratops and played it three times), a guy with a Kraftwerk shirt, a lot of potential grad students, and a lot of people who heard from someone else that there was “someone around here who’s into chiptune” (me) and could not wait to talk to me about how Anamanaguchi went to NYU. But everybody seemed to really like the game. I didn’t know that there were any type of awards given out, but I ended up winning the award for the best undergraduate presentation (!!) to my complete surprise. I was blushing like a fool, I’m sure. But I got to plug my website a lot, and I made a lot of connections.

The other thing that happened was that I went to my first Big Ups performance last night at National Underground, and it was everything I expected and more. Big Ups are a punk band who are all juniors or seniors in music tech, and they put on crazy shows. During the second song, the singer, Joe, climbed up on this table that was out in the audience and wrapped his leg around one of the big columns that was holding it up. And of course he fell, knocking over a bunch of glasses and cutting his hand open. He rubbed the blood all over his face, it was awesome. Also one of the low-hanging stage lights got knocked over by the kids in the front who were moshing. I don’t know how the National Underground ownership feels about this. But it was an incredibly rad show.

Chiptune Binge

Posted on 14th May 2011 in Something Daily

It’s been a while since I wrote anything, let alone a full blog post, but this is because I’ve come to the realization that writing about what I do every day is dumb. At least, it was nice for a while, but not really worth my time anymore, I feel. But check it out, cool stuff has been happening.

Last Tuesday was the release of GOBLIN by Tyler the Creator from Odd Future as well as Starscream’s first full album, Future, Towards the Edge of Forever. These are both sweet albums. Listening to (and buying the deluxe version of) the former has sparked a lot of heated conversation about whether or not Odd Future are actually worth listening to. When I hear people talking about them, I just get really happy for them, because six months ago they were just a a bunch of kids recording stuff in their basements and now they’re huge. I don’t mean to be condescending, seriously. Just good for them, you know? The Starscream album (which I paid ten bucks for on a whim about twenty minutes after it released) is my first exposure to really any chiptune other than Anamanaguchi, and it began a chiptune binge that’s been continuing since that point. I got some of the albums from a few years ago on which Starscream were featured, and right now, I’m listening to this British chip dude called Syphus whose music is also really awesome. Check it.

I’m living out of a suitcase since my parents took my stuff away from NYC, and that means no video games, which in turn means less distractions from playing with my sweet new Wacom Bamboo tablet. I got it because there was this picture of an excited Asian guy that I thought would look really cool with fire in his hand, so I bought a tablet and drew the fire on him. Totally a worthwhile purchase. But seriously though, it is, because it means that I can draw 100% more stupid cartoons per hour.

Trying not to kill this weirdly good mood I’m in. Follow me on Twitter.

Buffer Overflows pt. 1

Posted on 7th May 2011 in Tutorials

From a book I’m reading called Hacking: The Art of Exploitation, I recently learned what a buffer overflow is, and how it can be used to make a program do something totally separate from what it was designed to do (such as run code that spawns, for example, a shell prompt with root privileges). A buffer overflow is the result of a character buffer in C being filled with more bytes of data than were allotted to it. C doesn’t have any measures in place to stop the programmer from accidentally (or purposefully) overflowing a character buffer, which means that if you put ten bytes (characters) into an 8-byte buffer, you’ll see the entered values actually overflowing into variables that are next to the buffer in memory. Example:

Let’s say you declare two 8-byte buffers, one after another, at the top of your main function, like this:

char buffer_one[8], buffer_two[8];

What is this line of code actually doing? It allocates memory that will be used to store two buffers. The buffers are actually located right next to each other in memory. buffer_two might be located at 0xbffff29c, and buffer_one might be located at 0xbffff2a4. The reason that the second buffer is at a lower memory address is that the stack structure in memory that contains a function’s variables grows up toward lower addresses, rather than down toward the higher ones. You’ll notice that the two example memory addresses I just gave are exactly 8 bytes apart (a4-9c), which is due to the declaration of buffer_two as one that would be used to hold up to 8 bytes of data (buffer_one is also 8-bytes long, with the allocated memory ending at 0xbffff2bb). This is fine if nothing longer than 8 bytes ever gets copied to these buffers, but in the event that it does, it will cause a buffer overflow.

Say that we used strcpy() to copy a command-line argument into the space allocated for buffer_two like this:

strcpy(buffer_two, argv[1]);

We could run the example with different values for buffer_two just by adding them at the command line. Something like

./a.out AAAAAAAAAAAAAAAAAAAAAA

where the long string of A’s is the set of characters that will be copied into buffer_two. Remember that since the second character buffer is located at a memory address lower than that of the first one, any characters beyond the eighth in buffer_two will overflow into the next memory addresses, which happen to belong to buffer_one. If, after copying the argument to the buffer, you were to print the contents of each buffer with

printf("buffer_two is at %p and contains \'%s\'\n", buffer_two, buffer_two);
printf("buffer_one is at %p and contains \'%s\'\n", buffer_one, buffer_one);

you’d see that both buffers contained some part of the argument string. buffer_two, located before buffer_one in memory, has overflowed into buffer_one. We only ever assigned the argument to the second buffer, yet part of it appears when we print the first buffer. This is the basic idea of a buffer overflow.

Check back for more in the next few days. I’m going to explain some more, including how to use a buffer overflow to divert the control flow of a program to different sections of the existing code. Thanks for reading!

From my brain to yours

Posted on 7th May 2011 in Something Daily

If you were to ask why I haven’t written in a few days, there are a lot of possible answers that I could give you. Most of them are true, except for the one where I tell you that I didn’t write because I was held captive by samurai – that one’s not true….yet. Among the more “real” responses to that question are “because I was moving from my dorm to an apartment”, “because I was completely caught up in trying to learn buffer overflows and wouldn’t rest until I could get one to work”, “because I felt that I had nothing to write about” and “because I was taking finals and writing final papers”.

I’ve been doing a lot of thinking recently about how I want this blog to go. I seem to be leaning in the direction of making it much more tech-oriented, despite the fact that certain sectors of my psyche get very angry with that idea. I’m not worried about those sectors, though, so I plan to start doing a lot more tutorials and writing about technology in general. It’s something I think I can do well at. For close to six months, I’ve used this blog basically as a place to dump all the thoughts of a day out of my mind, a process which, while being quite therapeutic, probably yields incredibly uninteresting reading. Not that I’m just in blogging for the popularity – readership really isn’t my primary concern. But I’m realizing the power of the blog platform and that it’s totally within my reach to do something awesome with it.

So with that new knowledge (or assumption), I’m going to attempt and change the focus of this blog just by changing what I write about. Expect much more knowledge to flow forth from my brain to yours.

comments: 0 » tags: , , ,

Changes Ahead

Posted on 4th May 2011 in Something Daily

This blog is going to get way more tech-oriented soon. I might start another one where I talk strictly about tech stuff, or I might just continue this one and start writing differently. But I want my blog to be worth reading, and filling it with knowledge seems to be a very applicable way for me to achieve that goal.

comments: 0 »

Mr. Emmett

Posted on 2nd May 2011 in Something Daily

I just put my first game up on my website – you can play it with Web Start and download the source. Here’s the link. I just presented this game, which was my Java 101 project, to a current Java 101 class. It was a very good experience having to go over old code of my own and reacquaint myself with it enough to explain it in a manner that made at least a little sense. People in the class didn’t have that many questions, which was not entirely surprising to me. I remember when I was in that class, despite being mostly clueless as to how something like that would be implemented, being unsure of what question to ask due to lack of knowledge, and because of how confident and knowledgeable the presenter seemed. Now I get to be on the other side of it, where I’m the confident and knowledgeable one simply out of experience, and people are asking me questions. It was very nice, and I got to plug my website. All around a great experience, and I hope I get to do more of that.

Having a website that I update regularly is changing the way I use this blog. I used to post everything I did right here, but now I have a series of specialized outlets for all of my work, that have developed as a result of me trying to come up with a good website design. Basically,

  • stuff I draw goes on tumblr
  • music goes on Soundcloud and then embedded here
  • i write here most days
  • websites and everything else that’s worth it get posted to the gallery

That’s the basic breakdown of how I’m handling my online portfolio at this point. It’s changing like crazy, but that’s how it exists right now.

As for how am I doing today, it’s been very hectic and will continue to be hectic. I don’t think I’ve been less motivated to do a Music History paper than I am right now, and it’s due tomorrow. Also I’m recording a concert tonight, and I still have to finish my roommate’s website before I leave for the summer. And of course, all I really want to do is go through this hacking tutorial. But it’s a pretty good day.

The Sound of Death

Posted on 1st May 2011 in Something Daily

I’m in the 4th semester of the music theory track at NYU, which means that the time of talking about tonal harmony is kind of over. This whole semester, the focus has been things that are post-tonal and/or experimental in nature. We started with Debussy, who was one of the first composers to start to develop a practice against the tonal system. We’ve mentioned Ives, Varese, Stravinksy, Reich, Glass, Cage, and lots of other composers similar to them. They all make music that, to some degree, can be considered “not normal” from the viewpoint of high classicism. The point of mentioning this is that it functions as an explanation for why the below soundcloud embed sounds like so much death.

Death by Raised by Robots

This is my third and final composition for Music Theory IV. My process was as follows: use SoundHack to change the headers on several video files (Star Wars, Fight Club, Aqua Teen) to cause them to be interpreted as audio. That is, the raw video and audio data bytes contained within the mp4 files were interpreted as audio data with absolutely no preprocessing. As you may have guessed, this resulted in close to six hours of almost nothing but white noise. The first second of each transcode, though, had a unique bit of digital evil, for whatever reason. I took the first second from each of my three transcodes and arranged them in a rhythmic pattern in Logic. I also included a low, repetitive drone from LSDJ.

I bounced this twenty-second clip to a stereo mix, and then opened it in Spear, a specialized granular synthesis engine. Spear analyzes the audio data and breaks it into its constituent sine wave partials, visualizes the partials on a graph, and resynthesizes the source material granularly. It also allows you to timestretch and move the partial data in a lot of different ways. So basically, I slowed the whole file down to a tenth of its original speed, then chopped the heck out of it, moving partials around all over the place.

That’s what you’re hearing. The love child of several technologies that may or may not have been intended for use on the same project. The noise created when an Aqua Teen mp4 file is read as audio. The sound…of death?

How to Hack a Mac OS X Password

Posted on 30th April 2011 in Tutorials

I may have mentioned some time ago that I learned how to change Mac passwords without knowing the current password. Whether or not I did, I do know how to do it, and I do feel like sharing today. To be clear, this is a brief tutorial on how to change the password for one Mac user account on a computer to which you have physical access, in order to gain administrative privileges. This method doesn’t create a new user, it only changes the password of an existing one. As such, it does cause the password stored in that user’s keychains to fail, meaning that next time that user logs in, they’ll be prompted repeatedly for their newly changed password. I understand that this knowledge could pretty easily be used maliciously – have some self control, seriously. Knowing how to do it should be enough, you don’t need to break your school’s grading system or anything like that.

So before we start, you should know that there is a slight bit of prerequisite knowledge required. You should be comfortable with the command line interface, and knowing UNIX well is a big plus. I would just hate for you to try and follow this tutorial and then realize too late that you’re in over your head and accidentally breaking things. So, if you need it, here‘s a good tutorial on command line basics. Do it, and then do another, and then come back and break into your own Mac.

If the above paragraph doesn’t apply to you, let’s get started. In English, the general process for changing the password is to gain root access to the system, find the user account to change the password for, change the password, and reboot. If you were trying to do this remotely, the hardest part would be gaining root access, but as we have physical access to the computer, it’s completely trivial.

To get root access, boot into single-user mode by holding down Command+S (or Apple+S, if you prefer) as you start the computer. That is, from the shut-down state, turn on the computer while holding down Command+S. The normal boot sequence won’t happen – instead you’ll be dropped to a UNIX prompt as the root user.

As a preliminary note, the $ preceding commands represents the shell prompt.

———————————————-

It’s generally a good idea to take this opportunity to check the hard disk for errors before mounting it. I like to do it for the peace of mind. The command to check the disk is

$ /sbin/fsck -fy

This will run the same check that’s run when you click “Verify Disk” in Disk Utility. It takes a little while, and it may look like it’s frozen, but it’s really not. It just takes a while. Once it’s done, mount the filesystem with

$ /sbin/mount -uw /

The slash on the end refers to the mount point of the filesystem, meaning the root directory. Now that the filesystem is mounted, load the Apple directory services commandline utility with

$ launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

Now you can use the dscl command to perform some simple operations on the computer’s list of users. First off, you want to see the names of all of the accounts on the system. You can get a listing easily using the following command.

$ dscl . list /Users

You’ll see a listing of all of the machine’s accounts, most of which start with an underscore. Most of these are accounts required for the proper operation of the system, but you never see them. You can ignore these. The ones you’re interested will be near the bottom of the list, without underscores. Generally, if you’re on a personal computer, you’ll be able to deduce which account has administrative rights, because it will be the one named after the person who owns the computer. If this isn’t the case, though, and you see a bunch of users with similar or ambiguous names, there’s an easy way to find out if a user has admin rights. Just enter

$ groups theusernamehere | grep admin

Replace “theusernamehere” with the name of the user you want to check admin rights for. If the command returns anything, this means that the user is an admin. You’ll also see the word “admin” among the groups in the command’s output. If not, they’re not an admin. Alternately, you can delete everything in the command after the user name and manually scan each output for the word “admin”. Use a bit of trial and error to find out who the administrator of the computer is. Once you’ve done that, changing their password is trivial. The command is

$ passwd theusernamehere

Replace “theusernamehere” with the exact username of the account you want to change. You’ll be asked to type and retype the new password for the user. Don’t be surprised that nothing appears when you type the password, that’s normal. Just reboot using

$ reboot

and log in as the user whose password you just changed. Congratulations, the system is now at your mercy.

———————————————-

As an alternative to this method, it’s possible to redo the setup that ran once when the computer was first started and create a new admin account that way. To do that, after you’ve mounted the filesystem, use

$ rm /var/db/.AppleSetupDone

to delete the file that indicates the completion of the initial setup. Then, when you reboot, you’ll go through the account creation process as if it was the first time you ever started the computer.

So there you go, be responsible with how you use this information. Try the process out though, it’s an incredible feeling the first time you break into a computer, even if it’s your own.

Bill Withers and Mice in Java

Posted on 29th April 2011 in Something Daily

The few weeks before finals are never fun. I have way more stuff to be doing than time to do it in, and my desire to be productive is inversely proportional to how nice the weather is. But I think I spend too much time thinking about how much work I should be doing, which generally increases stress instead of decreasing it. Let’s just talk about what’s already done.

I had a long mix session last night for my second project for recording technology class, a cover of Bill Withers’ “Use Me”. The session seemed to go on forever, and I was totally cranky and tired by the end of it, but listening to our mix this morning, it sounds even better to me than it did last night. This is our rough mix, check it out.

Use Me by Raised by Robots

I played the clavinet part (not a real clav, unfortunately) and helped engineer and produce the whole thing. This has been a fun project, and it’s awesome to have another track for my portfolio.

I also was asked to present a project I did for my CS 101 class last year to the current 101 class, to give them ideas and confidence for the upcoming final project. I made this game where your cursor is a mouse and your move around collecting falling cheeses and avoiding mousetraps. Since making it, the laptop that I bring around with me has become an Ubuntu machine, and as a result, certain things I was doing in terms of graphics weren’t working anymore. So I just spent an hour or so fixing my year-old code to work on my new system, and taking a trip back in time as I did so. It’s interesting to look at my own old code and see how my practices have developed. When I finished the mouse game last April, it was throwing multiple NPEs per second as a result of some oversights I made at the time that I didn’t realize would affect performance on some systems. Clearing those up did the trick, though, and now I’ll be presenting my old work to a class of hopeful 101 students. I’m actually really excited, I love the opportunity to share knowledge (and be in a position of some power).

I think I’m going to put up the code for that old mouse game via webstart some time soon. It’s actually really addicting.

Ubuntu Natty Narwhal first impression

Posted on 28th April 2011 in Something Daily

So of course I downloaded Ubuntu 11.04 Natty Narwhal at my earliest convenience, which ended up being 9:30 this morning. I got incredibly fast download speeds for the computer science building (1100 kBps), which is strange for a network that usually kicks me off once every twenty minutes. But yeah. I downloaded it, and I’m using it now, and I like it, for the most part.

Good things about it include the new docking and window sizing options in Unity: you now have the option to automatically size a window by dragging it to a side of the screen. Docking on the left or right edge maximizes the window vertically and gives it half of the total screen width, so it’s easy to place two halfscreen windows next to each other. Also, docking on the top of the screen now maximizes the window, which I so far find alternately annoying and convenient. I find myself accidentally maximizing windows when I just wanted to move them up. Despite that, this is a great new addition to the user interface, because it provides a number of intuitive ways to do the same thing, none of which are confusing. This means that if you’re just meeting Ubuntu after using a different OS for a while, it’s more likely that you’ll have an easy time getting used to the interface.

The fact that the upper menu bar doesn’t really exist anymore is awesome. It bothers me to have “fullscreen” applications that don’t actually use the whole screen size, and this problem is diminished significantly with the consolidation of the global menu bar and the application menu bar. The new Firefox does something similar, doing away with some of the older default menu buttons in favor of a more streamlined, functional design. I like it.

I’m not so sure about the new applications dock menu thing. I’m having trouble finding the view settings for it, which I want to change because it looks too fisher-price with the huge rounded square buttons. I don’t know if there are other settings, but I’d like to use one if there are. The trash, desktop, and dock are all gone now, which makes me think of Mac OS X’s UI: everything is contained in the dock, with open applications indicated only there, instead of the older, Windows-esque tray method that contained an entry for each window. I’m ok with this, but it’ll take a little bit of getting used to.

Of course I think it’s awesome. I don’t have to tell you that. You knew that already. I love Ubuntu right now. This is the best interface it’s had since at least Intrepid (which I mention only because that’s the oldest distribution I’ve ever used). Download Ubuntu. It’s free, it’s awesome. Go.

comments: 1 » tags: , , ,