One thing I've always found annoying when working with batch files is that when I double-click one, it starts in my home directory instead of the directory that contains the batch file. I decided to look for a way to fix this, so I started experimenting in the registry a bit, and came across a solution. All you need to do is change the "command" entry for .bat and .cmd files from ""%1" %*" to "cmd /c cd "%1\.." & "%1" %*". Sound complicated? Just download the file below and open it, making sure to say Yes to any warnings.
Here's the file you need to fix the issue I described.
Use this one to go back to the old behavior if you change your mind.
Search This Blog
To adblock users
Hello! If you see this, you are most likely using an ad blocker. (Or maybe you have JavaScript disabled. Or maybe my web server is down.) I have no problem with ad blockers; in fact I use one myself. If a site tries to deny me access unless I disable it, I just find a way to circumvent that. But if a site politely asks me to do so, but still allows access to the site, I disable it for the site. I am asking you to please do the same for this site. I can't make you, but I would appreciate it. Thank you! :-)
Thursday, December 11, 2014
Sunday, September 28, 2014
Hacking the Bose Soundtouch, and its Linux-based OS
Did you know that the Bose SoundTouch line of home stereo systems runs on an embedded Linux system, complete with a shell? It does, and I figured out how to access said shell. Keep in mind that I take absolutely no responsibility for any damage you may do, and while if you know what you're doing I don't see how anything could go wrong, I still don't take any responsibility if you do manage to mess something up.
First of all, you're going to need a telnet client. I use PuTTY myself, but if you're on a Mac or Linux, you can just open a terminal and use the telnet command. Now figure out your device's IP address. It will tell you this when you set up your device in the Soundtouch app.
The first step is to telnet to the device on port 17000. You should see a "->" prompt. At this prompt, type "remote_services on" without quotes (you shouldn't include quotes for anything in this tutorial.) The device will respond with "remote services on". At this point you can simply close the connection, but there's also some other interesting stuff you can do here. You can type "help" to get a list of all the commands this prompt supports, or click here to see it on Pastebin.
Anyway, that command you just typed enabled remote shell access to the device. According to the aforementioned help screen, that command is "volatile", which I assume means if you restart the device you'll have to re-enter the command on port 17000 to re-enable shell access.
But from here accessing the shell is simple. Just telnet to the device again, this time on port 23, the default telnet port. You'll see the following screen:
_______ __ __ __
| __| |--.-----.| | |--.--.--.
|__ | | -__|| | _ | | |
|_______|__|__|_____||__|_____|___ |
|_____|
login:
Simply type "root" and press Enter. Some information will be printed, and then you'll be greeted with "root@lisa:root#". (I wonder who Lisa is?)
Enjoy your newfound freedom to hack your device!
EDIT: Upon first suspecting the existence of a shell after looking at a firmware update file in a hex editor, I contacted support to ask how to access the shell. Shortly after I figured out this method on my own. But then they emailed me back and said they weren't allowed to tell me because the information was "proprietary in nature." Good thing I'm not bound by the same contractual restrictions as their support personnel!
First of all, you're going to need a telnet client. I use PuTTY myself, but if you're on a Mac or Linux, you can just open a terminal and use the telnet command. Now figure out your device's IP address. It will tell you this when you set up your device in the Soundtouch app.
The first step is to telnet to the device on port 17000. You should see a "->" prompt. At this prompt, type "remote_services on" without quotes (you shouldn't include quotes for anything in this tutorial.) The device will respond with "remote services on". At this point you can simply close the connection, but there's also some other interesting stuff you can do here. You can type "help" to get a list of all the commands this prompt supports, or click here to see it on Pastebin.
Anyway, that command you just typed enabled remote shell access to the device. According to the aforementioned help screen, that command is "volatile", which I assume means if you restart the device you'll have to re-enter the command on port 17000 to re-enable shell access.
But from here accessing the shell is simple. Just telnet to the device again, this time on port 23, the default telnet port. You'll see the following screen:
_______ __ __ __
| __| |--.-----.| | |--.--.--.
|__ | | -__|| | _ | | |
|_______|__|__|_____||__|_____|___ |
|_____|
login:
Simply type "root" and press Enter. Some information will be printed, and then you'll be greeted with "root@lisa:root#". (I wonder who Lisa is?)
Enjoy your newfound freedom to hack your device!
EDIT: Upon first suspecting the existence of a shell after looking at a firmware update file in a hex editor, I contacted support to ask how to access the shell. Shortly after I figured out this method on my own. But then they emailed me back and said they weren't allowed to tell me because the information was "proprietary in nature." Good thing I'm not bound by the same contractual restrictions as their support personnel!
Tuesday, September 16, 2014
I haven't died!
I just noticed I haven't posted to this blog in over a year! (Until now, that is.) That's never happened before. I think that's mainly because I've been posting things in other places, like on Twitter, and on my website (which, unlike this blog, is on my server! .....nobody remembers what I'm referring to, do they.....)
Wednesday, September 11, 2013
Perspective level editor download
As I have stated in my last post, I was recently given permission to release the Perspective level editor. In addition to the editor, this contains the entire game with its files extracted in a way where it's easier to mod.
Download the editor here: http://www.mediafire.com/?b2qdoq0a3845yv8
Download the editor here: http://www.mediafire.com/?b2qdoq0a3845yv8
Tuesday, July 02, 2013
Perspective level editor (now released!)
UPDATE: I have finally been given permission to share the editor! This is the same version I've been using, with all of its bugs, as unfortunately it is no longer in development. See my next post for the download link.
I recently found this game called Perspective, made by some students at DigiPen. Anyway, after completing the game, I went looking through its files to see what could be modded. I was excited to see that all the game's files (with the exception of sounds) were in standard, well-known formats (PNG for textures, OBJ for models, etc.) and all the menus were defined as HTML code. All the files were located inside a file called Default.bin, which is actually a ZIP file with a different extension. To my disappointment, however, when I went to extract the files, I saw that for some reason they had decided to put a password on the archive.
I recently found this game called Perspective, made by some students at DigiPen. Anyway, after completing the game, I went looking through its files to see what could be modded. I was excited to see that all the game's files (with the exception of sounds) were in standard, well-known formats (PNG for textures, OBJ for models, etc.) and all the menus were defined as HTML code. All the files were located inside a file called Default.bin, which is actually a ZIP file with a different extension. To my disappointment, however, when I went to extract the files, I saw that for some reason they had decided to put a password on the archive.
I was curious, so I sent them an email. A little under a week or so later, I got an email from Pohung Chen, the lead programmer for the game. He explained that he encrypted the files because he believed modifying the game as it is would be, in his words, "quite sloppy". He later sent me a copy of the game without the files encrypted (or even zipped), as well as an early version of the level editor. I thanked him, and asked him if it was okay to post it anywhere, and unfortunately he said no (outdated). He did, however, say that they plan on releasing it at some point in the near future. Sean Reilly, another programmer, also contacted me, and has been helping me out with the editor, which according to the About box, is still "pre-alpha".
"Pre-alpha" is a good way of describing the editor. It crashes quite often, and it's obvious it's not quite ready for release. It's still usable, however, with frequent saving. Anyway, I'll go over how the editor works, so you know what to expect once it's officially released. The screenshot above shows "The Machine", the final level in the game, opened in the editor. The left side shows a list of every level in the game, including many which were cut and are impossible to play without enabling the level select menu. (There are actually some pretty interesting levels in there. One of my favorites is called "Stairs", which took me a while to figure out.) Any level can be opened and edited by double-clicking it in the list, and once it's loaded, it expands to show every object in that level.
The panel on the right is referred to as the "editor window". The Properties tab (pictured) shows the properties of the currently-selected object. For most objects the properties do not need to be messed with, but they can be used to change the texture, for instance, and to make the object rotate. The Objects tab shows a list of every object that can be placed in a level. It is a simple tree view, similar to the one on the left, and shows all the objects in different categories. An object can be selected in the list, and then placed in the level by clicking. The Groups tab lets you save groups of objects in the level to be easily selected all at once later, and can even be used to save several objects into a single object which can be directly placed, similar to a prefab. The Rails tab lets you edit lists of fixed camera positions to be automatically moved to. This is really only used once in the game—in the third level of "Orthographic" when the camera moves to create a path to the exit. Last but not least, the Cameras tab lets you change what determines the point of view shown in the editor. The vast majority of the time you'll want this set to "Editor camera", which lets you move the camera independently of anything else. You would want to change it, however, if you're positioning something like the 3D player starting position.
Each level is built out of premade models. It's very much like building dungeons in Skyrim's Creation Kit. Of course, it's quite easy to import your own models, as it's only a matter of exporting the model to Wavefront format and creating an entry in the object list for it. Objects or groups of objects can be moved, rotated, and even scaled like in a 3D modeling program. They can also be duplicated when moving them by holding Shift. One of my favorite parts of the editor is the fact that you don't need to start the game and load the level manually to test it. There's a "play" button right there, which instantly opens that level in the game. It's even possible to test a level without saving it first (though again, it's a good idea to save frequently considering how often it crashes.) Moving objects (not just rotating) can be created by using keyframe animation in a timeline window at the bottom. Any numeric property can be animated this way; even the colors of lights.
Monday, March 18, 2013
Github repository
You might be interested to know that I've created a repository on Github for posting some of the miscellaneous C programs (well, it's all C so far) I write.
Access the repository here: https://github.com/flarn2006/MiscPrograms
Please note that this means I'm probably also not going to post them all here anymore. Just keep checking the repository.
Access the repository here: https://github.com/flarn2006/MiscPrograms
Please note that this means I'm probably also not going to post them all here anymore. Just keep checking the repository.
Friday, February 01, 2013
Disabling Mathematica's "Locked" attribute
In Wolfram's Mathematica, there's an attribute called Locked which, when set, makes it impossible for the end-user to change that symbol's attributes, including by removing that attribute. (Note that I use the word "impossible" loosely.) Now this is a problem, because there are other attributes that do things like prevent Mathematica from showing you the source code to functions. To make matters worse, it contains a function that encodes Mathematica package files in a way that Mathematica is able to execute, but won't show the user, which makes it difficult to remove the offending lines of code.
Mathematica 9 was recently released, and unfortunately this does not work anymore in Mathematica 9. (See below for an experimental method for version 9.) If you have a copy of Mathematica 8 or earlier, however, you can prevent this attribute from being set on imported symbols. You simply need to take advantage of a loophole in the way Mathematica imports package files, encoded ones included.
Normally, when you load a package file, you do something like Get["package.m"]. When you do this, it keeps user definitions of symbols, and respects them when reading in the source code. So all we need to do is redefine Locked to an empty Sequence, so it will be automatically omitted from any lists it appears in. The Locked attribute is protected, but isn't itself Locked until Mathematica 9.
Here's the code you need to run before loading the package (put it in your init.m):
Unprotect[Locked]
Locked = Sequence[]
Now the package will be imported with everything unlocked.
One potential problem with this is that a clever programmer might see this coming and remove your definition of Locked at the beginning of the package. We could Protect it, but the package could still Unprotect it. Say, isn't there an attribute that prevents this?
In case it wasn't obvious, the solution is to Lock your new definition of Locked. I love the irony here, by the way. But remember, we redefined Locked to be harmless, didn't we? So the solution to this is kind of tricky.
Mathematica includes a function called Block. What this function does is let you execute code using temporary values for variables which are then reset to what they were before. If no value is given for a variable, it temporarily clears that variable's definition. Normally this function resets the symbol's attributes as well, but it doesn't if the Locked attribute becomes set during execution, so this still works.
So the new code would be:
Unprotect[Locked]
Locked = Sequence[]
Block[{Locked}, Attributes[Locked] = {Protected, Locked}]
Now when the package loads, you'll probably see something like this, but the package will still be imported just fine.
Protected::locked : Symbol Locked is locked.
ClearAll::locked : Symbol Locked is locked.
All that's left to do now is un-ReadProtect the functions you want to see. Now that they aren't Locked, this won't be a problem. Have fun! :-)
Edit: In hindsight, it may be possible for a package to do the same thing with Block. I imagine I would have tested that, but I don't remember for sure, and unfortunately I don't have Mathematica 8 installed anymore, so I can't test now to be sure. Luckily, however, the method described below should work as well.
Update: It is also possible to actually rename the Locked attribute internally, which does work on Mathematica 9, as well as 10. This does have some side effects however; for instance, if a package tries to add that attribute using SetAttributes, none of the given attributes will be added. But at least you'll still be able to un-ReadProtect whatever you want. All you have to do is open mathdll.dll (located in [your Mathematica install directory]/SystemFiles/Kernel/Binaries/[your platform folder]) in a hex editor. Then search for the string "Locked" in the file. Make sure it's not part of something longer, like "LockedStack". Find one where it just says "Locked". Then just change it to some other six bytes that won't get in the way.
Yet another workaround: If you just want to see the definitions of functions, encasing the package's Get in Trace[] will also show some definitions, based on my testing. The ideal solution, of course, would be a method of decoding packages encoded using Encode, but I haven't been able to figure it out.
Mathematica 9 was recently released, and unfortunately this does not work anymore in Mathematica 9. (See below for an experimental method for version 9.) If you have a copy of Mathematica 8 or earlier, however, you can prevent this attribute from being set on imported symbols. You simply need to take advantage of a loophole in the way Mathematica imports package files, encoded ones included.
Normally, when you load a package file, you do something like Get["package.m"]. When you do this, it keeps user definitions of symbols, and respects them when reading in the source code. So all we need to do is redefine Locked to an empty Sequence, so it will be automatically omitted from any lists it appears in. The Locked attribute is protected, but isn't itself Locked until Mathematica 9.
Here's the code you need to run before loading the package (put it in your init.m):
Unprotect[Locked]
Locked = Sequence[]
Now the package will be imported with everything unlocked.
One potential problem with this is that a clever programmer might see this coming and remove your definition of Locked at the beginning of the package. We could Protect it, but the package could still Unprotect it. Say, isn't there an attribute that prevents this?
In case it wasn't obvious, the solution is to Lock your new definition of Locked. I love the irony here, by the way. But remember, we redefined Locked to be harmless, didn't we? So the solution to this is kind of tricky.
Mathematica includes a function called Block. What this function does is let you execute code using temporary values for variables which are then reset to what they were before. If no value is given for a variable, it temporarily clears that variable's definition. Normally this function resets the symbol's attributes as well, but it doesn't if the Locked attribute becomes set during execution, so this still works.
So the new code would be:
Unprotect[Locked]
Locked = Sequence[]
Block[{Locked}, Attributes[Locked] = {Protected, Locked}]
Now when the package loads, you'll probably see something like this, but the package will still be imported just fine.
Protected::locked : Symbol Locked is locked.
ClearAll::locked : Symbol Locked is locked.
All that's left to do now is un-ReadProtect the functions you want to see. Now that they aren't Locked, this won't be a problem. Have fun! :-)
Edit: In hindsight, it may be possible for a package to do the same thing with Block. I imagine I would have tested that, but I don't remember for sure, and unfortunately I don't have Mathematica 8 installed anymore, so I can't test now to be sure. Luckily, however, the method described below should work as well.
Update: It is also possible to actually rename the Locked attribute internally, which does work on Mathematica 9, as well as 10. This does have some side effects however; for instance, if a package tries to add that attribute using SetAttributes, none of the given attributes will be added. But at least you'll still be able to un-ReadProtect whatever you want. All you have to do is open mathdll.dll (located in [your Mathematica install directory]/SystemFiles/Kernel/Binaries/[your platform folder]) in a hex editor. Then search for the string "Locked" in the file. Make sure it's not part of something longer, like "LockedStack". Find one where it just says "Locked". Then just change it to some other six bytes that won't get in the way.
Yet another workaround: If you just want to see the definitions of functions, encasing the package's Get in Trace[] will also show some definitions, based on my testing. The ideal solution, of course, would be a method of decoding packages encoded using Encode, but I haven't been able to figure it out.
Tuesday, July 31, 2012
Fixing the color palette in Windows 7's version of Paint
This is a screenshot of the Windows 7 version of Paint.
Looks like a big change from the older versions, right? It has a few new features, like additional shapes and brush types. However, one thing that has bothered me is the color palette, which, like in the Vista version, has different, non-"pure" colors.

See what I mean? In case you don't, I'll explain: the red in that palette isn't the purest red your computer can display. Instead of RGB(255,0,0), or #FF0000, it's RGB(237,28,36), or #ED1C24. Not that big of a difference in text, but as you can see the difference is much more pronounced in the other colors, such as green. Can't I just have a pure green without having to use the custom color function all the time? Why couldn't Microsoft have made a palette like this instead?

Well, from my other posts you may have noticed that a lack of source code doesn't always stop me from making programs work better. :-) After figuring out where the color palette is stored, I was able to change the palette to the one above.
To download my modified version, click here:
http://www.mediafire.com/?ggmaeevgb2ezn7n
Note that if Microsoft asks me to remove this, I will, and I will figure out some other easy way to modify it, like some kind of patching tool.
In case you want to edit the colors yourself, click here to see my notes on the hexadecimal offsets of the color values. If you find them confusing, just post a comment and I'll try my best to explain.
Looks like a big change from the older versions, right? It has a few new features, like additional shapes and brush types. However, one thing that has bothered me is the color palette, which, like in the Vista version, has different, non-"pure" colors.
See what I mean? In case you don't, I'll explain: the red in that palette isn't the purest red your computer can display. Instead of RGB(255,0,0), or #FF0000, it's RGB(237,28,36), or #ED1C24. Not that big of a difference in text, but as you can see the difference is much more pronounced in the other colors, such as green. Can't I just have a pure green without having to use the custom color function all the time? Why couldn't Microsoft have made a palette like this instead?
Well, from my other posts you may have noticed that a lack of source code doesn't always stop me from making programs work better. :-) After figuring out where the color palette is stored, I was able to change the palette to the one above.
To download my modified version, click here:
http://www.mediafire.com/?ggmaeevgb2ezn7n
Note that if Microsoft asks me to remove this, I will, and I will figure out some other easy way to modify it, like some kind of patching tool.
In case you want to edit the colors yourself, click here to see my notes on the hexadecimal offsets of the color values. If you find them confusing, just post a comment and I'll try my best to explain.
Sunday, March 04, 2012
playnotes.c
First post in a while! Anyway, I was playing around with libao, and I ended up creating a simple program that plays a string of notes on the command line. The only limitations I can think of are that all notes need to be the same length and there are no flats or sharps. There is also a clicking noise in between notes, but I kind of like this as it makes it so consecutive identical notes don't just sound like longer single notes.
The syntax is pretty simple. You run the program with a string of notes as the first argument, and an optional note length (in seconds) as the second argument. As for the string of notes, any letters from A to G play their respective notes, and + and - go up and down an octave respectively. Any other characters act as rests, pausing for the same amount of time as one note.
Here's a link to the source code: http://pastebin.com/4Bwr5hiv
Remember; you need libao (http://xiph.org/ao/) to compile this. Once that library is installed, compile it with gcc -o playnotes -lao playnotes.c.
The syntax is pretty simple. You run the program with a string of notes as the first argument, and an optional note length (in seconds) as the second argument. As for the string of notes, any letters from A to G play their respective notes, and + and - go up and down an octave respectively. Any other characters act as rests, pausing for the same amount of time as one note.
Here's a link to the source code: http://pastebin.com/4Bwr5hiv
Remember; you need libao (http://xiph.org/ao/) to compile this. Once that library is installed, compile it with gcc -o playnotes -lao playnotes.c.
Tuesday, August 09, 2011
How to get rid of NOD32 without a password
My dad recently gave me an old laptop his office was throwing away, but it came with ESET's NOD32 antivirus software on it. Normally this would be a good thing, but it was preventing me from visiting certain websites because it "suspected" they had a virus, and I needed a password to uninstall it which I did not know. However, I found a way to uninstall it without the password.
I hope this helped!
- Reboot your computer in Safe Mode. (press F8 before the Windows logo appears.)
- Select Safe Mode (or Safe Mode with Networking if you don't want to print this out)
- Log in as Administrator (this might not be necessary, but it's what I did.)
- Click the Start menu and right-click My Computer
- Click Properties, then go to the Advanced tab
- Click Environment Variables
- Under User Variables, click Add
- Type "DEVMGR_SHOW_NONPRESENT_DEVICES" for the variable name, and "1" for the value (without quotes).
- Click OK, and then click the Hardware tab.
- Click Device Manager.
- In the new window that appears, go to View>Show hidden devices
- Uninstall the following devices (Action menu>Uninstall): eamon, eadrv, epfwtdir, and any of them that say "nod32"
- Close Device Manager and the System control panel
- Open your NOD32 installation directory (usually C:\Program Files\ESET\ESET NOD32 Antivirus)
- Delete everything in there except shellext.dll (if you can, it's okay to delete shellext.dll, but for me I couldn't delete it.) Alternatively, move it to another folder.
- Go to Start>Run, and type "msconfig".
- Click the Startup tab.
- Scroll down until you see "egui", and uncheck it.
- Click OK and reboot.
I hope this helped!
Friday, February 18, 2011
C source code to display 2D sine pattern in console
I wrote a program that displays a 2D sine pattern in the console. It's mainly just for fun, as it doesn't really do anything else, but it looks cool.
NOTE: If it gives errors about unresolved externals when you try to compile it, it's because you need to link it with a curses library, such as ncurses or pdcurses.
Source code: http://pastebin.com/n49wmSb3
Sample output: http://pastebin.com/0r38z05H
NOTE: If it gives errors about unresolved externals when you try to compile it, it's because you need to link it with a curses library, such as ncurses or pdcurses.
Source code: http://pastebin.com/n49wmSb3
Sample output: http://pastebin.com/0r38z05H
Sunday, September 19, 2010
Grow HFS+ partition on Mac OS X without Disk Utility
I have Boot Camp set up, and I had shrunk my main Macintosh HD partition to make room for an Ubuntu partition. Turns out I didn't really want it as much as I thought I did, so I used a GPartEd live CD to remove the partition. However, it wouldn't let me grow it back. Turns out GPartEd can't do that. I called AppleCare to ask what I should do, and I was actually on the telephone for a little over an hour. They told me to use Disk Utility to grow the partition. I tried, however, and it gave me the error message "Partition Failed with the error: Filesystem resize support required, such as HFS+ with Journaling enabled." They tried to help, but they weren't able to solve the problem. I came across this forum post, however, and it mentioned the diskutil command, more specifically the resizeVolume subcommand. I tried this, and it worked! Here's what to do if you ever have the same problem:
Here's a screen transcript of what I did in the Terminal in case it helps (highlighted lines represent what I typed): http://pastebin.com/hKMkCsQy
- Open Disk Utility.
- Select the volume you want to grow, and click Info in the toolbar.
- Note the Disk Identifier (from here on referred to as ????), and optionally quit Disk Utility.
- Open the Terminal.
- Type the following command: diskutil resizeVolume /dev/???? limits
- Note the Maximum Size (not the part in parentheses.)
- Type the following command: sudo diskutil resizeVolume /dev/???? [maximum size]
- Enter your password if prompted.
Here's a screen transcript of what I did in the Terminal in case it helps (highlighted lines represent what I typed): http://pastebin.com/hKMkCsQy
Thursday, May 13, 2010
Secret registry settings in Paint: Snap to grid
Did you know that Paint has a secret feature that lets you snap to an invisible grid? This has nothing to do with the grid that you can display when zoomed in. The only downside, however, is that it involves editing the Registry, and therefore only takes effect when Paint is loaded. (You can always, of course, save your picture and reload it when you want to change grid settings.) For your convenience, I have put together 10 regfiles, as follows:- OFF: Disables snapping to the grid. (Default setting.)
- ON: Enables snapping to the grid.
- 1-128: Sets the grid size to whichever number is chosen.
SnapToGrid is the value you change (DWORD, 0 or 1) to turn the grid on or off. GridExtent (DWORD) is the value you change to set the grid size. It does not need to be a power of two, although all the regfiles I provided are. If you find yourself using a certain number a lot, but it isn't a power of two, you can make your own regfile for it.
I hope you find this useful!
Tuesday, February 16, 2010
Extend the 60-second limit in Sound Recorder
You know that annoying 60-second limit in Windows XP's Sound Recorder? (Vista doesn't have it, but don't get me started on what else it doesn't have...) Some suggestions people have are using the Decrease Speed function, clicking the Record button quickly after it stops, or simply using another program. However, if none of these options are doing it for you, I've got a more geeky solution involving a hex editor, such as XVI32, which I'll be using.
You can't really remove the limit, as it works by allocating enough memory for that long a recording, but you can increase (or decrease, if you really want to) the amount of recording time it gives you. Now, you can't go crazy and set it to 9,999,999,999 seconds or something, as you need to have enough memory. (Audacity gets away with this by recording to the hard drive.) 5 minutes, however, is more than enough for most purposes.
(If you're using XVI32, skip the next paragraph.)
First, you're gonna need to convert that to seconds. 5 × 60 = 300 seconds, or 0x12C. Inside the EXE, the limit is stored as a 4-byte long value. You may think that as 4 bytes would be 00 00 01 2C, but the bytes are reversed. Instead, it's 2C 01 00 00. It's confusing, I know, but it's just the way it is.
Anyway, make a copy of Sound Recorder, and open the copy in your hex editor. The limit is stored at address 0x628E, so goto (in XVI32, it's Address>Goto...) that address. Follow the instructions below:
If you're using XVI32:
You can't really remove the limit, as it works by allocating enough memory for that long a recording, but you can increase (or decrease, if you really want to) the amount of recording time it gives you. Now, you can't go crazy and set it to 9,999,999,999 seconds or something, as you need to have enough memory. (Audacity gets away with this by recording to the hard drive.) 5 minutes, however, is more than enough for most purposes.
(If you're using XVI32, skip the next paragraph.)
First, you're gonna need to convert that to seconds. 5 × 60 = 300 seconds, or 0x12C. Inside the EXE, the limit is stored as a 4-byte long value. You may think that as 4 bytes would be 00 00 01 2C, but the bytes are reversed. Instead, it's 2C 01 00 00. It's confusing, I know, but it's just the way it is.
Anyway, make a copy of Sound Recorder, and open the copy in your hex editor. The limit is stored at address 0x628E, so goto (in XVI32, it's Address>Goto...) that address. Follow the instructions below:
If you're using XVI32:
- Go to Tools->Encode number...
- Type 300 (or however many seconds) in the text box.
- Select "longint (4 bytes)" on the left.
- Select "Overwrite at current adress [sic]" on the right.
- Click OK.
- Switch to Overwrite mode if necessary, usually using the Insert key. You should be able to tell which mode you're in by looking at the status bar. It should say either Insert (INS) or Overwrite (OVR).
- Type in the four bytes you calculated above, such as 2C 01 00 00.
Sunday, December 27, 2009
Simple gravity simulator in Visual Basic
I wrote a program in Visual Basic that simulates gravity. Basically, it just simulates a box falling. Not that interesting, but the point is you can look at my code and see how I did it. As you can see from the screenshot, it has two modes: manual step, where you can click the Step button to advance one frame, and automatic, where it runs the simulation in realtime. You can also turn off the gravity, which basically just disables acceleration. The scale is one inch to one meter.
(Now to get some sleep...)
EDIT: I really was tired. I forgot to post the download link! Sorry about that... :-/
Here it is: http://www.mediafire.com/?jzamowkogdd
(Now to get some sleep...)
EDIT: I really was tired. I forgot to post the download link! Sorry about that... :-/
Here it is: http://www.mediafire.com/?jzamowkogdd
Monday, November 02, 2009
Fix audio problems when running XP in Boot Camp
I have Windows XP installed on my MacBook Pro with Boot Camp, and until now I have been having two problems with the audio. One is that the volume is way too low, even at max. The other is that certain programs, such as the Source engine (games like HL2, Portal, TF2, etc.) don't work with the microphone. However I have recently come across a modified driver that fixes both of these problems. I didn't see anything about the mic, but it fixed it for me.
Here's the link: http://www.stuffedcow.net/macbook_audio
To install it, extract the archive to your desktop (it's already in a folder) or anywhere convenient. Then, open Device Manager (Start > My Computer (right-click) > Properties > Hardware tab > Device Manager.) Expand "Sound, video, and game controllers" and double-click "Cirrus Logic HD Audio". When the Properties dialog appears, click the "Update Driver..." button. Choose these responses I have outlined for you here:
Here's the link: http://www.stuffedcow.net/macbook_audio
To install it, extract the archive to your desktop (it's already in a folder) or anywhere convenient. Then, open Device Manager (Start > My Computer (right-click) > Properties > Hardware tab > Device Manager.) Expand "Sound, video, and game controllers" and double-click "Cirrus Logic HD Audio". When the Properties dialog appears, click the "Update Driver..." button. Choose these responses I have outlined for you here:
- No, not this time
- Install from a list or specific location (Advanced)
- Don't search. I will choose the driver to install.
- Have Disk...
Monday, July 27, 2009
AppleScript: Create an empty file with ease
I wrote this simple AppleScript that lets you create an empty file on the Mac, like you could in Windows. Make sure your script menu is enabled (Applications→AppleScript→AppleScript Utility→Show Script menu in menu bar) and then put it in your Library→Scripts folder. Here's the link:
http://pastebin.com/f67bb99ee
By the way, you don't need to cut 'n paste the whole thing. Just click the Download link at the top!
http://pastebin.com/f67bb99ee
By the way, you don't need to cut 'n paste the whole thing. Just click the Download link at the top!
Tuesday, March 03, 2009
3D Shading Editor
I've got a new program for you. It's called 3D Shading Editor. I've got a screenshot here, and the introduction from the Readme file, the latter of which should explain the weird colors in the screenshot. Here's the download link: http://www.mediafire.com/file/joomnm3xmgk/color3d.zip
As I'm sure many of you know, when using the Windows Classic visual style, you can customize the colors of pretty much anything. However, unlike in Windows 3.1, when you change the color for 3D objects, such as buttons and dialogs, the highlight and shadow colors automatically change with it. This may seem nice, but what if you want to specify your own colors for this? Windows doesn't provide any method for this, except for editing the registry or theme files, which can be very inconvenient when you just want to see what it looks like. However, this program can change these colors independently.
As I'm sure many of you know, when using the Windows Classic visual style, you can customize the colors of pretty much anything. However, unlike in Windows 3.1, when you change the color for 3D objects, such as buttons and dialogs, the highlight and shadow colors automatically change with it. This may seem nice, but what if you want to specify your own colors for this? Windows doesn't provide any method for this, except for editing the registry or theme files, which can be very inconvenient when you just want to see what it looks like. However, this program can change these colors independently.
Wednesday, December 31, 2008
Phallic display at Giant deli

I was at Giant the other day, and as I walked by the deli, I saw a decorative display which struck me instantly as looking quite phallic. If you don't know what that means, look it up. My mom and I both think it was made to look that way as a joke by an employee who has the same sense of humor as me. ;-)
EDIT: I just noticed, the "shaft" even has a picture of a rooster (cock) on it!
Tuesday, September 09, 2008
Xbox 360 Controller on PC Without Additional Software
Earlier today, I figured out a way to use an Xbox 360 controller on a PC without downloading or installing any additional software. I got the idea when I read (I forgot where) that the controller is a standard HID device, except it sends the wrong class code (0xFF instead of 0x03) so that generic drivers won't automatically connect to it. This is obviously so that Microsoft could require people to use their special software to get it to work. Possibly so they could make you need to use Windows (although this information is written for Windows and, unfortunately, probably won't help if you're not using it.)
But there is a way to tell the generic drivers to connect to it anyway. Simply plug it in and let it install as an unknown device. Then, open Device Manager (Start, right-click My Computer, Properties, Hardware tab, Device Manager) and find your device. Right-click it and click Properties, and then switch to the Details tab. Make sure "Device Instance Id" is selected at the top, and then make note of everything on the top line up to "PID_XXXX" where XXXX can be any four hexadecimal digits (0-9 and A-F). For example, mine says "HID\VID_045E&PID_028E&IG_00\7&29E276DE&0&0000", so I would ignore everything except for the "HID\VID_045E&PID_028E" at the beginning. You can now close out the Properties dialog. Do that, then right-click the device and click Uninstall.
Now it's time to edit your INF file. Go to Start, Run, and type in "c:\windows\inf\input.inf" (without the quotes.) Notepad should open. If not, do the same thing except add "notepad" to the beginning of the string you type into the Run dialog. Scroll down to the section called "[MicrosoftGame]". Now, in a new line in that section, type in "%XXXX.DeviceDesc%=HID_Inst,, XXXX", replacing each instance of XXXX with that hardware ID you wrote down. (And no, I DON'T just mean those four hexadecimal digits I previously referred to in the same way.) Now scroll down to the "[Strings]" section near the bottom, and type in [XXXX.DeviceDesc="Microsoft Xbox 360 Controller"], not including the brackets. (I used brackets instead of quotes since there are quotes in the string itself.) And the XXXX refers to the same thing as it did last time (the hardware ID you wrote down, including but not limited to those four hexadecimal digits.) Now save the file and exit.
If your controller is still plugged in, unplug it and plug it back in. If not, simply plug it in. If a window appears asking if you want to connect to Windows Update, tell it not to. It may also put up a warning about it not having passed Windows Logo testing. Click "Continue Anyway" on any of these warnings. Eventually, it should finish! Now all there is left to do is go into the Game Controllers control panel, select the controller, click Properties, and calibrate it. Have fun!
P.S. I do recommend XBCD. It's another driver, but it's much better than Microsoft's official one. XBCD+ looks promising, but I haven't tried that yet. Oh, and by the way, I'm not referring to xkcd, the popular webcomic. ;-)
But there is a way to tell the generic drivers to connect to it anyway. Simply plug it in and let it install as an unknown device. Then, open Device Manager (Start, right-click My Computer, Properties, Hardware tab, Device Manager) and find your device. Right-click it and click Properties, and then switch to the Details tab. Make sure "Device Instance Id" is selected at the top, and then make note of everything on the top line up to "PID_XXXX" where XXXX can be any four hexadecimal digits (0-9 and A-F). For example, mine says "HID\VID_045E&PID_028E&IG_00\7&29E276DE&0&0000", so I would ignore everything except for the "HID\VID_045E&PID_028E" at the beginning. You can now close out the Properties dialog. Do that, then right-click the device and click Uninstall.
Now it's time to edit your INF file. Go to Start, Run, and type in "c:\windows\inf\input.inf" (without the quotes.) Notepad should open. If not, do the same thing except add "notepad" to the beginning of the string you type into the Run dialog. Scroll down to the section called "[MicrosoftGame]". Now, in a new line in that section, type in "%XXXX.DeviceDesc%=HID_Inst,, XXXX", replacing each instance of XXXX with that hardware ID you wrote down. (And no, I DON'T just mean those four hexadecimal digits I previously referred to in the same way.) Now scroll down to the "[Strings]" section near the bottom, and type in [XXXX.DeviceDesc="Microsoft Xbox 360 Controller"], not including the brackets. (I used brackets instead of quotes since there are quotes in the string itself.) And the XXXX refers to the same thing as it did last time (the hardware ID you wrote down, including but not limited to those four hexadecimal digits.) Now save the file and exit.
If your controller is still plugged in, unplug it and plug it back in. If not, simply plug it in. If a window appears asking if you want to connect to Windows Update, tell it not to. It may also put up a warning about it not having passed Windows Logo testing. Click "Continue Anyway" on any of these warnings. Eventually, it should finish! Now all there is left to do is go into the Game Controllers control panel, select the controller, click Properties, and calibrate it. Have fun!
P.S. I do recommend XBCD. It's another driver, but it's much better than Microsoft's official one. XBCD+ looks promising, but I haven't tried that yet. Oh, and by the way, I'm not referring to xkcd, the popular webcomic. ;-)
Subscribe to:
Posts (Atom)

