aboutsummaryrefslogtreecommitdiff
path: root/xop.c
diff options
context:
space:
mode:
authorxolatile2025-04-27 02:32:20 +0200
committerxolatile2025-04-27 02:32:20 +0200
commitfa84ba406e4043f67069b8d059c63b92b1adf591 (patch)
tree5a3be59429aaa060228fc8dfa097a0e40e2b1163 /xop.c
downloadxolatile-xop-fa84ba406e4043f67069b8d059c63b92b1adf591.tar.xz
xolatile-xop-fa84ba406e4043f67069b8d059c63b92b1adf591.tar.zst
Nopping...
Diffstat (limited to 'xop.c')
-rwxr-xr-xxop.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/xop.c b/xop.c
new file mode 100755
index 0000000..f2b6748
--- /dev/null
+++ b/xop.c
@@ -0,0 +1,58 @@
+/// __ _____ _ __
+/// \ \/ / _ \| '_ \
+/// > < (_) | |_) |
+/// /_/\_\___/| .__/
+/// |_|
+///
+/// Copyright (c) 1997 - Ognjen 'xolatile' Milan Robovic
+///
+/// xolatile@chud.cyou - xop - The evil within...
+///
+/// This program is free software, free as in freedom and as in free beer, you can redistribute it and/or modify it under the terms of the GNU
+/// General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version if you wish...
+///
+/// This program is distributed in the hope that it will be useful, but it is probably not, and without any warranty, without even the implied
+/// warranty of merchantability or fitness for a particular purpose, because it is pointless. Please see the GNU (Geenoo) General Public License
+/// for more details, if you dare, it is a lot of text that nobody wants to read...
+
+#include "xtandard.h"
+
+static procedure echo_byte (natural_8 byte) {
+ output ("0123456789ABCDEF" + byte / 16, 1);
+ output ("0123456789ABCDEF" + byte % 16, 1);
+
+ output (" ", 1);
+}
+
+integer main (integer argc, character * * argv) {
+ integer file = 0;
+ natural_64 size = 0;
+ natural_8 * buffer = null;
+
+ if (argc != 2) {
+ return (log_failure);
+ }
+
+ file = file_open (argv [1], file_flag_read);
+ size = file_size (argv [1]);
+
+ buffer = allocate (size * sizeof (* buffer));
+
+ file_read (file, buffer, size);
+
+ file = file_close (file);
+
+ for (natural_64 offset = 0; offset < size; ++offset) {
+ conditional_print (buffer [offset] == 0x90, "\n/B/1");
+
+ echo_byte (buffer [offset]);
+
+ conditional_print (buffer [offset] == 0x90, "/-");
+ }
+
+ print ("\n");
+
+ buffer = deallocate (buffer);
+
+ return (log_success);
+}