The VG Resource

Full Version: Newbie wants to know how to rip sprites from Android game
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, complete noobie here when it comes to ripping assets from games.

I have a Android game that I want to rip sprites from, but don't have much idea how to do so. I am not sure if this is the correct place to ask so please forgive me.

I have access to the data via file explorer with superuser privileges under a rooted device. However I am facing one problem: The data are all in .bin formats, which from some searching on the forums means it could be anything. Is there any way I could determine what those files are and how to proceed to extract the resources behind them?

Thanks

Edit: The original issue of not being able to see and export the folders have been resolved. Updated post.
howdy! hope you dont mind the late response. im gonna try and break down the process the best i can--some finer details will change from game to game but hopefully itll get you started in the right direction. apologies in advance for the length of this post

programs:
- a hexidecimal editor (i personally like xvi32, http://www.chmaas.handshake.de/delphi/fr.../xvi32.htm)
- assetstudio (this is what youll use to get the assets into a format usable for you, it'll export things in png, wav, mp4, obj, whatever your heart desires) (https://github.com/Perfare/AssetStudio)

you may use:
- assetripper (specifically for unity games, its able to recognize prefabs and stuff that assetstudio isnt) (https://github.com/ds5678/AssetRipper)
- uabea (lets you extract files from things like data.unity3d files that assetstudio wont recognize. id go here first if assetstudio doesnt load smthn) (https://github.com/nesrak1/UABEA)


you seem to have the files on your computer already, so ill skip over that. first thing is to check for a cache folder, and if its encrypted.
an encrypted cache looks like this:
[Image: unknown.png]
the files, when viewed in a hex editor, will look something like this:
[Image: unknown.png]
and an unencrypted one:
[Image: unknown.png]
and the hex!
[Image: unknown.png]
the unityfs at the top is extremely important. your files are always going to be in a generic format--bin, dat, etc., but they do contain data for a specific filetype, and the header/footer will let you know! basically, if you get a file, pop it into a hex editor and check the top + bottom of the file for the file format. unityfs files are just a type of unity file, and can be opened w/ assetstudio as-is. you shouldnt need to do this for every file in a folder unless a specific file is giving you trouble. if one of them is a unityfs, then all of them are gonna be unityfs.

if your files are encrypted, then you can 1. decrypt them, or 2. look somewhere else for the files. i often find that games that dont just have a cache w/ the assets available have them somewhere else.

edit: im going to try my best to elaborate more on decryption, but i should note that this is... not easy. files are obfuscated for a reason, and if they were easily reversed then there would have been no point to encrypt them in the first place.
in order to decrypt a file, you need to know 1. what method it was encrypted in and 2. the encryption key. if you did some rummaging, im sure you could find other programs, but the program i am familiar with that has cipher features is kuriimu2. it can encrypt + decrypt files--its designed for modding games. figuring out the method can be difficult, looking around in the apk file for encryption details may help. search weird folder names and references to things you find--some companies use third parties to encrypt their files and that can provide more information on the method.

other places that files are stored! 1. obb files. this is another generic file format, that the play store uses to allow games to download extra information that they cant/dont want to store in the .apk. usually assets and such! these are a bit tricker to decipher the filetype, and they could be... practically anything. most commonly they are a .zip or similar--just convert the file to that type. you dont need to do anything fancy, just be sure that your file explorer allows you to edit file extension types and change the .obb to .zip/.rar/etc..
heres the header of an obb file that was a .zip:
[Image: unknown.png]
and the footer:
[Image: unknown.png]
doesnt give a ton of help, aside from letting us know that it contains other folders and files. if you get an obb file open, youre looking for some kind of resource file or folder. in unity, this file tends to be a
data.unity3d file, stored in bin > data. in this same layout, resource files are stored in android. just check for encryption and stuff!

small tangent, assetstudio cannot open data.unity3d files--go through uabea and extract the files you wanna rummage around in. whatever uabea extracts, assetstudio should be able to view!

2. resource folder within the apk
admittedly im a lot less familiar with this, but depending on the game the assets may be straight up stored in the apk. just rummage around for them like you would the others.

in summary, your workflow should be smthn like
look for cache > look for obb > look for other asset folders > upload to pc > inspect for filetype + encryption > open in uabea (if needed) > open in assetstudio/assetripper > extract wanted assets

hope this helps!! im more than happy to answer any further questions or help w/ any bumps in the road!
I’m getting stuck on basic intermediary steps.

- I downloaded blue stacks for pc, and downloaded the games from the google play store, as well as a file manager that lists the game files (x plore). However, I see no way of exporting files to the PC, it only offers locations in the emulated phone.
Searching around, I’ve seen tutorials that list Windows in the location options but I don’t have that.
Further confusing the issue, I’m seeing some instructions to export certain game files, and others saying to figure out how to rip the game apk to windows first - same export limitation though.

- I see big file trees on GitHub for assetstudio and the like, and one mention of a GUI, but no understanding of what to download or how to make use of these. Not as simple as downloading an exe.
no worries!! i know i got confused about these too when i was starting out, lemme elaborate a little on em

(11-03-2021, 06:11 PM)Mariner Wrote: [ -> ]- I downloaded blue stacks for pc, and downloaded the games from the google play store, as well as a file manager that lists the game files (x plore). However, I see no way of exporting files to the PC, it only offers locations in the emulated phone.

go to my games > system apps > media manager > explore
from here you can long press on the files/folders, and there will be a button up at the top to export to windows. just hit that + select where you want the files to go

sometimes it wont let you longpress on folders, so the alternative is:
- download an app that'll pack stuff into .zip files. rarlab has an official app, i heavily recommend it, just look up rar in the play store
- go to my games > system apps > android settings > storage > (scroll to the bottom) explore > find the files you want > longpress + copy to someplace like your downloads folder
you... can zip the files right in their directory but i dont reccomend it. best practice to copy everything over to a place you know isnt going to mess with the original files
- go into your zip app, find the copied files, and add them to an archive
- navigate to media manager, and find your archive > longpress > export to windows
a little bit of a process, but it works
(soft side note: most android phones that dont allow you root access via. the standard file explorer will allow it through the settings file explorer--you wont ever need to download a third party application)


(11-03-2021, 06:11 PM)Mariner Wrote: [ -> ]- I see big file trees on GitHub for assetstudio and the like, and one mention of a GUI, but no understanding of what to download or how to make use of these. Not as simple as downloading an exe.

yep! so, github is a site to host repositories (the source code of any given application, basically), but they also provide a feature for creators to provide the compiled application--this is the 'releases' tab, its on the right under 'about'. here is the release page for assetstudio, download the .zip file. generally, this is how theyre all gonna be, save for some command line tools like apktool--but those tend to be documented on how to install them.
most of these github based applications wont have installer .exes like you might be used to, so heres how to install + run them:
- download .zip file from release page on github
- open .zip, and extract contents to your preferred location. you'll likely need to create a folder to contain the files, they dont usually zip the files with one
- navigate to the extracted files and run the .exe
nice n easy! if you want to update an application, simply run through these same steps and delete the old folder. dont try to fuss with overwriting the old one, the update will have all of the needed files and its cleaner to just install it fresh like that.


(11-03-2021, 06:11 PM)Mariner Wrote: [ -> ]Further confusing the issue, I’m seeing some instructions to export certain game files, and others saying to figure out how to rip the game apk to windows first - same export limitation though.

this... REALLY depends on how the game files are stored. this is going to vary with each game you rip, you just have to run through each thing until you find what youre looking for. i find it often depends on the level of security in the game. sometimes games dont store ANY asset files locally--rather calling on them the server every time theyre needed. this is where the cache thing comes from--in order to save some loading times the game will temporarily store asset files in a cache folder, so it can call on them quickly. games like this wont have their assets neatly bundled in apks. some games that are more lax on their security will just... have everything in the apk file.

if you want to grab an apk file, the easiest way is to use a site like this one and get it from there. i... dont know how to grab an apk file from a phone, and i dont really think its worth it. this will give you the apk + obb files right on your computer with no fuss.

since i wrote that previous post ive become more familiar with apks, heres a few ways to view the things in them:
- use an extractor like apktool
- look at them through android studio (its kind of a chunky download, but can format things well (such as drawables), has a built in android emulator, and you can just slap the apk in directly. if you want to edit or extract the files, you will need something like apktool though)
the apk file probably isnt going to hold ambiguous asset files like in the cache, so if theres no directly available assets in plain formats like .png then you may be looking in the wrong area
Thank you for the detailed answer! This should be stickied. Will test it out later.
what about non unity games
(11-03-2021, 09:49 PM)monlupin Wrote: [ -> ]no worries!! i know i got confused about these too when i was starting out, lemme elaborate a little on em

(11-03-2021, 06:11 PM)Mariner Wrote: [ -> ]- I downloaded blue stacks for pc, and downloaded the games from the google play store, as well as a file manager that lists the game files (x plore). However, I see no way of exporting files to the PC, it only offers locations in the emulated phone.

go to my games > system apps > media manager > explore
from here you can long press on the files/folders, and there will be a button up at the top to export to windows. just hit that + select where you want the files to go

sometimes it wont let you longpress on folders, so the alternative is:
- download an app that'll pack stuff into .zip files. rarlab has an official app, i heavily recommend it, just look up rar in the play store
- go to my games > system apps > android settings > storage > (scroll to the bottom) explore > find the files you want > longpress + copy to someplace like your downloads folder
you... can zip the files right in their directory but i dont reccomend it. best practice to copy everything over to a place you know isnt going to mess with the original files
- go into your zip app, find the copied files, and add them to an archive
- navigate to media manager, and find your archive > longpress > export to windows
a little bit of a process, but it works
(soft side note: most android phones that dont allow you root access via. the standard file explorer will allow it through the settings file explorer--you wont ever need to download a third party application)


(11-03-2021, 06:11 PM)Mariner Wrote: [ -> ]- I see big file trees on GitHub for assetstudio and the like, and one mention of a GUI, but no understanding of what to download or how to make use of these. Not as simple as downloading an exe.

yep! so, github is a site to host repositories (the source code of any given application, basically), but they also provide a feature for creators to provide the compiled application--this is the 'releases' tab, its on the right under 'about'. here is the release page for assetstudio, download the .zip file. generally, this is how theyre all gonna be, save for some command line tools like apktool--but those tend to be documented on how to install them.
most of these github based applications wont have installer .exes like you might be used to, so heres how to install + run them:
- download .zip file from release page on github
- open .zip, and extract contents to your preferred location. you'll likely need to create a folder to contain the files, they dont usually zip the files with one
- navigate to the extracted files and run the .exe
nice n easy! if you want to update an application, simply run through these same steps and delete the old folder. dont try to fuss with overwriting the old one, the update will have all of the needed files and its cleaner to just install it fresh like that.


(11-03-2021, 06:11 PM)Mariner Wrote: [ -> ]Further confusing the issue, I’m seeing some instructions to export certain game files, and others saying to figure out how to rip the game apk to windows first - same export limitation though.

this... REALLY depends on how the game files are stored. this is going to vary with each game you rip, you just have to run through each thing until you find what youre looking for. i find it often depends on the level of security in the game. sometimes games dont store ANY asset files locally--rather calling on them the server every time theyre needed. this is where the cache thing comes from--in order to save some loading times the game will temporarily store asset files in a cache folder, so it can call on them quickly. games like this wont have their assets neatly bundled in apks. some games that are more lax on their security will just... have everything in the apk file.

if you want to grab an apk file, the easiest way is to use a site like this one and get it from there. i... dont know how to grab an apk file from a phone, and i dont really think its worth it. this will give you the apk + obb files right on your computer with no fuss.

since i wrote that previous post ive become more familiar with apks, heres a few ways to view the things in them:
- use an extractor like apktool
- look at them through android studio (its kind of a chunky download, but can format things well (such as drawables), has a built in android emulator, and you can just slap the apk in directly. if you want to edit or extract the files, you will need something like apktool though)
the apk file probably isnt going to hold ambiguous asset files like in the cache, so if theres no directly available assets in plain formats like .png then you may be looking in the wrong area

Hello, I think you know about game extraction very well. Can you still help me about an unity-based pixel art mobile game? It worked bafore with AssetStudio, but after updating, the sprite _data file is moved to outside of UnityCache, and 'UnityFS' indication is removed that I could find in hex editor and _info file doesn't exist for that moved file as well. I think the file is now encrypted.