@@ -32,6 +32,10 @@ def get_parent(self):
3232 self .parent = self .parent .parent
3333
3434 def setup_named_folder_list (self ):
35+ """
36+ Description:
37+ Setup the main named folder list. If the user has provided a list, add the must folders to it
38+ """
3539 if self .folders_name_list is None :
3640 self .folders_name_list = self .folders_names_must
3741 elif len (self .folders_name_list ) > 1 :
@@ -41,7 +45,7 @@ def setup_named_folder_list(self):
4145 def setup_named_folders (self ):
4246 """
4347 Description:
44- Create folders for the challenge
48+ Create folders for the challenge. (data, files, payloads)
4549 """
4650
4751 self .folder_payloads = None
@@ -53,7 +57,10 @@ def setup_named_folders(self):
5357 self .folder_payloads = Path (self .parent , "payloads" )
5458
5559 def create_parent_folder (self ):
56- """ """
60+ """
61+ Description:
62+ Create the parent folder of the file that called the class if they don't exist
63+ """
5764
5865 self .folder_data = Path (self .parent , "data" )
5966 self .folder_files = Path (self .parent , "files" )
@@ -65,17 +72,14 @@ def create_parent_folder(self):
6572 self .folder_files ,
6673 ]
6774
68- # add the folders that are in the named_list but are not in the folder_list
69- # Make the folder_list public
70-
7175 for folder in folder_list :
7276 if not folder .exists ():
7377 folder .mkdir ()
7478
7579 def prepare_space (self , files = None , folder = None , test_text = "picoCTF{test}" ):
7680 """
7781 Description:
78- Prepare the space for the challenge by creating the folders if they don't exist
82+ Prepare the space for the challenge by creating the folders if they don't exist, create files from the file list provided
7983 """
8084 files = files if files else []
8185 folder = folder if folder else self .folder_files
@@ -86,9 +90,13 @@ def prepare_space(self, files=None, folder=None, test_text="picoCTF{test}"):
8690 f .write (test_text )
8791
8892 def get_challenge_file (self ):
89- if self .file and self .folder_data :
93+ """
94+ Description:
95+ Get the challenge file and assign it to the self.challenge_file for ease of access
96+ """
97+ if self .file and self .folder_files :
9098 self .challenge_file = Path (self .folder_files , self .file )
91- elif not self .folder_data :
99+ elif not self .folder_files :
92100 if self .debug :
93101 print ("Data folder not found" )
94102
@@ -156,6 +164,7 @@ def pcap_open(self, file=None):
156164 Description:
157165 Open the pcap file with scapy and saves it in self.packets
158166 """
167+ # Todo : Transfer into a different class that will be mainly for packet analysis
159168
160169 if not file :
161170 file = self .challenge_file
@@ -204,6 +213,12 @@ def search_files(
204213 return output
205214
206215 def search_for_base64 (self , file , * args , ** kwargs ):
216+ """
217+ Depracated, checkout search_for_base64_file
218+ """
219+ return self .search_for_base64_file (file , * args , ** kwargs )
220+
221+ def search_for_base64_file (self , file , * args , ** kwargs ):
207222 """
208223 Description:
209224 Search for base64 string in the file
0 commit comments