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
#!/home/asingh/local/bin/ruby | |
require 'rubygems' | |
require 'memprof' | |
Memprof.start | |
12.times{ "abc" } | |
Memprof.stats | |
Memprof.stop |
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
STARTTIME=`date +%s` | |
cd ~ | |
wget https://sourcery.mentor.com/sgpp/lite/arm/portal/package9728/public/arm-none-linux-gnueabi/arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 | |
tar -xjf arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 | |
export PATH=~/arm-2011.09/bin:$PATH | |
rm arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 | |
mkdir nmap-android | |
cd nmap-android | |
wget http://nmap.org/dist/nmap-5.51.tar.bz2 | |
tar -xjf nmap-5.51.tar.bz2 |
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
/** | |
* Copies the native binary from resource to path | |
* | |
* @param path | |
* path to where the native binary needs to be copied | |
* | |
* @param resource | |
* integer value of the resource (e.g. R.raw.synscanner) | |
* | |
*/ |
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
#define PING_TIMEOUT 2 | |
struct in_addr ouraddr = { 0 }; | |
unsigned long global_rtt = 0; | |
//nmap | |
/* A relatively fast (or at least short ;) ping function. Doesn't require a | |
seperate checksum function */ | |
int isup(struct in_addr target) { | |
int res, retries = 3; | |
struct sockaddr_in sock; |
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
uint16_t csum (uint16_t *addr, int len) { | |
//RFC 1071 | |
register long sum = 0; | |
int count = len; | |
uint16_t temp; | |
while (count > 1) { | |
temp = htons(*addr++); | |
sum += temp; | |
count -= 2; |
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
struct pseudo_hdr { | |
u_int32_t src; //src ip | |
u_int32_t dst; //dst ip | |
u_char mbz; //all 0 reserved bits | |
u_char proto; //protocol field | |
u_int16_t len; //tcp length | |
}; | |
//TCP Header |