[LG G Stylo Questions & Answers] feabhas:
It was simple. I was already rooted when I pulled all the flash memory contents. If not rooted, you won't be able to do much in the shell.

Make sure you have the LG drivers installed in your system and also the USB debugging is enabled.

The ADB.exe should be present in the system (it may come from the root scripts or from latest Android SDK). Open a Command Prompt and cd into the directory where the ADB.exe is located.

Then, you will need to have a shell being root.

At the command prompt you have to type:

D:\Android\sdk\platform-tools>adb shell
adb server is out of date. killing...
* daemon started successfully *
shell@g4stylusn:/ $ su
su
root@g4stylusn:/ #

Once you see the "root" and the "#" then you are root and you can do pretty much anything.

Then, in the shell we need to find out what partitions we have in our G Stylo phones. To do so, type:

root@g4stylusn:/ # cat /proc/mounts
cat /proc/mounts
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
pstore /sys/fs/pstore pstore rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
/mnt/pstore /mnt/pstore pstore rw,relatime 0 0
/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,relatime,discard,data=ordered 0 0
/dev/block/bootdevice/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,relatime,discard,noauto_da_alloc,resuid=1000,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/drm /persist-lg ext4 rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/sns /sns ext4 rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/modem /firmware vfat ro,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/block/bootdevice/by-name/mpt /mpt ext4 rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=continue,data=ordered 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
tmpfs /storage/emulated tmpfs rw,seclabel,nosuid,nodev,relatime,mode=050,gid=1028 0 0
/dev/block/vold/179:65 /mnt/media_rw/external_SD vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/fuse /storage/external_SD fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/0 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/0/Android/obb fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy/Android/obb fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

The files I mentioned in my previous post are located here:

/dev/block/bootdevice/by-name/modem /firmware vfat ro,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0

Now, being root, we can either copy all the files in the "/firmware" directory or we can pull the entire partition. We can also pull other interesting partitions as well.

To copy the files: (create a directory on the microSD card and copy all the files in it).

root@g4stylusn:/ # mkdir /mnt/media_rw/external_SD/firmware_contents
root@g4stylusn:/ # cp -v -r /firmware/* /mnt/media_rw/external_SD/firmware_contents

All the contents of the "modem" partition (mounted in the G Stylo in the /firmware directory) should be now in the "firmware_contents" directory in the root directory of the external microSD card.

I am using a lot Ubuntu as a virtual machine and I prefer to dump the partition contents and then mount and analyze them in Linux.

dd if=/dev/block/bootdevice/by-name/modem of=/mnt/media_rw/external_SD/part_modem_vfat_ro_firmware.img

Any of the partitions in the G Stylo can be pulled entirely using the "dd" command.

The complete list of G Stylo partitions can be listed as follows:

root@g4stylusn:/ # ls -la /dev/block/bootdevice/by-name
ls -la /dev/block/bootdevice/by-name
lrwxrwxrwx root root 1970-01-01 09:17 DDR -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 1970-01-01 09:17 aboot -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1970-01-01 09:17 abootbak -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 1970-01-01 09:17 boot -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 1970-01-01 09:17 cache -> /dev/block/mmcblk0p37
lrwxrwxrwx root root 1970-01-01 09:17 drm -> /dev/block/mmcblk0p31
lrwxrwxrwx root root 1970-01-01 09:17 eksst -> /dev/block/mmcblk0p26
lrwxrwxrwx root root 1970-01-01 09:17 encrypt -> /dev/block/mmcblk0p25
lrwxrwxrwx root root 1970-01-01 09:17 factory -> /dev/block/mmcblk0p29
lrwxrwxrwx root root 1970-01-01 09:17 fota -> /dev/block/mmcblk0p30
lrwxrwxrwx root root 1970-01-01 09:17 fsc -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 1970-01-01 09:17 fsg -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 1970-01-01 09:17 grow -> /dev/block/mmcblk0p39
lrwxrwxrwx root root 1970-01-01 09:17 hyp -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1970-01-01 09:17 hypbak -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 1970-01-01 09:17 laf -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-01 09:17 metadata -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 1970-01-01 09:17 misc -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1970-01-01 09:17 modem -> /dev/block/mmcblk0p33
lrwxrwxrwx root root 1970-01-01 09:17 modemst1 -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-01 09:17 modemst2 -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 1970-01-01 09:17 mpt -> /dev/block/mmcblk0p32
lrwxrwxrwx root root 1970-01-01 09:17 pad -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1970-01-01 09:17 pad2 -> /dev/block/mmcblk0p35
lrwxrwxrwx root root 1970-01-01 09:17 persist -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1970-01-01 09:17 persistent -> /dev/block/mmcblk0p34
lrwxrwxrwx root root 1970-01-01 09:17 rct -> /dev/block/mmcblk0p27
lrwxrwxrwx root root 1970-01-01 09:17 recovery -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 1970-01-01 09:17 rpm -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1970-01-01 09:17 rpmbak -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 1970-01-01 09:17 sbl1 -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1970-01-01 09:17 sbl1bak -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 1970-01-01 09:17 sec -> /dev/block/mmcblk0p24
lrwxrwxrwx root root 1970-01-01 09:17 sns -> /dev/block/mmcblk0p28
lrwxrwxrwx root root 1970-01-01 09:17 ssd -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 1970-01-01 09:17 system -> /dev/block/mmcblk0p36
lrwxrwxrwx root root 1970-01-01 09:17 tz -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1970-01-01 09:17 tzbak -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1970-01-01 09:17 userdata -> /dev/block/mmcblk0p38

I will post again when I will find the locations where the IMEI is stored.