diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a6ac395 --- /dev/null +++ b/.gitignore @@ -0,0 +1,57 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# debug information files +*.dwo + +defcon \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..fc8fc76 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,33 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/defcon", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "/usr/bin/gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 96dc984..03cbf5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,6 @@ "colors.h": "c", "stdio.h": "c", "globals.h": "c" - } + }, + "C_Cpp.default.compilerPath": "/usr/bin/gcc" } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..8def8d6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "cppbuild", + "label": "Build defcon-chan", + "command": "/usr/bin/gcc", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${workspaceFolder}/main.c", + "-o", + "${workspaceFolder}/defcon", + "-lcurl" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "compiler: /usr/bin/gcc" + } + ] +} \ No newline at end of file diff --git a/defcon b/defcon deleted file mode 100755 index 8e458a7..0000000 Binary files a/defcon and /dev/null differ diff --git a/defconv2 b/defconv2 deleted file mode 100755 index 1043c8b..0000000 Binary files a/defconv2 and /dev/null differ diff --git a/main.c b/main.c index 177b8b3..6b7ad26 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ running: ./defcon author: hornetmaidan */ -#define FILENAME "/tmp/defcon.txt" +#define FILENAME "/tmp/defcon.dat" #define URL "https://defconwarningsystem.com/code.dat" #include diff --git a/src/network.h b/src/network.h index f20d37d..c9fdd46 100644 --- a/src/network.h +++ b/src/network.h @@ -36,7 +36,8 @@ int query_defcon() { fprintf(stderr, "%serror: %s%s\n", COLOR_MAGENTA, curl_easy_strerror(result), COLOR_RESET); fprintf(stdout, "%sservice is currently unreachable, the last DEFCON level is: %s%s\n", COLOR_CYAN, failsafe, COLOR_RESET); fprintf(fp, "%s", failsafe); - fclose(fp); return 1; } + + fclose(fp); } \ No newline at end of file