
Starcraft reverse engineered to run on ARM - galapago
http://boards.openpandora.org/topic/15820-starcraft/
======
NamTaf
That's, uh, really impressive. I'd like the author to write about it, because
I'd like to understand how much extra work it took to get compiling from the C
code once it was disassembled by the tools. It'd be interesting to understand
what sort of pitfalls the tools produce, so that the tools can be more
efficiently used to do more work like this.

It's well above my head, but it'd be a fascinating read!

~~~
ekianjo
By the way it's not the first time this is done, there were some other static
recompilations (Xcom i think) done in the same way 3 years ago. But Starcraft
was probably harder.

~~~
kl4m
On a vaguely related note, it doesn't matter much for X-Com since there is a
very, very complete open-source reimplementation:
[https://github.com/SupSuper/OpenXcom](https://github.com/SupSuper/OpenXcom)

~~~
ekianjo
Yeah, and it's also available on Pandora by the way. :)

------
slacka
The tools that he used to convert x86 to C can be found here:

[https://github.com/notaz/ia32rtools](https://github.com/notaz/ia32rtools)

Video of the game running on an OpenPandora here:

[http://www.youtube.com/watch?v=7vWnyDrNQO4](http://www.youtube.com/watch?v=7vWnyDrNQO4).

~~~
agumonkey
Original Minimum Requirements (low-latency internet connection rated at 28.8
KBps+):

    
    
      - 90 MHz Pentium or equivalent
      - 16 MB RAM
      - SVGA video card
      - low-latency internet connection rated at 28.8 KBps+
    

I forgot how few resources this great game needed.

ps: the pandora specs
[http://openpandora.org/portal/index.php?option=com_content&v...](http://openpandora.org/portal/index.php?option=com_content&view=article&id=91&Itemid=6&lang=en)

~~~
sspiff
I used to play it on a 90MHz Pentium with 48MB of RAM, running Windows NT4,
and let me tell you, it did not run well.

I remember there being this one mission where you have to survive for a fixed
amount of time (10min? 15min?), and on this machine it lasted more like half
an hour. Also reminds you how they accounted for time in those days.

Diablo (the first) with the Hellfire expansion ran smooth as butter on the
same machine. I also remember trying to do Python and Java on that machine,
didn't go over to well either, although Python wasn't too bad.

~~~
ordinary
Keep in mind that the speed of Starcraft's ingame time does not necessarily
match your wall clock. It can be faster or slower, depending on game speed
setting.

------
sspiff
This kind of reverse engineering never fails to impress. If you asked me ahead
of time, I'd probably have said "possible in theory, but there would be so
many obstacles to overcome that no one will succeed in practice."

------
GFischer
I thought it had been done for Android first, and apparently it was, with
winulator:

docs.winulator.com/programs

Edit: more info on GsmArena

[http://blog.gsmarena.com/you-can-now-play-starcraft-and-
caes...](http://blog.gsmarena.com/you-can-now-play-starcraft-and-caesar-iii-
on-android/)

"The Winulator doesn’t work like an emulator. It just converts an x86 game
executable to an ARM-friendly one. Here is what you need to do.

You’ll need three things – a computer with installed Winulator Converter
Helper, the original DRM-free game installed on that computer and the
Winulator Android app installed on your phone."

~~~
Sektor
Yes I was a bit confused that this is supposed to be new information, I
installed StarCraft on my android about a year ago using winulator.

It even supports a bluetooth mouse, (which I went and bought the same day I
installed and got working). Works perfectly. like having a '96 gaming PC in
your pocket(s)

I even changed the winulator icon to StarCraft icon then went to the pub and
pulled the mouse out of my pocket, setup my android and made all my iphone-
owning friends $#!^ bricks. Good times.

------
wtracy
I've kicked around the idea of translating machine code to LLVM assembly code
specifically to do things like this.

I actually got as far as creating a GitHub repo to work on this
<[https://github.com/wtracy/recompile>](https://github.com/wtracy/recompile>)
but my code never got farther than some logic for parsing ELF headers.

~~~
jevinskie
I can't wait until I find such a project that is in a usable state! I've tried
all of these (save dagger, no releases yet) and always hit some issue due to
their immaturity.

[https://github.com/libcpu/libcpu](https://github.com/libcpu/libcpu)

[http://dagger.repzret.org/](http://dagger.repzret.org/)

[https://github.com/draperlaboratory/fracture](https://github.com/draperlaboratory/fracture)

~~~
derefr
I think the most stable implementation in this space (if limited in scope)
would be Apple's Rosetta. Sadly both closed-source and now abandoned; if it
was opened up, it'd be great to base a more general A-to-B translator on.

------
AdrianRossouw
I love my open pandora, even though i haven't played much on it recently.

I'll probably also buy the follow up device.

~~~
tluyben2
It's still the only option for long flights if you don't have the $ to pay for
business class (power sockets there); I have a Pandora with 2 batteries (which
are quite small) which is over 20 hours of a system which actually lets you do
your work. Wouldn't have survived my trip of 25 hours last week without it.

~~~
fit2rule
I love my Pandora too .. 10 hours on a single charge, you really can't beat
that. Plus the fact that its a portable Linux workstation just makes it so
damned valuable even when I'm not playing games on the thing ..

I've definitely signed up for the sequel! :)

~~~
tluyben2
We are almost there with other devices; a phone size tablet with a clamshell
keyboard would do, especially if you can hook up a game keyboard, normal
keyboard and mix. Problems are; 1) there are none which qualify, both tablets
and keyboards; somehow clamshell, you know, the battle tested way of doing
keyboards, is not something which caught on on tablets (except Clamcase I
guess) :) And why can't I buy a phone sized tablet without the GSM crap in it;
that would/should be tons cheaper than buying a phone 2) they are not open as
the pandora. I don't really want to be stuck with Android, iOS or Win; some
Linux with a complete desktop env please.

------
protopete
Awesome. I've been meaning to do the same thing for Final Fantasy VII PC.

~~~
foldor
While I'm never one to stand in the way of tinkering, I'm curious as to why
you chose FF7?

There are many open source implementations of PS1 emulators, and the PC
version of FF7 is notoriously bad. So from a gameplay perspective, the PS1
version of FF7 is far easier to run an any platform, and is superior in all
respects.

Like I said, not discouraging it, just curious.

------
MikeTV
Starcraft was ported to ARM in 2010 to run on the Windows Mobile platform.
Details are rather light, so I don't know if they used the same approach, but
it's likely.

[http://www.phonearena.com/news/StarCraft-arrives-for-
Windows...](http://www.phonearena.com/news/StarCraft-arrives-for-Windows-
Mobile_id10756)

------
cordite
Funny, I actually started up my pandora the first time in two years, thinking
I'd play pokemon. And then I see this on HN.

------
ekianjo
Video here: [http://pandoralive.info/?p=2965](http://pandoralive.info/?p=2965)

------
AdmiralAsshat
So if it's compiled for ARM now, any chance I could get it working on my
Chromebook?

------
deletes
Now that you have the C source, release it and/or compile a tablet version.

~~~
jevinskie
The C source would be a derived work. They have no right to release it.

~~~
tluyben2
Isn't this the same thing then? You can release a recompiled ARM binary but
not the source with which it was built? I think legally they are both derived
works. I don't really care about that as I believe it should be allowed for
software > 10 y/o, but isn't it technically the same thing and thus not
allowed at all?

~~~
jevinskie
Ah, I didn't realize that binary builds were posted. That is definitely
naughty.

------
ndesaulniers
In the US, does decompiling have ramifications in regards to the DMCA?

~~~
qdog
Probably, and copyright. Blizzard sued bnetd for reverse-engineering to make a
compatible server.
[http://en.wikipedia.org/wiki/Bnetd](http://en.wikipedia.org/wiki/Bnetd)

FD: I no longer play Blizzard games due to this action.

------
theandrewbailey
Any possibility that this could be ported to a Raspberry Pi?

------
grecy
I wish there were more static recompiling emulators.

------
marcelocamanho
Raspberry Pi port anyone?

------
crassus
Now how about an Intel Mac binary?

