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

Hidding directories in ISO #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Hidding directories in ISO #16

wants to merge 1 commit into from

Conversation

d1zanv
Copy link

@d1zanv d1zanv commented Jun 10, 2024

Problem

As mentionned in the issues #13, it is not possible to hide directories using the flag --hide or --backdoor.

Solution

ChoiSG, who added the functionnality to hide files, used the function set_hidden.
After reviewing how was working the function, I discover that it was possible to hide directories as well with the same function.

First things I did was to add a condition to check, with a regex, if a path contain an extension.

if re.match(r'.+\..+', hideItem):

If there is, the code of ChoiSG do his job.

if re.match(r'.+\..+', hideItem):
    self.logger.text(f'\tHiding file: //{hideItem}')  
    iso2.set_hidden(joliet_path=f'/{hideItem};1')

And, if there is no extension, I consider it is a directory and use almost the same code as for file, except I get rid of the ;1.

else:  
   self.logger.text(f'\tHiding dir : //{hideItem}')  
   iso2.set_hidden(joliet_path=f'/{hideItem}')

At the end, the library which contain the function set_hidden check if the file or directory exist, it then resolve the possible problem of path which are not file or directory.

@d1zanv
Copy link
Author

d1zanv commented Jun 10, 2024

Feel free to tell me if I've made any mistakes in my code or if there are better ways to do it. I made this modification quickly for a personal project and it worked for me, so I thought I'd share it with the community.

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

Successfully merging this pull request may close these issues.

1 participant