aboutsummaryrefslogtreecommitdiffstats
path: root/PolyglotFile/polyglotpdfraw.py
diff options
context:
space:
mode:
authorben2018-09-29 14:06:08 +0200
committerben2018-09-29 14:06:08 +0200
commitfc7e44a646462315effed63ad28f6ce0f3241ec9 (patch)
tree4108dc22f70170e5d9f189c02a2bc171beceaf89 /PolyglotFile/polyglotpdfraw.py
parent04eb07f3210d91fadf6b75187bdc72ce713f587d (diff)
downloadtruepolyglot-fc7e44a646462315effed63ad28f6ce0f3241ec9.tar.gz
truepolyglot-fc7e44a646462315effed63ad28f6ce0f3241ec9.tar.bz2
truepolyglot-fc7e44a646462315effed63ad28f6ce0f3241ec9.tar.xz
Rename pdfraw to pdfany and allow 2 payloads. v1.5.21.5.2
Diffstat (limited to 'PolyglotFile/polyglotpdfraw.py')
-rw-r--r--PolyglotFile/polyglotpdfraw.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/PolyglotFile/polyglotpdfraw.py b/PolyglotFile/polyglotpdfraw.py
deleted file mode 100644
index c524788..0000000
--- a/PolyglotFile/polyglotpdfraw.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import logging
-
-'''
- |-------------------------------| -
- |--------- PDF Header ----------K1 | J1
- |-------------------------------| -
- |----- PDF OBJ 1 = RAW Data ----K2 |
- |-------------------------------| -
- |---- Original PDF Ojbects -----K3 | J2
- |-------------------------------| -
- |---------- Xref Table ---------| |
- |-------------------------------K5 |
- |----------- Trailer -----------| |
- |-------------------------------| |
-'''
-
-
-class PolyglotPdfRaw():
- from PdfFileTransformer import Pdf
-
- def __init__(self, Pdf, Raw_filename):
- self.buffer = bytearray()
- self.pdf = Pdf
- self.raw_filename = Raw_filename
- self.buffer = bytearray()
-
- def generate(self):
- raw_buffer = bytearray()
- with open(self.raw_filename, "rb") as f:
- raw_buffer = f.read()
- k2_stream = raw_buffer
- self.pdf.insert_new_obj_stream_at_start(k2_stream)
- self.buffer = self.pdf.get_build_buffer()
-
- def write(self, filename):
- fd = open(filename, "wb")
- fd.write(self.buffer)
- fd.close()