Unpacking the img file. How to extract APK files from IMG (Parse Android firmware). Android directory structure

IMG files are disk image files that are considered obsolete today. These files store digital information that is identical to that stored on the hard drive itself. IMG files are stored on the main drive of the computer, the device interprets them as either HDD, or as digital external media.

Files of this format were developed by the company Apple, they were used by Mac OS 9 and earlier software. Now IMG files are practically not used, they have been replaced by the modernized format.

Programs for opening IMG

How to open an IMG depends on the type of its format. There are several different IMG views:

  • geoinformation data
  • disk images
  • bitmaps
  • game files.

Geographic information data consists of several zones that form a picture. These files are often used as maps and contain statistical data. They can be opened with programs such as ERDAS IMAGINE, ESRI ArcGIS Desktop, Sendmap, and GPS Map Manager. All of these programs run in the operating room Windows system... For the operating room Linux systems only one program has been created: cGPSmapper.

Disc image files can be opened with MagicISO, H + H Software Virtual CD and Smart Projects IsoBuster. For the Linux operating system, the RawWrite program is suitable. To open a file on Mac OS you should use

Sometimes, during the next audit on the subject unnecessary files your computer, you may come across extension files that you have never worked with before. Most often these are rather rare formats used for specific tasks. For example, an IMG file. If you have no idea how and how to open it, and why these files are needed at all, you have come to the right address. After all, of course, you can try to clarify the information from your closest acquaintances and friends, but even if there are experienced users among them, not all of them will be able to tell exactly what kind of extension it is. In addition, it is always more interesting to understand the issue yourself. And our article will help you with this - it is devoted to how and how to open an IMG file, what kind of format it is and what it is used for. And, of course, what program to open the img file, because it is for this purpose that everything is started. First of all, let's deal with general questions regarding the IMG extension.

What is the IMG format for?

Although many users will think that this is a picture or image file by the spelling of the format abbreviation, in reality everything is somewhat more complicated. Many more or less experienced users associate the abbreviation “img” with the word “image”. And in this case, the IMG file represents the disk image. It is possible to draw parallels with some other commonly used disk image extensions -. But in the case of the IMG, the image read-write algorithms were slightly modified.

However, you can try to change the extension from IMG to ISO - in some cases it will turn out to be opened in this way desired file using a program that does not support the format.

Some time ago, the format was also widely used in the context of the Apple Macintosh environment. Later in Mac OS X, the IMG format was changed to, which was the subject of one of our reviews. It can also be encountered quite often in applications. There are some differences in usage for these two environments - for Mac file extensions. The IMG can be either a CD / DVD image or an HDD image. In MS Windows, the format was used only to emulate optical media. One of the programs that can create such images under Windows is CloneCD, while the resulting file will be supplemented with two additional service files - with the extensions .ccd, .sub and the same names.

IMG as hardware firmware file

Also, the IMG format is used by many manufacturers of various hardware to distribute firmware updates. If your IMG file is small and you have reason to believe it is not a floppy image, then this is the case. In this case, information on how to open the IMG firmware file for each specific case should be sought on the official website of the equipment manufacturer.

When updating the IMG firmware of the equipment, you should strictly adhere to the official instructions of the manufacturer - in the worst case, if they are not followed, you will have to go to the service center. Therefore, do not trust the instructions for flashing equipment on third-party sites.

What programs for opening IMG exist

Finally, we turn to the main part of our review - we will choose which program to open the IMG file with minimal difficulties. How does this format work? As with other disk images, there are two options:

  1. Burn the image to a CD / DVD and then read it on a regular drive.
  2. Use one of the virtual drive emulators below.

Let's consider the second option in more detail. In order to open an IMG file, you can use the following programs:

  • Nero Burning ROM- known to many software, most often used to work with images of another format - .nrg. Free version missing, you need to purchase a license;
  • Daemon Tools Lite - free lite version can be used to open IMG;
  • UltraISO - there should be no problems with finding and downloading the utility. The program can be easily installed on a computer, but without purchasing a license it can only work with files less than 200MB. Using this utility, you can not only open an img file on a virtual drive, but also burn a CD / DVD (subject to the voiced restrictions).

Now you know exactly how and with what to open img on your computer. We hope that the information provided was useful and that you will not have any difficulties in working with this format in the future.

Among the many different file formats, IMG is perhaps the most versatile. And this is not surprising, because there are as many as 7 types of it! Therefore, having come across a file with such an extension, the user will not immediately be able to understand what exactly it is: a disk image, an image, a file from some popular game, or geoinformation data. Accordingly, there is a separate one for opening each of these IMG file types. software... Let's try to understand this variety in more detail.

In most cases, when a user comes across an IMG file, he is dealing with a disk image. Make such images for Reserve copy or for more convenient replication. Accordingly, you can open such a file using programs for burning CDs, or by mounting them into a virtual drive. There are many different programs for this. Let's consider some of the ways to open this format.

Method 1: CloneCD

Using this software product, you can not only open IMG files, but also create them by removing an image from a CD, or write to optical drive the image created earlier.

The interface of the program is easy to understand even for those who are just beginning to comprehend the basics of computer literacy.


It does not create virtual drives, so it will not be able to view the contents of the IMG file. To do this, you need to use another program or write the image to disk. Along with the IMG image, CloneCD creates two more service files with the CCD and SUB extensions. In order for the disk image to open correctly, it must be in the same directory with them. For creating DVD images, there is a separate version of the program called CloneDVD.

The CloneCD utility is paid, but the user is offered a 21-day trial version for review.

Method 2: Daemon Tools Lite

Floppy image

In the distant 90s, when not every computer was equipped with a CD-ROM drive, and no one heard about flash drives at all, the main type of removable media was a 3.5-inch floppy disk with a capacity of 1.44 MB. As in the case of CDs, images could be created for such floppies for backing up or replicating information. The file of such an image also has the IMG extension. First of all, it is possible to guess that this is the image of a floppy disk by the size of such a file.

Nowadays, floppy disks have become deeply archaic. However, sometimes these media are used on older computers. Floppy disks can also be used to store digital signature key files or for other highly specialized needs. Therefore, it will not be superfluous to know how to open such images.

Method 1: Floppy Image

This is a simple utility with which you can create and read images of floppy disks. Its interface is also not particularly pretentious.


You just need to specify the path to the IMG file in the appropriate line and click the button "Start" how its contents will be copied to a blank floppy disk. It goes without saying that for the program to work correctly, you must have a floppy drive on your computer.

Currently, support for this product has been discontinued and the developer's site has been closed. Therefore, it is not possible to download Floppy Image from the official source.

Method 2: RawWrite

Another utility that is identical in principle to Floppy Image.

To open a floppy disk image, you must:

  1. In the tab "Write" specify the path to the file.
  2. Press the button "Write".


The data will be transferred to a floppy disk.

Bitmap

A rare type of IMG file, once developed by Novell. It is a bitmap. In modern operating systems this file type is no longer used, but if a user comes across this rarity somewhere, you can open it using graphic editors.

Method 1: CorelDraw

Because given type The IMG file is a brainchild of Novell, it is only natural that you can open it using a graphical editor from the same manufacturer -. But this is not done directly, but through the import function. To do this, you need to do the following:

As a result of the actions performed, the contents of the file will be loaded into Corel.


To save changes in the same format, you need to export the image.

Method 2: Adobe Photoshop

The most popular graphics editor in the world also knows how to open IMG files. This can be done from the menu "File" or by double-clicking on the work area.


The file is ready to be edited or converted.


You can save the image back to the same format using the function "Save as".

The IMG format is also used to store graphic elements of various popular games, in particular GTA, as well as for GPS devices where map elements are displayed in it, and in some other cases. But all these are very narrow areas of application, which are more interesting for the developers of these products.

MTwinTools is a utility that allows you to work with firmware files and images boot.img, recovery.img and system.img. The author of the utility is vin2809 from the w3bsit3-dns.com forum. MTwinTool will come in handy for owners Huawei smartphones based on MTK processors.

MTwinTools User Guide

1. Introduction.

1.1. Appointment.

MTwinTools tool is designed to disassemble / assemble device images based on MT chips.

It is built for use in command line based on the RKwinTools tool designed to work with devices on RK29xx-RK31xx chips, and some free software.

Works only under Windows 7 and higher without installing CYGWIN, and also does not require any additional registration of paths in OS environment variables.

The tool allows you to:

  • unpack and pack the Boot.img image;
  • unpack and pack the Recovery.img image;
  • unpack and pack the Kernel.img image;
  • unpack and compress the System.img image, both yaffs type and ext2-ext4;
  • convert a sparse file to an ext4 image;
  • calculate the checksum of the file in md5 format;
  • initiate SuperUser.

1.2. Installing MTwinTools.
The tool is installed by unpacking the archive in any place convenient for you. This will create an MTwinTools folder containing:

  • _In /, App / and Cygwin / folders;
  • as well as the Readme.txt and menu.bat files.

The _In folder is empty and is intended to contain the source images for processing. App / folder contains set batch files processing images. The Cygwin / folder contains free service libraries and files. The Readme.txt file contains the user's manual, i.e. the text you are currently reading. The menu.bat file is used to create the MTwinTools menu.

ATTENTION. No prescribing paths to service files in Windows OS environment variables is REQUIRED.

During work, other necessary folders will appear:

  • Pack, which will contain the Boot, Recovery and System files after
    packing, md5 folder containing files with checksum, as well as folder
    Firmware, in the Image subfolder of which the collected Boot files will be located,
    Recovery and System;
  • Unpack, in which FULLY unpacked Boot, Recovery and System files
    will be located in the Firmware folder, in the Image subfolder.

1.3. Uninstalling MTwinTools.

The tool is uninstalled by deleting the root folder of the tool, i.e. the MTwinTools folders.

2. Basic rules of work.

2.1. To get started, you need to run the menu.bat file, this will launch the tool menu.

2.2. The images intended for unpacking must be placed in the _In folder of the tool. Input file names MUST contain keywords and may have names of the following form:

  • * boot * .img;
  • * recovery * .img;
  • * kernel * .img;
  • * system * .img.

2.3 At the first start, initialize the tool. When the tool is initialized, ALL files located in the _In folder will be copied to the working input folder Unpack / Firmware / Image. This is done in order to preserve the original files.

2.4 After disassembling the image, its contents will be placed in the Unpack folder, in which the following folder structure will be created:

Boot (Recovery) / cfg /
kernel /
ramdisk /

The cfg / folder will contain the image settings, in the kernel folder you will find the kernel, i.e. the zImage binary, and the ramdisk folder will contain everything else. To complete the assembly of the image, its constituent parts, i.e. ramdisk, kernel, and possibly settings, place in the appropriate folders in Unpack. The generated image will be in the Pack output folder.

3. Description of the tool.

3.1. Main menu of commands.

The main command menu of the tool looks like this:

**************************
* MTwinTools_V_0.6 *
**************************
* Image commands: *
* ————— *
* 1-Boot *
* 2-Recovery *
* 3-Kernel *
* 4-System *
* 5-Other commands *
* *
**************************
* Tools commands: *
* ————— *
* 6-Init Tools *
* 7-Clean *
* *
**************************
* 8-Exit *
**************************
Please, choose command:

The choice of a command is made by entering the number indicated in front of it. In the current version, you can do the following:

- go to the Boot image processing menu by typing the number "1";
- go to the image processing menu Recovery - "2";
- go to the Kernel image processing menu - "3";
- go to the image processing menu System - "4";
- go to the menu of other commands - "5";
- to initialize the working area of ​​the tool - "6";
- to clean the working area of ​​the tool - "7";
- to complete the work, i.e. get out of the facility - "8".

3.2. Boot menu.

To proceed to processing the Boot image, run the "1-Boot" command. This will take you to the "Boot commands" menu.

The Boot imaging menu looks like this:

**************************
* Boot commands: *
* ————— *
* 1-Boot unpack *
* 2-Boot pack *
* *
**************************
* 3-Return *
**************************
Please, choose command:

Command "1" unpacks Boot images, command "2" compresses Boot images. By command "3" you will return to the main menu of the tool.

2.2.1. Disassembling the boot.img image.

2.2.2. Build the boot.img image.

When building the boot image, the data source selection menu will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
* 3. Return *
**************************
Please, choose source:

You have the opportunity to build an image from the unpacked image located in the Unpack / Boot folder, for this select the menu item “1. Unpack dir ". If you select the menu item “2. Pack dir ”, the image will be created from the data located in the Pack / boot folder. To cancel the operation, select the menu item “3. Return ". In this case, you
return to the Boot commands menu.

3.3. Recovery menu.

To proceed to processing the Recovery image, run the "2-Recovery" command. This will take you to the "Recovery commands" menu. The Recovery image processing menu looks like this:

**************************
* Recovery commands: *
* —————— *
* 1-Recovery unpack *
* 2-Recovery pack *
* *
**************************
* 3-Return *
**************************
Please, choose command:

Command "1" unpacks Recovery images, command "2" compresses Recovery images. By command "3" you will return to the main menu of the tool.
2.3.1. Disassembling the recovery.img image.

All actions are performed automatically, i.e. without your participation there is nothing to describe here.

2.3.2. Build recovery.img image.

When building a recovery image, a data source selection menu will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
* 3. Return *
**************************
Please, choose source:

You have the opportunity to build an image from the unpacked image located in the Unpack / recovery folder, for this select the menu item “1. Unpack dir ". If you select the menu item “2. Pack dir ”, the image will be created from the data located in the Pack / recovery folder.

To cancel the operation, select the menu item “3. Return ". This will return you to the "Recovery commands" menu.

3.4. Kernel menu.

To proceed to processing the Kernel image, run the "3-Kernel" command. This will take you to the "Kernel commands" menu.

The Kernel image processing menu looks like this:

**************************
* Kernel commands: *
* —————— *
* 1-Kernel unpack *
* 2-Kernel pack *
* *
**************************
* 3-Return *
**************************
Please, choose command:

Command "1" unpacks Kernel images, command "2" compresses Kernel images. By command "3" you will return to the main menu of the tool.

3.4.1. Disassembling the kernel.img image.

All actions are performed automatically, i.e. without your participation there is nothing to describe here.

3.4.2. Building the kernel.img image.

When building the kernel image, a data source selection menu will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
* 3. Return *
**************************
Please, choose source:

You have the opportunity to build an image from the unpacked image located in the Unpack / Kernel folder, for this select the menu item “1. Unpack dir ". If you select the menu item “2. Pack dir ”, the image will be created from the data located in the Pack / Kernel folder.

To cancel the operation, select the menu item “3. Return ". This will return you to the Kernel commands menu.

3.5. System menu.

To proceed to processing the System image, run the command "3-System". This will take you to the "System commands" menu.

The System imaging menu looks like this:


* System commands: *
* ——————————————— *
* 1-unpack yaffs * 2-pack yaffs *
* 3-unpack ext3 * 4-pack ext3 *
* 5-unpack ext4 * 6-pack ext4 *
* 7-sparse to ext4 * *
* * *
***************************************************
* 8-Return *
***************************************************
Please, choose command:

3.5.1. Disassembling a system image of the yaffs type.

The command "1" unpacks System images of the yaffs type into the Unpack / System folder.

3.5.2. Build a system image of type yaffs.

The command "2" compresses System images of the yaffs type. The menu for selecting a data source will appear.

**************************
* Choice source image: *
* 1. Unpack dir *
* 2. Pack dir *
* 3. Return *
**************************
Please, choose source:

You have the opportunity to build an image from the unpacked image located in the Unpack / system folder, for this select the menu item “1. Unpack dir ". If you select the menu item “2. Pack dir ”, the image will be created from the data located in the Pack / system folder.

To cancel the operation, select the menu item “3. Return ”and you will return to the previous menu“ System commands ”.

3.5.3. Disassembling a system image of type ext3.

Command "3" unpacks System images of type ext2-ext3 into the Unpack / System folder.

3.5.4. Building a system image of type ext3.

Command "4" builds an ext2-ext3 System image. Packing is carried out in the same way as in clause 3.5.2. only the output image will be of type ext3.

3.5.5. Disassembling an ext4 type system image.

Command "5" unpacks System images of type ext4 into the Unpack / System folder.

3.5.6. Building a system image of type ext4.

The command "6" builds an ext4 type System image. Packing is performed in the same way as in clause 3.5.2. only the output image will be of type ext4.

3.5.7. Convert compressed sparse image to ext4.

Command "7" converts (converts or transcodes) compressed sparse images into ext4 images (analogue of the simg2img operation).

3.5.8 Return to the main menu.

By command "8" you will return to the main menu of the tool.

3.6. Other commands menu.

To move on to the execution of other commands, execute the command "5-Other commands". This will take you to the "Others commands" menu. The menu for executing other commands looks like this:

**************************
* Others commands: *
* —————- *
* 1-Init SuperUser *
* 2-Calculate md5 *
* *
**************************
* 3-Return *
**************************
Please, choose command:

Command "1" initializes SuperUser in the System image, command "2" calculates the checksum of the files. By command "3" you will return to the main menu of the tool.

3.6.1. Initializing SuperUser.

During SuperUser initialization, the source selection menu will appear:

**************************
* Choice source init: *
* 1. Unpack dir *
* 2. Pack dir *
* 3. Return *
**************************
Please, choose source:

You have the opportunity to initialize the unpacked image located in the Unpack / system folder, for this select the menu item “1. Unpack dir ". If you select the menu item “2. Pack dir ”, the image located in the Pack / system folder will be initialized. To cancel the operation, select the menu item “3. Return ".
Initialization is done by copying the required files (su and SuperSU.apk) into the parsed System.img image. To get Root access, you need:

- unpack the System image using the command "3" of the main menu
tools or place the unpacked image in the Unpack (or Pack) / System / folder;
- execute the command "1-init SuperUser" of the "Others commands" menu.

After flashing the System.img image, you will have Root access on your device. If files of a different version are used to obtain Root access on your device, then you just need to update (replace) the su and SuperSU.apk files in the App / folder.

3.6.2. Checksum calculation.

To calculate the checksum of a file or files, place them in the Pack / md5 / folder. After executing the "2-Calculate md5" command, a checksum calculated using the md5 algorithm will be added to all files in the Pack / md5 folder. Only files without extension or with extension .img, .tar, .zip are processed.

3.7. Initialization.

To carry out initialization, execute the command "6-init Tools". This will create all the folder structures necessary for the MTwinTools to work and copy the input images to the Unpack / Firmware / Image working folder.

3.8. Cleaning the product.

Type 7-CLEAN to clear the work area. In this case, ALL additional folders along with the content will be deleted, the MTwinTools tool will exit and return to what it looked like immediately after installation.

3.9. Output.

Dial "8-Exit" to exit. This will ONLY exit the product without any cleaning.

Almost every user android smartphone there was a desire to create or edit the firmware to fit your needs and desires. In this article, we will consider the principle of editing firmware for CWM (in zip format).

Preparation:

First of all, you need to decide which firmware we will take as a basis. Better to use off. zip firmware. For almost every common device, there is a clean firmware + root.
When the firmware is selected, you need to download it to any place convenient for you on your PC (you should not unpack it).
We also need an archiver, I advise you to use 7zip and the best of its kind text editor Notepad ++.

Firmware structure:

Opening the firmware archive you see the following:
META-INF- the folder contains scripts for installing the firmware.
system- folder with all firmware files (applications, tweaks, scripts, etc.).
boot.img- the core of the system.

Almost all manipulations are carried out in the folder system, its structure:
app- system applications.
bin- the resources of the system itself.
etc- Scripts, tweaks, configs, profiles and system settings.
fonts- System fonts.
framework- the main files of the system are stored here (graphics, animation text settings, etc.).
lib- system libraries.
media- multimedia files (notification ringtones, loading animation, wallpapers, etc.).
usr- settings that are not changed in the future by the system (work in the "read-only" mode).
xbin- again, system configs and other tweaks.
build.prop- infa about the system, locale and system performance settings.

Applications:

Before adding / removing software to the system, you need to check if your firmware is deodexed (that is, check for the presence of .odex files in the app folder. If there are files, then you need to get rid of them here by this instructions .
Add software to the firmware:
First of all, you need to install in your smart those programs that you want to add to the assembly. After installation, we get them out of the system using Root Exporer and its analogs, they are located along the data / app path, we also need them (if they exist, of course) they are located along the data / data path. They are located in the folder of the same name to the application and have the extension .so... Then withdrawn .apk We put the files in the archive along the system / app path and files with the extension .so(lib "s) in the system / lib path.
Removing software from the firmware:
Everything is simple here, go to the folder app- we determine what we do not need and remove all unnecessary software (it is better not to touch the system).

Language and firmware version:

Copy the build.prop file to your desktop. We open it with a notepad and find the lines:

ro.product.locale.language = en
ro.product.locale.region = US

for the Russian language, you need to do this:

ro.product.locale.language = ru
ro.product.locale.region = RU

enter the name of your mod into the line

in the same build.prop

Graphics:

The entire graphical part of the firmware is stored in two files framework-res.apk path to the file systemframework and SystemUI.apk along the way systemapp... And the graphical part of the settings application is stored naturally in the Settings.apk application.

Scripts and tweaks (speeding up and optimizing the system):

Most of the settings are done in the file build.prop, you can read about this. Likewise, if your kernel supports init.d there are a number of scripts to optimize the system, one of them is described in this article (RAM optimization) and in this article Tweak scripts for init.d

Replacing system fonts:

As stated above, all fonts are contained in the folder fonts, the main fonts are: DroidSans.ttf and DroidSans-Bold.ttf, they can be replaced with any fonts by renaming them in the same way as above and moved with replacement to the archive with the firmware in the folder fonts.

Core:

In theory, it is sufficient to replace boot.img their own, but in some cases Kernels are accompanied by additional scripts. Therefore, I advise you not to do anything if there are any doubts.



Programs