https://stackoverflow.com/questions/38428183/how-to-debug-clang-static-linked-libraries-in-vs2015
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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "lldb", | |
| "request": "attach", | |
| "name": "android_attach", | |
| "pid": "13841", | |
| "initCommands": [ | |
| "platform select remote-android", |
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
| static jobject getApplication(JNIEnv *env) { | |
| jobject application = NULL; | |
| jclass activity_thread_clz = env->FindClass("android/app/ActivityThread"); | |
| if (activity_thread_clz != NULL) { | |
| jmethodID currentApplication = env->GetStaticMethodID( | |
| activity_thread_clz, "currentApplication", "()Landroid/app/Application;"); | |
| if (currentApplication != NULL) { | |
| application = env->CallStaticObjectMethod(activity_thread_clz, currentApplication); | |
| } | |
| env->DeleteLocalRef(activity_thread_clz); |
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
| function serialize(obj) | |
| local lua = "" | |
| local t = type(obj) | |
| if t == "number" then | |
| lua = lua .. obj | |
| elseif t == "boolean" then | |
| lua = lua .. tostring(obj) | |
| elseif t == "string" then | |
| lua = lua .. string.format("%q", obj) |
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
| --[[ | |
| Serialzation bytes stream like ActionScript flash.utils.ByteArray. | |
| It depends on lpack. | |
| A sample: https://github.com/zrong/lua#ByteArray | |
| @see http://underpop.free.fr/l/lua/lpack/ | |
| @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html | |
| @author zrong(zengrong.net) | |
| Creation 2013-11-14 |
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
| # -*- coding: UTF-8 -*- | |
| import idaapi | |
| class MemoryDumpForm(idaapi.Form): | |
| """Simple Form to test and combo box controls""" | |
| def __init__(self): | |
| idaapi.Form.__init__(self, r"""STARTITEM 0 | |
| MemoryDump | |
| {FormChangeCb} |
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
| abootimg -u /home/john/Desktop/boot.img -k zImage-dtb -c 'cmdline = console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 msm_watchdog_v2.enable=1 kgdbwait kgdboc=ttyHSL0,115200 kgdbretry=4' | |
| abootimg -i twrp-3.1.0-0-plank.img | |
| abootimg -x twrp-3.1.0-0-plank.img | |
| sudo update-alternatives --install "/usr/bin/java" "java" \ | |
| "/opt/jdk1.6.0_45/bin/java" 1 | |
| sudo update-alternatives --install "/usr/bin/javac" "javac" \ | |
| "/opt/jdk1.6.0_45/bin/javac" 1 | |
| sudo update-alternatives --install "/usr/bin/javaws" "javaws" \ | |
| "/opt/jdk1.6.0_45/bin/javaws" 1 |
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
| #!/bin/bash | |
| DATESTR=`date +%Y%m%d` | |
| rm -f stdout.log.$DATESTR | |
| mv stdout.log stdout.log.$DATESTR | |
| #tail -f stdout.log | |
| java -Xms128m -classpath Server.jar Main 2 8081 $@>> stdout.log 2>&1 & |
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
| _PyVerify_fd(int fd) | |
| { | |
| // const int i1 = fd >> IOINFO_L2E; | |
| // const int i2 = fd & ((1 << IOINFO_L2E) - 1); | |
| // static int sizeof_ioinfo = 0; | |
| // /* Determine the actual size of the ioinfo structure, | |
| // * as used by the CRT loaded in memory | |
| // */ |
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
| HOST=myhost.example.com | |
| PORT=443 | |
| KEYSTOREFILE=dest_keystore | |
| KEYSTOREPASS=changeme | |
| # get the SSL certificate | |
| openssl s_client -connect ${HOST}:${PORT} </dev/null \ | |
| | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ${HOST}.cert | |
| # create a keystore and import certificate |