Skip to content

Instantly share code, notes, and snippets.

View gnought's full-sized avatar
🎯
Focusing

Gnought gnought

🎯
Focusing
  • DevOps, IoT
  • In the clouds above HK
View GitHub Profile
@gnought
gnought / sojson.v5.decrypt.js
Created September 18, 2022 02:17 — forked from zhangshine/sojson.v5.decrypt.js
sojson.v5 解密
// 用法 console.log(decrypt(加密的js内容))
// console里面输出的内容就是解密后的内容,解密后的内容里面仍然含有 _0xXXXX 这样的混淆后的字符串, 需要一点点进行重命名
// 下面的代码以前从网上找的,已经找不到出处了。。。
function decrypt(js_body) {
// 脱壳 && 解密
let js_arr = js_body.split("\n").pop().split(';'),
fun_name = /var\s+(_0x[a-z0-9]+)=/.exec(js_arr[6])[1],
reg_str = fun_name + '\\(' + "'([^']+)',\s*'([^']+)'" + '\\)',
js_str = js_arr.slice(54, js_arr.length - 4).join(' ;'),
@gnought
gnought / xstat
Last active August 29, 2015 14:28 — forked from moiseevigor/xstat
xstat bash function to get file creation time on Linux with EXT4
# For working in Centos 7
xstat() {
for target in "${@}"; do
inode=$(ls -di "${target}" | cut -d ' ' -f 1)
fs=$(df "${target}" | tail -2 | head -n 1 | awk '{print $1}')
crtime=$(sudo debugfs -R 'stat <'"${inode}"'>' "${fs}" 2>/dev/null |
grep -oP 'crtime.*--\s*\K.*')
printf "%s\t%s\n" "${crtime}" "${target}"
done
}