dissect.target 3.8.dev33__py3-none-any.whl → 3.8.dev34__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -143,6 +143,15 @@ class TargetCmd(cmd.Cmd):
143
143
 
144
144
  return cmd.Cmd.default(self, line)
145
145
 
146
+ def emptyline(self):
147
+ """This function forces Python's cmd.Cmd module to behave like a regular shell.
148
+
149
+ When entering an empty command, the cmd module will by default repeat the previous command.
150
+ By defining an empty ``emptyline`` function we make sure no command is executed instead.
151
+ See https://stackoverflow.com/a/16479030
152
+ """
153
+ pass
154
+
146
155
  def _exec(self, func, command_args_str):
147
156
  """
148
157
  Command execution helper that chains initial command and piped
@@ -720,6 +729,20 @@ class TargetCli(TargetCmd):
720
729
  shutil.copyfileobj(fh, stdout)
721
730
  stdout.flush()
722
731
 
732
+ @arg("path")
733
+ def cmd_zcat(self, args, stdout):
734
+ """print file content from compressed files"""
735
+ paths = self.resolveglobpath(args.path)
736
+ stdout = stdout.buffer
737
+ for path in paths:
738
+ path = self.checkfile(path)
739
+ if not path:
740
+ continue
741
+
742
+ fh = fsutil.open_decompress(path)
743
+ shutil.copyfileobj(fh, stdout)
744
+ stdout.flush()
745
+
723
746
  @arg("path")
724
747
  def cmd_hexdump(self, args, stdout):
725
748
  """print a hexdump of the first X bytes"""
@@ -748,6 +771,15 @@ class TargetCli(TargetCmd):
748
771
 
749
772
  pydoc.pager(path.open("rt", errors="ignore").read(10 * 1024 * 1024))
750
773
 
774
+ @arg("path")
775
+ def cmd_zless(self, args, stdout):
776
+ """open the first 10 MB of a compressed file with zless"""
777
+ path = self.checkfile(args.path)
778
+ if not path:
779
+ return
780
+
781
+ pydoc.pager(fsutil.open_decompress(path, "rt").read(10 * 1024 * 1024))
782
+
751
783
  @arg("path", nargs="+")
752
784
  def cmd_readlink(self, args, stdout):
753
785
  """print resolved symbolic links or canonical file names"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.8.dev33
3
+ Version: 3.8.dev34
4
4
  Summary: This module ties all other Dissect modules together, it provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets)
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Affero General Public License v3
@@ -240,7 +240,7 @@ dissect/target/tools/logging.py,sha256=5ZnumtMWLyslxfrUGZ4ntRyf3obOOhmn8SBjKfdLc
240
240
  dissect/target/tools/mount.py,sha256=oPjE954wRPnuhiXavoTSoZkMGKa5GpH9cMWZ3-piQd8,2320
241
241
  dissect/target/tools/query.py,sha256=Btt_PMVAWIYHhPLg0b8u5e_TDdG8CG5xapxLu82dbSE,11466
242
242
  dissect/target/tools/reg.py,sha256=37g_Xdb5ZbYAkMgQFmZNdKM_wWP9Bcw2Kk6quo1gwZ4,2147
243
- dissect/target/tools/shell.py,sha256=-zr5QaekJi7vXEnS_u8ua4KBSJm5TSJTIy6KlzFTvso,34908
243
+ dissect/target/tools/shell.py,sha256=HICeIN5kCZYyGmAm_riWO9xrGnQmOzSp-Oici4QeO6Y,36003
244
244
  dissect/target/tools/utils.py,sha256=i9gHb-_IK73NEiA9sKVCPkeY80lRj_RYpGXnsy_4Ak8,6727
245
245
  dissect/target/tools/dump/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
246
246
  dissect/target/tools/dump/run.py,sha256=yHn9xl_VjasgiuLpjtZdnLW32QCbkwHfnnTPY6Ck_aw,9689
@@ -251,10 +251,10 @@ dissect/target/volumes/bde.py,sha256=gYGg5yF9MNARwNzEkrEfZmKkxyZW4rhLkpdnPJCbhGk
251
251
  dissect/target/volumes/disk.py,sha256=95grSsPt1BLVpKwTclwQYzPFGKTkFFqapIk0RoGWf38,968
252
252
  dissect/target/volumes/lvm.py,sha256=zXAfszxNR6tOGrKAtAa_E-JhjI-sXQyR4VYLXD-kqCw,1616
253
253
  dissect/target/volumes/vmfs.py,sha256=mlAJ8278tYaoRjk1u6tFFlCaDQUrVu5ZZE4ikiFvxi8,1707
254
- dissect.target-3.8.dev33.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
255
- dissect.target-3.8.dev33.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
256
- dissect.target-3.8.dev33.dist-info/METADATA,sha256=d99d4LbLekrjkDplEZphsBXKlPDPomwWBKK_s31TeQA,9752
257
- dissect.target-3.8.dev33.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
258
- dissect.target-3.8.dev33.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
259
- dissect.target-3.8.dev33.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
260
- dissect.target-3.8.dev33.dist-info/RECORD,,
254
+ dissect.target-3.8.dev34.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
255
+ dissect.target-3.8.dev34.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
256
+ dissect.target-3.8.dev34.dist-info/METADATA,sha256=w87iqHAzoUqr5rasT7zTj2DHOnBqHTJK0SFJctHj9l8,9752
257
+ dissect.target-3.8.dev34.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
258
+ dissect.target-3.8.dev34.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
259
+ dissect.target-3.8.dev34.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
260
+ dissect.target-3.8.dev34.dist-info/RECORD,,