forked from bombcrack/bombcrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMake.bat
71 lines (62 loc) · 1.92 KB
/
Make.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@echo off
if not exist ".makenotice" (
echo Notice!
echo This batch file is a self-interpreted emulation of Makefile.
echo Note that it doesn't support key features like running multiple targets or
echo specifying target dependencies. Use at your own risk and read @rem-arked hints in script.
echo.
ping localhost -n 3 >NUL
echo. >.makenotice
)
set PWD=%~dp0
set workdir=%PWD%.work
set tbombdir=%PWD%TBomb
set crackdir=%PWD%Crack
set deobfdir=%PWD%Deobfuscate
if "%1" == "mkenv" goto :mkenv
if "%1" == "getbomb" goto :getbomb
if "%1" == "crack" goto :crack
if "%1" == "prettify" goto :prettify
if "%1" == "clean" goto :clean
:notarget
echo :: No targets found matching '%1'. Exiting.
goto :eof
:getbomb
echo :: Running getbomb target...
if not exist %tbombdir% git clone git://github.com/darkestentropy/tbomb.git %tbombdir% -b historical
goto :aftertarget
:mkenv
@rem @dependsOn getbomb
echo :: Running mkenv target...
mkdir %workdir%
copy %tbombdir%\bomber.py %workdir%\bomber.py.source
goto :aftertarget
:crack
@rem @dependsOn mkenv
echo :: Running crack target...
python %crackdir%\decompress_lzma.py %workdir%
python %crackdir%\debytize.py %workdir%
python %crackdir%\attach_cracker.py %workdir% %crackdir%
python %workdir%\bomber.py.cracker_attached> %workdir%\bomber.py.cracked
copy /Y %workdir%\bomber.py.cracked %workdir%\bomber.py.source
python %crackdir%\decompress_zlib.py %workdir%
copy /Y %workdir%\bomber.py.decompressed %workdir%\bomber.py.cracked
copy /Y %workdir%\bomber.py.cracked %PWD%bomber.py.cracked
goto :aftertarget
:prettify
@rem @dependsOn crack
echo :: Running prettify target...
autopep8 --in-place -aaa %PWD%bomber.py.cracked
goto :aftertarget
:clean
echo :: Running clean target...
rd /s /q %workdir%
rd /s /q %tbombdir%
goto :aftertarget
:aftertarget
if not "%ERRORLEVEL%" == "0" (
echo :: Task failed ^(exit code %ERRORLEVEL%^)
) else (
echo :: Task finished successfully.
)
goto :eof