nlitsme / eimgfs

Tool for editting Windows CE/Mobile firmware images.
MIT License
66 stars 11 forks source link

List of files shown, but -extractall doesn't work #5

Closed SCIF closed 4 years ago

SCIF commented 4 years ago
$ docker run -v ~/avic/:/app/1 --rm -ti ef7b7abd7b4d  /app/1/test/1.prg -info -list

ERROR: not found
0000007e: failed to load dll4
ERROR: not found
0000007e: failed to load dll3
found xip
imgfs: partition table not found
readers: ( total = 1 )
{
    file 0x33fb934
}
filesystems: ( total = 1 )
    xip         39 files, 235 modules
-------- xip
033fa6d0 2012-07-19 02:24:30  1470976 M:[00000007] 1SegCore.dll
033f9f30 2012-07-19 05:13:33    95744 M:[00000007] afd.dll
033fa7d0 2012-09-28 01:52:31   753664 M:[00001007] AIPI.dll
033fa7b0 2012-09-28 01:52:47   870912 M:[00001007] AplLib.dll
…

And tried to extract files:

$ docker run -v /home/scif/avic/:/app/1 --rm -ti ef7b7abd7b4d  /app/1/test/1.prg -extractall -d /app/1/test/22 -v

ERROR: not found
0000007e: failed to load dll4
ERROR: not found
0000007e: failed to load dll3
ERROR(00000011): CreateDirectory(/app/1/test/22)
no fffb: blk:  00090009 0009402b 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          mg:  0009d001 884a76c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 5007a089 00000002
found xip
8b89a73c: romhdr dll:4001c001-4177c0db, phys:884a1000-8b89c934, ram:8b89d000-8e8a1000, copy:2, profile:00000000-00000000, drvglob:00000000-00000000, track:00000000-00000000
imgfs: partition table not found
033fa6d0 2012-07-19 02:24:30  1470976 M:[00000007] 1SegCore.dll
nlitsme commented 4 years ago

You are missing the dlls from the 'dlls' subdirectory, eimgfs expects to find them in the same directory as the executable.

I just tried eimgfs on a debian 10 linux laptop, and confirmed that my code does still work on linux.

Unfortunately on my Mac with MacOS 10.15 it no longer does, since only 64 bit binaries are supported now by Apple.

SCIF commented 4 years ago

Hi @nlitsme , thanks for the response.

Just curious if dlls can work on linux? I run this code on linux as well.

SCIF commented 4 years ago

Hmmmm. I'm quite shocked. I was thinking dlls cannot work in linux. So, application worked without dll errors and produced log like:

ERROR(00000011): CreateDirectory(avic/22)
no fffb: blk:  00090009 0009402b 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          mg:  0009d001 884a76c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 5007a089 00000002
found xip
8b89a73c: romhdr dll:4001c001-4177c0db, phys:884a1000-8b89c934, ram:8b89d000-8e8a1000, copy:2, profile:00000000-00000000, drvglob:00000000-00000000, track:00000000-00000000
imgfs: partition table not found
ERROR(00000011): CreateDirectory(./xip)
033fa6d0 2012-07-19 02:24:30  1470976 M:[00000007] 1SegCore.dll
033f9f30 2012-07-19 05:13:33    95744 M:[00000007] afd.dll
…

Files were extracted in ./xip! That's really good! But why it ignored -d option?

SCIF commented 4 years ago

I have updated dockerfile in order to copy dlls and make it fully working!

@nlitsme , could you explain what happens with directories? Thanks!

nlitsme commented 4 years ago

DLL execution is handled by the code in the dllloader directory, i wrote it to emulate loading the dlls and provide a tiny compatibility layer for basics like LocalAlloc. It only works for dll's with minimal dependencies, like the compression code.

nlitsme commented 4 years ago

"With directories", do you mean: why it does not save to the files to the directory specified after the -d option? ... i wondered the same. it should have though. i will look into it.

SCIF commented 4 years ago

I'm really happy with having this tool and extremely excited. However, I'm bare noob in this area and have a lot of question. Just curious if there is any chat/forum I can ask question regarding this gorgeous tool?

nlitsme commented 4 years ago

Ah, the order of arguments is important, put the -d /app/1/test/22 option before the -extractall argument, and it will work.

nlitsme commented 4 years ago

I think you might still find people on https://forum.xda-developers.com/ which use it, that is where i originally published it, about 10 years ago.