Compare commits

..

No commits in common. "755d385281c3b3ba25fe5266b81a56a9d7b31899" and "9a927ff1aa67322f055ac882a16ba058d1967484" have entirely different histories.

2 changed files with 10 additions and 48 deletions

BIN
a.out

Binary file not shown.

58
main.c
View file

@ -6,39 +6,23 @@
int *tits = 43; int *tits = 43;
uint8_t memory[65535]; uint8_t memory[1024];
uint8_t opcode; uint8_t opcode;
uint8_t destination; uint8_t destination;
uint8_t source1; uint8_t source1;
uint8_t source2; uint8_t source2;
uint8_t sourceimm; uint8_t sourceimm;
uint16_t tmpip; uint16_t tmpip = 0;
uint8_t tmpip2;
uint8_t (*gayptr)[65535] = memory+128;
int thomasgay() { int thomasgay() {
memory[1] = 0x01; //ip memory[1] = 0x01; //ip
memory[2] = 0x00; //ip2 (i think this is big endianness) memory[2] = 0x00; //ip2 (i think this is big endianness)
memory[256] = 1; memory[256] = 1;
memory[257] = 130; memory[257] = 5;
memory[258] = 0; memory[258] = 0;
memory[259] = 0; memory[259] = 0;
memory[260] = 'u'; memory[260] = 69;
memory[261] = 2;
memory[262] = 131;
memory[263] = 0;
memory[264] = 0;
memory[265] = 'h';
memory[266] = 3;
memory[267] = 132;
memory[128] = 'e';
memory[129] = 'r';
memory[132] = 'f';
memory[133] = 'f';
memory[134] = '9';
memory[135] = '0';
int Halted = 0; int Halted = 0;
while (!Halted){ while (!Halted){
@ -48,39 +32,17 @@ int thomasgay() {
source1 = memory[(memory[1]*256+memory[2])+2]; source1 = memory[(memory[1]*256+memory[2])+2];
source2 = memory[(memory[1]*256+memory[2])+3]; source2 = memory[(memory[1]*256+memory[2])+3];
sourceimm = memory[(memory[1]*256+memory[2])+4]; sourceimm = memory[(memory[1]*256+memory[2])+4];
printf("asd %d %d %d %d %d asd", opcode, destination, source1, source2, sourceimm);
switch (opcode) { switch (opcode) {
case 0:
puts(tits);
break;
case 1: case 1:
if (!source1 && !source2) { if (!source1 && !source2) {
memory[destination] = sourceimm; memory[destination] = sourceimm;
} }
break; break;
case 2: }
if (*getenv("DESKTOP_SESSION") == 'b') { break;
memory[destination] = sourceimm;
} else {
int a;
for ( a = 0; a < 8694201337; a = a + 1) {
} }
}
break;
case 3:
memory[destination] = memory[destination] + 1;
break;
}
//complex way of incrementing ip by 5
tmpip = memory[1]*256+memory[2];
tmpip += 5;
tmpip2 = tmpip >> 8;
memory[1] = tmpip2;
tmpip = tmpip << 8;
tmpip2 = tmpip >> 8;
memory[2] = tmpip2;
puts(gayptr);
}
return 0; return 0;
} }
@ -91,19 +53,19 @@ int main () {
return 0; return 0;
} else { } else {
asm volatile ("mov $20, %rax"); asm volatile ("mov $20, %rax");
//puts("first check pass"); puts("first check pass");
goto fucktits; goto fucktits;
return 1; return 1;
} }
if (*tits > 93) { if (*tits > 93) {
fucktits: fucktits:
//puts("we finally landing"); puts("we finally landing");
clock_t prevtime, currenttime; clock_t prevtime, currenttime;
prevtime = clock(); prevtime = clock();
puts("a"); puts("a");
currenttime = clock(); currenttime = clock();
if (currenttime - prevtime > 9) { if (currenttime - prevtime > 8) {
//GDB USER REEEEEEEEEE //GDB USER REEEEEEEEEE
tits = NULL; tits = NULL;
puts(tits); puts(tits);