I think we should distinguish this task in 2 separate goals:
1. what devs of hashcat/oclHashcat need to change/do to facilitate creation of packages.
2. what the people need to do/know whose goal is to prepare the packages (aka maintainers).
Maybe we should discuss this in 2+ different forum threads in the future (such that there exists a general "packaging" thread, a "package maintainer" thread and an "allow packaging" - only for changes in hashcat/oclHashcat source code - thread).
Here below I only discuss what hashcat and oclHashcat need to change (not what the distro maintainers need to do, i.e. not where THEY - maintainers - need to put the files).
Therefore, my discussion here is only about where oclHashcat/hashcat should try to find the files (and which one it should prefer if there are multiple options or files with same name in different locations).
RULES:
1. if the binaries are being run on a non-unix system (e.g. windows. But should we limit it to Linux? what about osx ?), only use [cwd] for every path (as it was before)
2. always prefer current working directory [cwd] if the binary is directly executed from the current directory (e.g. "./oclHashcat64.bin")
3. if the user just runs "hashcat-cli64.bin" / "oclHashcat64.bin" etc (i.e. by using the PATH variable), do not search in [cwd]
4. developers should prefer to use the non-packaged version (i.e. everything is relative to [cwd]), this also implies that kernels (e.g. when disabling BINARY_KERNEL) should only be in [cwd]
5. for temporary files always prefer the /tmp/hashcat/ folder if it exists
6. a not so important but additional feature we could add is to help the user (directly by modifying the hashcat/oclHashcat source code?) to find .rule/.hcmask files etc for instance at ~/.hashcat/ with some kind of inbuilt tab-completion (or wouldn't it be better to modify /extra/tab_completion/oclHashcat64.sh to do so?) ???
7. (what about paths on OSX with cpu hashcat?) ???
TYPE OF FOLDERS:
profile_folder:
- location: [cwd] or (~/.hashcat/) (or should we use ~/.hashcat/oclHashcat/ and ~/.hashcat/hashcat/)
- list of files:
1. [session].pot
2. [session].log
3. [session].restore (and [session].restore.new)
4. [session].outfiles (DIR)
5. [session].induct (DIR)
6. [session].induct/loopback.[TIMESTAMP]_[RANDOM_NUMBER]
7. *.dictstat
8. *.hcstat
9. kernels/4098/*.kernel ???
packaged_file_folder:
- location: [cwd] or /usr/share/hashcat/
- list of files:
1. kernels/4098/*.llvmir
2. kernels/4318/*.cubin
temporary_file_folder:
- location: /tmp/hashcat/ (preferred!?) or [cwd]
- list of files:
1. temp files used for --remove ([hashfile].old and [hashfile].new)
There might be the need to adapt this guide a little bit. Any suggestion is welcome.
1. what devs of hashcat/oclHashcat need to change/do to facilitate creation of packages.
2. what the people need to do/know whose goal is to prepare the packages (aka maintainers).
Maybe we should discuss this in 2+ different forum threads in the future (such that there exists a general "packaging" thread, a "package maintainer" thread and an "allow packaging" - only for changes in hashcat/oclHashcat source code - thread).
Here below I only discuss what hashcat and oclHashcat need to change (not what the distro maintainers need to do, i.e. not where THEY - maintainers - need to put the files).
Therefore, my discussion here is only about where oclHashcat/hashcat should try to find the files (and which one it should prefer if there are multiple options or files with same name in different locations).
RULES:
1. if the binaries are being run on a non-unix system (e.g. windows. But should we limit it to Linux? what about osx ?), only use [cwd] for every path (as it was before)
2. always prefer current working directory [cwd] if the binary is directly executed from the current directory (e.g. "./oclHashcat64.bin")
3. if the user just runs "hashcat-cli64.bin" / "oclHashcat64.bin" etc (i.e. by using the PATH variable), do not search in [cwd]
4. developers should prefer to use the non-packaged version (i.e. everything is relative to [cwd]), this also implies that kernels (e.g. when disabling BINARY_KERNEL) should only be in [cwd]
5. for temporary files always prefer the /tmp/hashcat/ folder if it exists
6. a not so important but additional feature we could add is to help the user (directly by modifying the hashcat/oclHashcat source code?) to find .rule/.hcmask files etc for instance at ~/.hashcat/ with some kind of inbuilt tab-completion (or wouldn't it be better to modify /extra/tab_completion/oclHashcat64.sh to do so?) ???
7. (what about paths on OSX with cpu hashcat?) ???
TYPE OF FOLDERS:
profile_folder:
- location: [cwd] or (~/.hashcat/) (or should we use ~/.hashcat/oclHashcat/ and ~/.hashcat/hashcat/)
- list of files:
1. [session].pot
2. [session].log
3. [session].restore (and [session].restore.new)
4. [session].outfiles (DIR)
5. [session].induct (DIR)
6. [session].induct/loopback.[TIMESTAMP]_[RANDOM_NUMBER]
7. *.dictstat
8. *.hcstat
9. kernels/4098/*.kernel ???
packaged_file_folder:
- location: [cwd] or /usr/share/hashcat/
- list of files:
1. kernels/4098/*.llvmir
2. kernels/4318/*.cubin
temporary_file_folder:
- location: /tmp/hashcat/ (preferred!?) or [cwd]
- list of files:
1. temp files used for --remove ([hashfile].old and [hashfile].new)
There might be the need to adapt this guide a little bit. Any suggestion is welcome.