MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / main

Function main

extra/cloak/cloak.py:51–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 return data
50
51def main():
52 usage = '%s [-d] -i <input file> [-o <output file>]' % sys.argv[0]
53 parser = OptionParser(usage=usage, version='0.2')
54
55 try:
56 parser.add_option('-d', dest='decrypt', action="store_true", help='Decrypt')
57 parser.add_option('-i', dest='inputFile', help='Input file')
58 parser.add_option('-o', dest='outputFile', help='Output file')
59
60 (args, _) = parser.parse_args()
61
62 if not args.inputFile:
63 parser.error('Missing the input file, -h for help')
64
65 except (OptionError, TypeError) as ex:
66 parser.error(ex)
67
68 if not os.path.isfile(args.inputFile):
69 print('ERROR: the provided input file \'%s\' is non existent' % args.inputFile)
70 sys.exit(1)
71
72 if not args.decrypt:
73 data = cloak(args.inputFile)
74 else:
75 data = decloak(args.inputFile)
76
77 if not args.outputFile:
78 if not args.decrypt:
79 args.outputFile = args.inputFile + '_'
80 else:
81 args.outputFile = args.inputFile[:-1]
82
83 f = open(args.outputFile, 'wb')
84 f.write(data)
85 f.close()
86
87if __name__ == '__main__':
88 main()

Callers 1

cloak.pyFile · 0.70

Calls 5

cloakFunction · 0.85
decloakFunction · 0.85
errorMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…