Browse Source

Actually add config param

nosoop 3 years ago
parent
commit
7f84c9e533
2 changed files with 5 additions and 1 deletions
  1. 2 0
      README.md
  2. 3 1
      str0.py

+ 2 - 0
README.md

@@ -12,3 +12,5 @@ License is BSD0.  Do whatever you want with the script as long as I'm not involv
 
 Copy `str0.example.ini` to `str0.ini`, add your sections, then run `python3 str0.py ${FILE}` to
 shut those "RecordSteamInterfaceCreation" messages up for good.
+
+Additional configuration files may be provided by passing `-c ${CONFIGFILE}` to the script.

+ 3 - 1
str0.py

@@ -31,6 +31,8 @@ if __name__ == '__main__':
 			description = "Patches various strings out of the given binary")
 	
 	parser.add_argument('binary', help = "Binary file to patch", type = argparse.FileType(mode = 'rb+'))
+	parser.add_argument('-c', '--config', help = "List of files / strings to match",
+			action = 'append')
 	
 	args = parser.parse_args()
 	
@@ -40,7 +42,7 @@ if __name__ == '__main__':
 		# return multiline value as an evaluated Python literal
 		'pyliteral': ast.literal_eval,
 	}, interpolation = None)
-	config.read("str0.ini", encoding = "utf8")
+	config.read([ "str0.ini" ] + args.config, encoding = "utf8")
 	
 	for target in config.getpyliteral(os.path.basename(args.binary.name), "strings"):
 		if not patch_to_null(mbin, target):