-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
teach fac to cross-compile to windows
- Loading branch information
Showing
13 changed files
with
333 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ web | |
*.gcno | ||
*.exe | ||
win32/helper.h | ||
win32/bigbro32.h | ||
win32/bigbro64.h | ||
*.dll |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
def convertFile(binary_filename, header_filename, variable_name): | ||
with open(binary_filename, 'rb') as b: | ||
with open(header_filename, 'w') as h: | ||
h.write('''static unsigned char %s[] = { ''' % variable_name); | ||
h.write('''static const unsigned char %s[] = { ''' % variable_name); | ||
stuff = b.read() | ||
h.write(',\n'.join('%d' % ord(stuff[i:i+1]) for i in range(len(stuff)))) | ||
h.write('\n};\n') | ||
|
||
if __name__ == "__main__": | ||
# we are running this as a script | ||
import sys | ||
convertFile(sys.argv[1], sys.argv[2], sys.argv[3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
set -ev | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o bigbro-windows.obj bigbro-windows.c) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o fileaccesses.obj fileaccesses.c) | ||
|
||
(i686-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/helper32.obj win32/helper.c) | ||
|
||
(i686-w64-mingw32-gcc -o win32/helper.exe win32/helper32.obj) | ||
|
||
(python3 build/binary2header.py win32/helper.exe win32/helper.h helper) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/inject.obj win32/inject.c) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/queue.obj win32/queue.c) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -o bigbro.exe bigbro-windows.obj fileaccesses.obj win32/inject.obj win32/queue.obj) | ||
|
||
(i686-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/dll32.obj win32/dll.c) | ||
|
||
(i686-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/hooks32.obj win32/hooks.c) | ||
|
||
(i686-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/inject32.obj win32/inject.c) | ||
|
||
(i686-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/patch32.obj win32/patch.c) | ||
|
||
(i686-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/queue32.obj win32/queue.c) | ||
|
||
(i686-w64-mingw32-gcc -shared -o bigbro32.dll win32/inject32.obj win32/dll32.obj win32/patch32.obj win32/hooks32.obj win32/queue32.obj -lntdll -lpsapi) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/dll.obj win32/dll.c) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/hooks.obj win32/hooks.c) | ||
|
||
(x86_64-w64-mingw32-gcc -Wall -Werror -std=c99 -g -O2 -c -o win32/patch.obj win32/patch.c) | ||
|
||
(x86_64-w64-mingw32-gcc -shared -o bigbro64.dll win32/inject.obj win32/dll.obj win32/patch.obj win32/hooks.obj win32/queue.obj -lntdll -lpsapi) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
| python3 configure.py > .fac | ||
> .fac | ||
c .pyc | ||
|
||
| python3 syscalls/linux.py > syscalls/linux.h | ||
> syscalls/linux.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
printf("creating the file...\n"); | ||
FILE *f = fopen("tmp/foo", "w"); | ||
printf("writing to the file...\n"); | ||
fprintf(f, "this is good\n"); | ||
printf("closing the file...\n"); | ||
fclose(f); | ||
printf("I am about to open the file...\n"); | ||
f = fopen("tmp/Foo", "r"); | ||
printf("I am about to finally close the file...\n"); | ||
if (f) fclose(f); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.