This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
path = require('path'), | |
fs = require('fs'), | |
util = require('util'); | |
var extdir = '/extensions'; | |
// create the server | |
http.createServer(_handleReq).listen(3000); | |
console.log('Server running, listening on port 3000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <iterator> | |
int main(int argc, const char * argv[]){ | |
std::ifstream in("testfile.txt"); | |
std::vector<std::string> vec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <iterator> | |
#include <unistd.h> | |
#include <sys/param.h> | |
//#include <mach-o/dyld.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <iterator> | |
#include <unistd.h> | |
#include <sys/param.h> | |
#include <mach-o/dyld.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// strip filename from path | |
std::string long_path(link_path); | |
size_t pos = long_path.find_last_of("/\\"); | |
std::string relative_path = long_path.substr(0,pos); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LPVOID createMapAndGetBase(LPCTSTR filePath) | |
{ | |
LPVOID fBase = 0; | |
__try{ | |
hFile = CreateFile( filePath, | |
GENERIC_READ|GENERIC_EXECUTE, | |
FILE_SHARE_READ|FILE_SHARE_WRITE, | |
NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline uint16_t EndianSwap16(uint16_t num) | |
{ | |
return (num>>8) | (num<<8); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char* findtag(llist* p){ | |
//holds address to p | |
llist* nextp = p; | |
//traverse llist p | |
while(1){ | |
if(*nextp.tag == 0x41414100){ | |
//tag matches magic tag | |
//not sure if necessary but lets replace address of p with nextp, holding current tag/data | |
p = nextp; | |
//return the data at this index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
typedef struct _llist { | |
struct _llist *next; | |
uint32_t tag; | |
char data[100]; | |
}llist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char* userBuf(llist* p) | |
{ | |
while(1){ | |
//reached end of list | |
if(p->next == 0){return 0;} | |
if(p->tag == 0x41414100) | |
{ | |
//increment | |
return p->data; | |
}else{ |
OlderNewer