Skip to content

Instantly share code, notes, and snippets.

@johnnykv
Created December 4, 2011 01:27
Show Gist options
  • Save johnnykv/1428761 to your computer and use it in GitHub Desktop.
Save johnnykv/1428761 to your computer and use it in GitHub Desktop.
GCHQ-help1.c
//Johnny Vestergaard - 2011
//jkv@unixcluster.dk
//A bit of help to the GCHQ challenge...
#include <stdio.h>
//Nedenstående er hex koderne fra http://canyoucrackit.co.uk - som viste sig primært(hint: og hvad ellers?!?!) at være assembler instruktioner.
char gchqFunc[] = "\xeb\x04\xaf\xc2\xbf\xa3\x81\xec\x00\x01\x00\x00\x31\xc9\x88\x0c\x0c\xfe\xc1\x75\xf9\x31\xc0\xba\xef\xbe\xad\xde\x02\x04\x0c\x00\xd0\xc1\xca\x08\x8a\x1c\x0c\x8a\x3c\x04\x88\x1c\x04\x88\x3c\x0c\xfe\xc1\x75\xe8\xe9\x5c\x00\x00\x00\x89\xe3\x81\xc3\x04\x00\x00\x00\x5c\x58\x3d\x41\x41\x41\x41\x75\x43\x58\x3d\x42\x42\x42\x42\x75\x3b\x5a\x89\xd1\x89\xe6\x89\xdf\x29\xcf\xf3\xa4\x89\xde\x89\xd1\x89\xdf\x29\xcf\x31\xc0\x31\xdb\x31\xd2\xfe\xc0\x02\x1c\x06\x8a\x14\x06\x8a\x34\x1e\x88\x34\x06\x88\x14\x1e\x00\xf2\x30\xf6\x8a\x1c\x16\x8a\x17\x30\xda\x88\x17\x47\x49\x75\xde\x31\xdb\x89\xd8\xfe\xc0\xcd\x80\x90\x90\xe8\x9d\xff\xff\xff\x41\x41\x41\x41";
//pssst: Der mangler vist noget i ovenstående... Tjek hvorfor ovenstående koden springer i int 0x80 med 0x01 i EAX... hint: 0x42424242
int main()
{
//funktions pointer
void (*funcP)();
funcP = (void(*)()) (&gchqFunc);
printf("ASM instruktionerne fra GCHQ starter her: %p\n", gchqFunc);
printf("Fyr op under gdb, saet et breakpoint og find ud af hvorfor det ikke virker! :-)\n");
funcP();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment