Comments (1)
You probably don't care about this any longer, but for posterity...
Try ReFirmLabs/binwalk to get the actual starting location of the file system after using simg2img
on it.
Example:
% binwalk system.raw.img
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
131072 0x20000 Linux EXT filesystem, blocks count: 604807, image size: 619322368, rev 2.0, ext4 filesystem data, UUID=da594c53-9beb-f85c-85c5-cedf76547654, volume name "system"
[...]
% mount -o loop,ro,offset=0x20000 system.raw.img mount
%
Also explained on Android SE.
There's nothing wrong with simg2img
, it's just that Motorola likes to prepend some data that is not part of the actual file system.
[Imaginary quote]
Okay, but I tried to get the offset usinggrep
, as suggested in the links I provided and this didn't give me the correct offset.
Yes, that's true. Let me give an example:
% LANG=C grep -aobP -m1 '\x53\xEF' ../system.raw.img | head -1 | gawk '{print $1 - 1080}'
228906959
Looks weird. The offset is huge, that can't be right.
The reason for this is... encodings! If your locale is UTF-8 based (which should typically be the case), then the input will be parsed as UTF-8. \x53\xEF
isn't valid UTF-8, though (\xEF
indicates a three-byte sequence, but no more bytes follow), so all bets are off.
Execute grep
in byte mode and it'll work correctly:
% LANG=C LC_ALL=C grep -aobP -m1 '\x53\xEF' ../system.raw.img | head -1 | gawk '{print $1 - 1080}'
131072
This offset looks much better!
If this solves your issue, please remember to close this report.
from android-simg2img.
Related Issues (20)
- Compilation fix for MinGW/MSYS2 under Windows HOT 1
- Images created from Android Q Beta 1 won't mount HOT 13
- Error when running simg2img HOT 2
- why ext2 ? not ext4 HOT 4
- difference between ext2simg and img2simg?
- compile error in centos 7
- compile error in centos 7 HOT 4
- error in convert HOT 15
- Error with SM-G361F system.img HOT 1
- Android10 system.img not mountable on Ubuntu and OS X HOT 2
- bad generated sparse image on samsung firmware, failed to flash HOT 2
- Android 11 Support HOT 1
- Invalid sparse file format at header magic Failed to read sparse file. HOT 9
- zlib-devel instead of libz-devel
- how to read info on oem.img in launcher app?thx
- simg2img has seeking error with input stdin
- ext2 ??? HOT 1
- Problems unzipping super.img on Samsung
- ChunkType Fill always return 0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-simg2img.