]> git.wh0rd.org - ICEs.git/blobdiff - 290097/test.c
more ices
[ICEs.git] / 290097 / test.c
diff --git a/290097/test.c b/290097/test.c
new file mode 100644 (file)
index 0000000..5b5af72
--- /dev/null
@@ -0,0 +1,29 @@
+#include <stdio.h>
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+
+struct s {
+       u8 anchor[5];
+       u16 table_length;
+} __attribute__((packed));
+
+void some_function(int x);
+
+void other_function(const struct s *pointer)
+{
+       u8 checksum = 0;
+       const u8 *ptr = (const u8 *)(pointer);
+
+       for (unsigned int i = 0; i < 7; ++i)
+               printf("%x\n", ptr[i]);
+//             checksum = (checksum + ptr[i]) & 0xFF;
+
+       printf("%x\n", checksum);
+//     some_function((int)checksum);
+}
+
+int main() {
+       printf("%lu\n", sizeof(struct s));
+       return 0;
+}