This file contains hidden or 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
| // 演示代码 | |
| // #import <mach-o/dyld-interposing.h> | |
| // from dyld-interposing.h | |
| #define DYLD_INTERPOSE(_replacement,_replacee) __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee }; | |
| ssize_t hacked_write(int fildes, const void *buf, size_t nbyte) | |
| { | |
| printf("[++++]into hacked_write---by piaoyun"); | |
| return write(fildes, buf, nbyte); | |
| } |
This file contains hidden or 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
| # configure proxy for git while on corporate network | |
| # From https://gist.github.com/garystafford/8196920 | |
| function proxy_on(){ | |
| # assumes $USERDOMAIN, $USERNAME, $USERDNSDOMAIN | |
| # are existing Windows system-level environment variables | |
| # assumes $PASSWORD, $PROXY_SERVER, $PROXY_PORT | |
| # are existing Windows current user-level environment variables (your user) | |
| # environment variables are UPPERCASE even in git bash |
This file contains hidden or 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
| use std::str; | |
| fn main() { | |
| // -- FROM: vec of chars -- | |
| let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
| // to String | |
| let string1: String = src1.iter().collect::<String>(); | |
| // to str | |
| let str1: &str = &src1.iter().collect::<String>(); | |
| // to vec of byte |
This file contains hidden or 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
| Set-ExecutionPolicy Unrestricted; | |
| iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); | |
| get-boxstarter -Force; | |
| Install-BoxstarterPackage -PackageName 'https://gist.githubusercontent.com/OALabs/afb619ce8778302c324373378abbaef5/raw/4006323180791f464ec0a8a838c7b681f42d238c/oalabs_x86vm.ps1'; |