jordanbray
-
Posts
7 -
Joined
-
Last visited
Posts posted by jordanbray
-
-
wtf, why does he win? You cant even read the damn code! Are we trying to make the best bloatware?
That was the point... Also, I'm pretty sure bloatware is unneeded features/programs. This would be classified as obfuscated code. Hint:
Code for the challenge IOCCC style...I was kinda trying to make illegible code...
In other news, the next challenge may (should) be deciphering what I wrote...
-
it's definitely valid... output:
jordan@jordan-desktop:~$ gcc -Wall -o main01 main01.c main01.c: In function ‘main’: main01.c:42: warning: pointer targets in passing argument 1 of ‘print_str’ differ in signedness main01.c:43: warning: pointer targets in passing argument 1 of ‘print_str’ differ in signedness main01.c:45: warning: format ‘%d’ expects type ‘int *’, but argument 2 has type ‘void *’ main01.c:51: warning: pointer targets in passing argument 1 of ‘print_str’ differ in signedness main01.c:67: warning: pointer targets in passing argument 1 of ‘print_str’ differ in signedness jordan@jordan-desktop:~$ ./main01 ***************************** * This is obfusated code to * * print numbers in binary. * ***************************** Enter a number to be converted to hex: 100 This is the output of way 1 01100100 This is the output of way 2 00000000000000000000000001100100 jordan@jordan-desktop:~$ ./main01 ***************************** * This is obfusated code to * * print numbers in binary. * ***************************** Enter a number to be converted to hex: 64 This is the output of way 1 01000000 This is the output of way 2 00000000000000000000000001000000 jordan@jordan-desktop:~$ ./main01 ***************************** * This is obfusated code to * * print numbers in binary. * ***************************** Enter a number to be converted to hex: 256 This is the output of way 1 000100000000 This is the output of way 2 00000000000000000000000100000000 jordan@jordan-desktop:~$
The compiler complains a bit and it says 'converted to hex' instead of 'converted to binary', but it does the job, twice (one uses printf to get it to hex first and I decided that was cheating, so I solved it a different way too).
-
Name is Jordan. At the University of Louisville for computer engineering and computer science. I'm male and 19.
-
There will never be a perfect secure website :O
At least i don't think so!
Arguably, but you should at least, you know, try to have a brain when designing a website. It makes my brain hurt reading code like that...
-
5215...
Questions:
1) I wonder if I can take out a loan and use my dead body as collateral?
2) The real question is how much is my living body worth?
3) I wonder how the calculator writer figured out this algorithm?
4) Did he just look at a list of what other dead people sold for and tried to find a formula?
5) Who buys dead people?
5 points for anyone who reverse engineers this algorithm to figure out the answers someone selected based only on their price.
-
FIRST POST AT HAK. 5!
Code for the challenge IOCCC style. . .
#include <stdio.h> #include <stdlib.h> #include <assert.h> void print_str(unsigned char *str) { printf("%c", *str); while (*str != str[-1]) { str++; printf("%c", *str - (-1)[str]); } } int main(int argc, char *argv[]) { char str1[] = { 0x2a, 0x54, 0x7e, 0xa8, 0xd2, 0xfc, 0x26, 0x50, 0x7a, 0xa4, 0xce, 0xf8, 0x22, 0x4c, 0x76, 0xa0, 0xca, 0xf4, 0x1e, 0x48, 0x72, 0x9c, 0xc6, 0xf0, 0x1a, 0x44, 0x6e, 0x98, 0xc2, 0xcc, 0xf6, 0x16, 0x6a, 0xd2, 0x3b, 0xae, 0xce, 0x37, 0xaa, 0xca, 0x39, 0x9b, 0x01, 0x76, 0xe9, 0x4a, 0xbe, 0x23, 0x87, 0xa7, 0x0a, 0x79, 0xdd, 0x42, 0x62, 0xd6, 0x45, 0x65, 0x8f, 0x99, 0xc3, 0xe3, 0x53, 0xc5, 0x2e, 0x9c, 0x10, 0x30, 0x9e, 0x13, 0x80, 0xe2, 0x47, 0xb9, 0x2c, 0x4c, 0xb5, 0x23, 0x43, 0xa5, 0x0e, 0x7c, 0xdd, 0x4f, 0xc8, 0xf6, 0x16, 0x36, 0x60, 0x6a, 0x94, 0xbe, 0xe8, 0x12, 0x3c, 0x66, 0x90, 0xba, 0xe4, 0x0e, 0x38, 0x62, 0x8c, 0xb6, 0xe0, 0x0a, 0x34, 0x5e, 0x88, 0xb2, 0xdc, 0x06, 0x30, 0x5a, 0x84, 0xae, 0xd8, 0x02, 0x2c, 0x36, 0x36 }; /* no, it's not ascii */ char str2[] = { 0x45, 0xb3, 0x27, 0x8c, 0xfe, 0x1e, 0x7f, 0x9f, 0x0d, 0x82, 0xef, 0x51, 0xb6, 0x28, 0x48, 0xbc, 0x2b, 0x4b, 0xad, 0x12, 0x32, 0x95, 0x04, 0x72, 0xe8, 0x4d, 0xbf, 0x33, 0x98, 0xfc, 0x1c, 0x90, 0xff, 0x1f, 0x87, 0xec, 0x64, 0x9e, 0xbe, 0xbe }; // ascii strings are NULL terminated char str3[] = { 0x54, 0xbc, 0x25, 0x98, 0xb8, 0x21, 0x94, 0xb4, 0x28, 0x90, 0xf5, 0x15, 0x84, 0xf9, 0x6d, 0xdd, 0x52, 0xc6, 0xe6, 0x55, 0xbb, 0xdb, 0x52, 0xb3, 0x2c, 0x4c, 0x7d, 0x87, 0x87 }; char str4[] = { 0x54, 0xbc, 0x25, 0x98, 0xb8, 0x21, 0x94, 0xb4, 0x28, 0x90, 0xf5, 0x15, 0x84, 0xf9, 0x6d, 0xdd, 0x52, 0xc6, 0xe6, 0x55, 0xbb, 0xdb, 0x52, 0xb3, 0x2c, 0x4c, 0x7e, 0x88, 0x88 }; void **p; print_str(str1); print_str(str2); scanf("%d", *((!(*((!(p = malloc(sizeof(int))) ? abort() : p), p) = malloc(sizeof(int))) ? abort() : p), p)); void *buf; /* way one */ sprintf((((buf = malloc(42 /* more than the meaning of life */)) == NULL ? abort() : buf), buf), "%x", 0[0[(int **) p]]); print_str(str3); while (*(char *)buf) { if (*(char *)buf >= 'a') *(char *)buf -= 'a' - 10; else *(char *)buf &= ~'0'; printf("%d", (*(char *)buf & 8) >> 3); printf("%d", (*(char *)buf & 4) >> 2); printf("%d", (*(char *)buf & 2) >> 1); printf("%d", (*(char *)buf & 1)); buf++; } printf("n"); /* way two */ print_str(str4); char i, j; i = 3 + (j ^= j); do { if (!(j % 8)) { i[0[(char **) p]] = ((i[0[(char **) p]] & 0xf0) >> 4) | ((i[0[(char **) p]] & 0x0f) << 4); i[0[(char **) p]] = ((i[0[(char **) p]] & 0xcc) >> 2) | ((i[0[(char **) p]] & 0x33) << 2); i[0[(char **) p]] = ((i[0[(char **) p]] & 0xaa) >> 1) | ((i[0[(char **) p]] & 0x55) << 1); } printf("%d", (i[0[(char **) p]] >> j) & 1); } while ((j = (++j % 8)) || i--); printf("n"); return 0; }
Have fun if you try to decipher it :-P
Help With C [arrays]
in Applications & Coding
Posted
fixed everything...
also, you don't need return statements on your void functions...