finished
This commit is contained in:
parent
9a927ff1aa
commit
d7f36d431d
2 changed files with 48 additions and 10 deletions
BIN
a.out
BIN
a.out
Binary file not shown.
56
main.c
56
main.c
|
@ -6,23 +6,39 @@
|
|||
|
||||
int *tits = 43;
|
||||
|
||||
uint8_t memory[1024];
|
||||
uint8_t memory[65535];
|
||||
uint8_t opcode;
|
||||
uint8_t destination;
|
||||
uint8_t source1;
|
||||
uint8_t source2;
|
||||
uint8_t sourceimm;
|
||||
|
||||
uint16_t tmpip = 0;
|
||||
uint16_t tmpip;
|
||||
uint8_t tmpip2;
|
||||
|
||||
uint8_t (*gayptr)[65535] = memory+128;
|
||||
|
||||
int thomasgay() {
|
||||
memory[1] = 0x01; //ip
|
||||
memory[2] = 0x00; //ip2 (i think this is big endianness)
|
||||
memory[256] = 1;
|
||||
memory[257] = 5;
|
||||
memory[257] = 130;
|
||||
memory[258] = 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;
|
||||
while (!Halted){
|
||||
|
@ -32,16 +48,38 @@ int thomasgay() {
|
|||
source1 = memory[(memory[1]*256+memory[2])+2];
|
||||
source2 = memory[(memory[1]*256+memory[2])+3];
|
||||
sourceimm = memory[(memory[1]*256+memory[2])+4];
|
||||
printf("asd %d %d %d %d %d asd", opcode, destination, source1, source2, sourceimm);
|
||||
switch (opcode) {
|
||||
case 0:
|
||||
puts(tits);
|
||||
break;
|
||||
case 1:
|
||||
if (!source1 && !source2) {
|
||||
memory[destination] = sourceimm;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (*getenv("DESKTOP_SESSION") == 'b') {
|
||||
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;
|
||||
|
@ -53,19 +91,19 @@ int main () {
|
|||
return 0;
|
||||
} else {
|
||||
asm volatile ("mov $20, %rax");
|
||||
puts("first check pass");
|
||||
//puts("first check pass");
|
||||
goto fucktits;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (*tits > 93) {
|
||||
fucktits:
|
||||
puts("we finally landing");
|
||||
//puts("we finally landing");
|
||||
clock_t prevtime, currenttime;
|
||||
prevtime = clock();
|
||||
puts("a");
|
||||
currenttime = clock();
|
||||
if (currenttime - prevtime > 8) {
|
||||
if (currenttime - prevtime > 19) {
|
||||
//GDB USER REEEEEEEEEE
|
||||
tits = NULL;
|
||||
puts(tits);
|
||||
|
|
Loading…
Reference in a new issue