bsnes upx'd?

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

Use: "upx -d bsnes.exe"
:|
Panzer88
Inmate
Posts: 1485
Joined: Thu Jan 11, 2007 4:28 am
Location: Salem, Oregon
Contact:

Post by Panzer88 »

"Windows cannot find 'upx'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search."
[quote="byuu"]Seriously, what kind of asshole makes an old-school 2D emulator that requires a Core 2 to get full speed? [i]>:([/i] [/quote]
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

You need to download UPX first, then put it into a directory in your PATH variable, like Windows, System32, etc...

Then try the above command.

Or you can put it in the same directory as BSNES.exe then try.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Or just ignore it, as it's pointless. In the case of bsnes, it really doesn't make much of a difference once it's downloaded whether it's UPX'd or not.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Panzer88
Inmate
Posts: 1485
Joined: Thu Jan 11, 2007 4:28 am
Location: Salem, Oregon
Contact:

Post by Panzer88 »

so once I put the files in the system32 folder and run the command that means it has "-d" or removed whatever from bsnes, hmm that was fast.

I = command prompt noob.

thanks mudlord.

@nach

I know, it's not so much to "fix it" as it is to understand what the hell is going on, it helps satisfy my curiosity.
[quote="byuu"]Seriously, what kind of asshole makes an old-school 2D emulator that requires a Core 2 to get full speed? [i]>:([/i] [/quote]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

You can read the UPX page for more details http://upx.sf.net, almost every app by people like us is UPX'd.

Last I checked, apps like ZSNES, Snes9x, SNEeSe, bsnes, NSRT, NSRT Frontend, NF DLLs, all used UPX.

The only time it doesn't pay to UPX an executable is when it's really large and most of it is unused. I recommend leaving things UPX'd, unless it's some monstrosity like MAME or MESS, or anything else which has 30MB executables where 90% of the code is never ran.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
byuu

Post by byuu »

Last I checked, apps like ZSNES, Snes9x, SNEeSe, bsnes, NSRT, NSRT Frontend, NF DLLs, all used UPX.
Yep. SNESGT and no$gba also use it. The latter is interesting, too. You can decompress it with UPX, but it won't run anymore. Somehow the author added protections to the post-UPX'ed executable that verifies the checksum of the program. I'm sure there's lots of ways to do it, and that I could break the check with a debugger, but I don't really care. It's just one more reason not to use that app in my opinion.

The only active SNES emulator that doesn't use UPX is Super Sleuth.
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

Somehow the author added protections to the post-UPX'ed executable that verifies the checksum of the program.
There is out there tools that mangle the PE header after UPX has had its fun. Lots of apps use this approach...Daemon Tools/Alcohol 120% (uses this in conjunction with VMProtect), Project64 1.7, Y.A.S.U (a virtual drive cloaking utility)...but as you said, all it takes is OllyDbg with OllyDump, to unpack the EXE, and then rebuild the executable without the protection.
ZH/Franky

Post by ZH/Franky »

Wow, allocating 2GB ram to a hello world program.
Only a moron would do that.
Palin
Hazed
Posts: 96
Joined: Tue Nov 08, 2005 12:40 pm

Post by Palin »

Franky wrote:Wow, allocating 2GB ram to a hello world program.
Only a moron would do that.
Why did you make a worthless reply to a post that's two months old?

Oh great, now I'm made a worthless reply to your worthless reply.
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

I got bsnes.exe back to the normal size. 1.57mb

I don't understand why everyone using UPX to compress over compress their program. It doesn't make those to run faster or anything like that. There is nothing special about upx rather than hacking to change the size.

Think about this. Take a normal compress and put into car at the junk yard. Then compress into a box. You have a compress outside and inside.

Anyway those of you doesn't want a compress over compress bsnes then just use upx -d bsnes.exe to set the size back to normal.
Last edited by Dullaron on Sun Mar 30, 2008 9:49 am, edited 1 time in total.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

Uh, it is faster to download a smaller file then a larger file? upx is better then 7zip and other things when it comes to compressing a exe thus making the whole package people need to download, that bit smaller which is good for dial up users.

also byuu has a pitiful 2.5mb webspace >.>
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

Dullaron wrote:I don't understand why everyone using UPX to compress over compress their program. It doesn't make those to run faster or anything like that. There is nothing special about upx rather than hacking to change the size.
upx makes it simpler:
zip: 1) download 2) unzip 3) run
upx: 1) download 2) run
Anyway those of you doesn't want a compress over compress bsnes. http://www.megaupload.com/?d=Y932RPJ0 or just use upx -d bsnes.exe to set the size back to normal.
To decompress a zip, use unzip program. To decompress a upx, use upx program.

Tell me again, what's the advantage of using zip over upx?
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

Yea but...

Most people don't use upx at all.

If it screw their program up then they would stop using it.

Zip programs are much easier to deal. Drag and drop or just zip up then go without typing any commands. I still like 7-zip because of many options it have.

I'm not stopping any of you using upx on a program and then upload it. I will resize it back after download it. To me upx is pointless to make programs smaller size when I can just zip it a lot faster.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
AamirM
Regen Developer
Regen Developer
Posts: 533
Joined: Sun Feb 17, 2008 8:01 am
Contact:

Post by AamirM »

byuu wrote:Yep. SNESGT and no$gba also use it. The latter is interesting, too. You can decompress it with UPX, but it won't run anymore. Somehow the author added protections to the post-UPX'ed executable that verifies the checksum of the program. I'm sure there's lots of ways to do it, and that I could break the check with a debugger, but I don't really care. It's just one more reason not to use that app in my opinion.
How can you say it is a protection? I mean what error does it give?Decompress Regen using upx and run it. It will also not run. This does not mean that I have added protection. It just happens to be that when you upx-compress a stripped program (using strip from gnu binutils) it will run fine until you upx-decompress it after which it will not run. Maybe it only happens when one uses MSVC compiler (I didn't check with GCC).

Although I am in favour of using upx (that is why I use it for Regen), I do want to tell that programs with large bss section *can* consume large memory when upx'ed. Try compressing my Nugen emulator (available from the link in my signature). When not upx'ed it will use 7-8 MB. When upx'ed it uses 22-24 MB even with compression level 1. That is over 300% more. That is why I distribute it uncompressed. The reason Nugen has large bss section is because it uses three 68k emulators which have their big instruction jump tables in there and many other things too. So its not right to say that upx just takes around 200k more memory.

Thirdly, Windows seems to report wrong memory usage when most of the program and/or Windows files themselves are in virtual memory. I remeber Nugen running on a Pentium 3 with 192 MB RAM with King of Fighters 98 loaded. Windows' task manager reported that Nugen was using 4MB. The ROM files themselves are over 90 MB in size when loaded in memory decompressed. So I think its actually Y~K that has the problem.

But the point is, as Nach said:
Nach wrote:In the case of bsnes, it really doesn't make much of a difference once it's downloaded whether it's UPX'd or not.
byuu

Post by byuu »

We're still talking about this??

I use UPX because it makes the ZIP file smaller. That means less bandwidth is used, and more webspace is available for other files.

I'm sorry for being so negative recently, especially toward your posts, Dullaron. It's not intentional, I'm just getting kind of worn out here. Maybe need to take a break for a while.

You want to decompress it after downloading? Fine. You want to distribute the decompressed one? You're violating the licensing agreement, but I don't really care. Whatever, it's your time. Pretend it saves all the memory you want.

Why is this a focus on bsnes, anyway? Go bug pagefault, TRAC, GIGO and anomie or something. They all use UPX as well.
How can you say it is a protection? I mean what error does it give?
It specifically tells you that the program was modified, and to re-download it.
It just happens to be that when you upx-compress a stripped program (using strip from gnu binutils) it will run fine until you upx-decompress it after which it will not run. Maybe it only happens when one uses MSVC compiler (I didn't check with GCC).
bsnes uses strip + UPX, and you can decompress and run it just fine. I've also used an MSVC build with UPX (obviously without strip involved), and that also works fine. If it's failing for you, then you've probably found some sort of bug in UPX. Well whatever, don't use UPX for your project then.
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

bsnes is 472kb (resize)

bsnes in the zip is 442kb (resize and zip)

bsnes is 1.57mb (not resize)

bsnes in the zip is 534kb (not resize)

You only lost 62kb from 442kb (resize and zip)

534kb is not going to kill anybody. Dual up can even download it without waiting 30 minutes to get it. There is no waste at all. Just 62kb more.

Who still on dual up anyway? Not me.
byuu wrote:Pretend it saves all the memory you want.
I have 3gb of memories and it is enough to run bsnes without worrying about wasting.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
I.S.T.
Zealot
Posts: 1325
Joined: Tue Nov 27, 2007 7:03 am

Post by I.S.T. »

It saves him bandwidth, dude. In turn, it saves the guy who is hosting him bandwidth.
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

He can always use http://www.megaupload.com/ and other host websites. Don't have to pay anything. Plus he will be saving bandwidth and money.

Anyway I will stop talking about it.

I did remove the link. Sorry about that byuu.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
byuu

Post by byuu »

62kb * 10,000 downloads / month = ~600mb bandwidth savings

And oh yeah, I should start posting official releases on megaupload.com. Yeah, let's make everyone wait 45 seconds to download each binary, require them to have flash (don't correct me if I'm wrong -- it's not the point and I don't care), and hope that said site stays benevolent.

... or we can drop the matter. I like that option best :)

And no problems, by the way. Sorry for being crabby.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

byuu wrote:Go bug pagefault, TRAC, GIGO and anomie or something. They all use UPX as well.
But WE don't give a rat's ass about people complaining. >:D
So they focus on people who do.

Btw, moving this in its rightful place.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
henke37
Lurker
Posts: 152
Joined: Tue Apr 10, 2007 4:30 pm
Location: Sweden
Contact:

Post by henke37 »

I like upx for a different reason:
It can properly read those not so proper executables that some old compilers created and then output something that recent windows versions will happily run.
Because it sucks when you don't get to play your old games that rivals snes games in age.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

henke37 wrote:I like upx for a different reason:
It can properly read those not so proper executables that some old compilers created and then output something that recent windows versions will happily run.
Because it sucks when you don't get to play your old games that rivals snes games in age.
You can generally fix that with editing the binary to enable all memory permissions, like with the utility that byuu once posted here.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

About how much bandwidth does the bsnes website use every month?
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

FitzRoy wrote:About how much bandwidth does the bsnes website use every month?
1.21 giggawatts.
Watering ur plants.
Locked