-
Notifications
You must be signed in to change notification settings - Fork 1
/
win.bat
45 lines (35 loc) · 1 KB
/
win.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
@echo off
setlocal
set "CC=gcc"
set "CCX64=x86_64-w64-mingw32-gcc"
set "INCLUDE_DIR=-Iinclude"
set "CFLAGS=-Os -fno-asynchronous-unwind-tables -nostdlib -fno-ident -fpack-struct=8 -falign-functions=1 -s -falign-jumps=1 -w -falign-labels=1 -fPIC -masm=intel -fpermissive -mrdrnd -Wl,-s,--no-seh,--enable-stdcall-fixup"
set "SRC=src\main.c src\loaders.c src\utils.c"
set "OBJ=main.o loaders.o utils.o peb.o"
set "TARGET=bin\main.exe"
if "%~2"=="" (
echo port and ip are required
exit /b 1
)
<nul set /p =PARSING...
%CC% utils\tobytes.c -o utils\convert.exe -lws2_32
python utils\edit.py %1 %2
if %errorlevel% neq 0 (
del /q utils\convert.exe
exit /b 1
)
echo DONE
<nul set /p =COMPILING...
nasm -f win64 src/peb.asm -o peb.o
for %%i in (%SRC%) do (
%CCX64% %CFLAGS% %INCLUDE_DIR% -c %%i -o %%~ni.o
)
%CCX64% %OBJ% %CFLAGS% -o %TARGET%
echo DONE
<nul set /p =CLEANING...
del /q utils\convert.exe
del /q %OBJ%
python utils\edit.py back
echo DONE
echo.
echo THE EXECUTABLE IS LOCATED AT: %TARGET%