This commit is contained in:
zombie maniac 2022-05-14 13:17:13 -04:00
parent 9a927ff1aa
commit d7f36d431d
Signed by: nbrooks211
GPG key ID: F43C85C0DF0C334E
2 changed files with 48 additions and 10 deletions

BIN
a.out

Binary file not shown.

56
main.c
View file

@ -6,23 +6,39 @@
int *tits = 43; int *tits = 43;
uint8_t memory[1024]; uint8_t memory[65535];
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 = 0; uint16_t tmpip;
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] = 5; memory[257] = 130;
memory[258] = 0; memory[258] = 0;
memory[259] = 0; memory[259] = 0;
memory[260] = 69; memory[260] = 'u';
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){
@ -32,16 +48,38 @@ 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') {
memory[destination] = sourceimm;
} else {
int a;
for ( a = 0; a < 8694201337; a = a + 1) {
}
} }
break; 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;
@ -53,19 +91,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 > 8) { if (currenttime - prevtime > 19) {
//GDB USER REEEEEEEEEE //GDB USER REEEEEEEEEE
tits = NULL; tits = NULL;
puts(tits); puts(tits);