Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid padding on ISO Error #86

Open
h4xhor opened this issue Mar 29, 2022 · 2 comments
Open

Invalid padding on ISO Error #86

h4xhor opened this issue Mar 29, 2022 · 2 comments

Comments

@h4xhor
Copy link

h4xhor commented Mar 29, 2022

Hi clalancette,

Thanks for creating this project. It works great on Linux ISOs!

I am trying to use it to add files and directories on Windows ISOs using the examples. I tested on Windows Server 2019 evaluation ISO.

Here is the code for creating an ISO using an existing ISO (argv[1] is the original ISO name and argv[2] is the output ISO name):

import sys
import pycdlib

iso = pycdlib.PyCdlib()
iso.open(sys.argv[1])

iso.add_directory(iso_path='/DIR1')

iso.write(sys.argv[2])

iso.close()

Here is the code read.py to read the created ISO:

import sys
import pycdlib

iso = pycdlib.PyCdlib()
iso.open(sys.argv[1])

for child in iso.list_children(iso_path='/'):
    print(child.file_identifier())

iso.close()

When I run the read code on the newly generated ISO I get the error:

Traceback (most recent call last):
  File "read.py", line 5, in <module>
    iso.open(sys.argv[1])
  File "/home/h4xhor/venv/lib/python3.8/site-packages/pycdlib/pycdlib.py", line 4143, in open
    self._open_fp(fp)
  File "/home/h4xhor/venv/lib/python3.8/site-packages/pycdlib/pycdlib.py", line 2337, in _open_fp
    ic_level, lastbyte = self._walk_directories(self.pvd, extent_to_ptr,
  File "/home/h4xhor/venv/lib/python3.8/site-packages/pycdlib/pycdlib.py", line 1043, in _walk_directories
    raise pycdlibexception.PyCdlibInvalidISO('Invalid padding on ISO')
pycdlib.pycdlibexception.PyCdlibInvalidISO: Invalid padding on ISO

I also noticed that the DIR1 is not there when I mount the new ISO.

May you please tell me what I'm doing wrong?

@clalancette
Copy link
Owner

Hm, that's weird. That should just work. I'll give it a try if I can get my hands on a Windows ISO.

@h4xhor
Copy link
Author

h4xhor commented Jun 7, 2022

We can get evaluation versions of Windows. I think the current place to get them is from Windows Server 2019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants