Skip to content

Instantly share code, notes, and snippets.

View paulw54jrn's full-sized avatar

Paul paulw54jrn

  • Sydney, Australia
View GitHub Profile
/**********************
* superDrEvalBros.js *
**********************
*
* You're still here?! Well, Dr. Eval, let's see
* how well you can operate with one less dimension.
*
* Give up now. Unless you have a magic mushroom
* up your sleeve, it's all over.
*/
/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/
@paulw54jrn
paulw54jrn / RE4
Last active August 29, 2015 14:02
int func(int number){
long result = number * 0x4EC4EC4F;
int higher = result >> 34;
int lower = result & 0x00000000FFFFFFFF;
lower = lower >> 31;
return higher - lower;
}
@paulw54jrn
paulw54jrn / RE-3
Last active August 29, 2015 14:02
void removeDot(char *str){
int size = strlen(str);
char *memory = malloc(size);
memset(memory,0,size);
int i,j;
for( i=0;j=0;i<size;i++){
if( str[i] != "." ){
memory[j++] = str[i];
}
int read_msg_from_socket(int sock_fd,struct sm_msg *msg){
char buffer[sizeof(struct sm_msg)] = {};
size_t buffer_len = 0;
int nbytes = 0;
if( NULL == msg ){
return -1;
}
do{
nbytes = recv(sock_fd,buffer + buffer_len,sizeof(struct sm_msg) - buffer_len,MSG_WAITALL);