initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import sys, os
|
||||
try:
|
||||
from .generator import generate
|
||||
except ImportError:
|
||||
from generator import generate
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print(f"usage: python -m dropper <input.exe> [output.bat]")
|
||||
sys.exit(1)
|
||||
|
||||
input_path = sys.argv[1]
|
||||
output_path = sys.argv[2] if len(sys.argv) >= 3 else os.path.splitext(os.path.basename(input_path))[0] + '_dropper.bat'
|
||||
|
||||
if not os.path.exists(input_path):
|
||||
print(f"file not found: {input_path}")
|
||||
sys.exit(1)
|
||||
|
||||
with open(input_path, 'rb') as f:
|
||||
exe_data = f.read()
|
||||
|
||||
if not exe_data:
|
||||
print("empty file")
|
||||
sys.exit(1)
|
||||
|
||||
print(f"in: {input_path}")
|
||||
print(f"out: {output_path}")
|
||||
|
||||
if generate(exe_data, output_path):
|
||||
print(f"\ndone: {output_path}")
|
||||
else:
|
||||
print("failed")
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user