As a developer on snes9x, you would be more qualified to say if this technique is valid. Here is what I tried (on mac or linux if you want to repeat, due to use of the
strings and
bash scripting. one could try cygwin or msys, I suppose, on Windows). Basically I found all strings in the compiled library of supergnes, and found any match I could in the snes9x source code to those strings, and simply dumped them all out. I'll share the results at the end, but 1st the technique:
First acquire supergnes.apk file and snes9x source. Extract snes9x source somewhere. Then:
[list=]
unzip supergnes.apk
cd supergnes/lib/armeabi
strings libsnes.so > strings_in_sgnes
./findstrings.sh /path/to/strings_in_sgen /path/to/snes9x-1.53-src
[/list]
And here is the output of these common strings between compiled supergnes and snes9x src code. This list are all string symbols found in supergnes's compiled .so that also show up in snes9x source code:
Code:
memcpy
free
malloc
memset
ftell
fseek
fwrite
fread
fclose
fopen
memcmp
memmove
SA1MainLoop
SuperFXExec
dlclose
strcmp
strcpy
atoi
gettimeofday
usleep
strncmp
dlopen
dlsym
dlerror
pthread_join
pthread_create
lseek
strerror
printf
puts
strcat
getuid
getgid
chown
time
fgetc
strlen
strncasecmp
strncpy
sscanf
sqrt
atan
500C
8C"*
true
Pause
init
Out of memory
.srm
Initialize
Setup
Execute
Shutdown
Reset
Settings
SaveState
LoadState
Cheat
.ips
PATCH
6626
.n.A.
*|*L*
t ;
DF4709156BC8A23E
0123456789ABCDEF
.text
.dynamic
.got
.data
.bss
.comment
Of highest interest are:
SA1MainLoop # what are the chances this shows up in another project?
SuperFXExec # and this too.
PATCH # this too. grep for PATCH in snes9x source and u'll see how it's used. It's starting to add up. Probability that you have all these strings by chance starts to go way down.
DF4709156BC8A23E # game genie related. not necessarily evidence, but still a very odd string.
0123456789ABCDEF
Initialize # this and the following all are highly suspect 'same-named menu' options.
Setup
Execute
Shutdown
Reset
Settings
SaveState
LoadState
Cheat
This is a simple but straightforward signature mechanism. Is it good enough to use as proof to Google? I don't know. I didn't want to even write this technique it because in the future others will be clever enough to circumvent them. But then again, maybe not. And also, more sophisticated signature mechanisms could be found.Ultimately, snes9x needs to have their voice on the android market and be *the* emulator. Otherwise there is really no protection.
findstrings.sh source (if you want to copy what I did):
Code:
#!/bin/bash
# $1 /path/to/supergnes_strings
# $2 /path/to/code_base_of_interest
cat $1 | while read CMD; do
grep -r "$CMD" $2 > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo "$CMD"
fi
done