qiling icon indicating copy to clipboard operation
qiling copied to clipboard

add_fs_mapper for directories on host

Open psparc82 opened this issue 1 year ago • 2 comments

Hi,

add_fs_mapper only allows you to map specific files to specific files on the host, e.g. add_fs_mapper("/tmp/file1", "/tmp/file1") will map uses of /tmp/file1 in the emulated environment to /tmp/file1 on the host.

Quite often I need to map a directory (such as /tmp) from the host to the emulated environment. The emulated code will then create files in /tmp which I want to analyze later (by reading them from my host /tmp directory). Unfortunately this isn't possible by using add_fs_mapper.

Allowing add_fs_mapper to map directories would save a lot of time in this case

Thank you

psparc82 avatar Feb 12 '24 14:02 psparc82

Thanks for the enhancement idea. fs_mapper could be used also to map objects or classes, maybe this method could be used to work around the gap you identify. That said, why not just create a tmp directory in your rootfs? It will stay there after the emulation finishes.

elicn avatar Feb 12 '24 16:02 elicn

Ah yes I tried adding tmp to the rootfs and it worked exactly how I wanted it to. Thanks for the tip!

psparc82 avatar Feb 12 '24 17:02 psparc82