Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

xhlove xhlove

🏠
Working from home
View GitHub Profile
@xhlove
xhlove / peacock.js
Created Jan 20, 2022
peacock HMAC key frida hook script, use frida 14.2.18
View peacock.js
function jhexdump(array) {
if(!array) return;
console.log("---------jhexdump start---------");
var ptr = Memory.alloc(array.length);
for(var i = 0; i < array.length; ++i)
Memory.writeS8(ptr.add(i), array[i]);
console.log(hexdump(ptr, {offset: 0, length: array.length, header: false, ansi: false}));
console.log("---------jhexdump end---------");
}
@xhlove
xhlove / fix_name.py
Created Oct 31, 2021
去除非法字符,确保文件名正常,文件可以正常写入
View fix_name.py
def fix_name(name: str):
'''
去除可能存在的非法字符
'''
exclude_chars = ["\\", "/", ":", ":", "*", "?", "\"", "<", ">", "|", "\r", "\n", "\t"]
# 去除非法符号
name = ''.join(char if char not in exclude_chars else ' ' for char in name)
# 将之前连续的非法符号 改为单个 _
return '_'.join(name.split())
@xhlove
xhlove / amp4_concat.py
Created Nov 2, 2020
合并amp4为eac3
View amp4_concat.py
'''
作者: weimo
创建日期: 2020-11-02 22:35:31
上次编辑时间: 2020-11-02 22:55:12
一个人的命运啊,当然要靠自我奋斗,但是...
'''
import sys
import gzip
from pathlib import Path
@xhlove
xhlove / xlsx_pasteTOcsv.ps1
Last active Jun 14, 2020
xlsx粘贴到txt文件中的数据,补充数据后转换到csv
View xlsx_pasteTOcsv.ps1
$args = "path/to/paste/file"
$height = -2.333
$results = Select-String -Path $args -Pattern '(\d+[ |\t]{1})?(-?\d+\.?\d+)([ |\t]{1})(-?\d+\.?\d+)' -AllMatches
$ScriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$ScriptPath = $ScriptPath + '\' + [System.IO.Path]::GetFileNameWithoutExtension($args) + '.csv'
$results | foreach{
$newline = "{0:0.000000},{1:0.000000},{2:0.000000}" -F [Double] $_.Matches[0].groups[2].value, [Double] $_.Matches[0].groups[4].value, $height
$newline | Out-File -Encoding UTF8 -Append $ScriptPath
}
View chrome_cdm_func_hook.py
from __future__ import print_function
import frida
import sys
session = frida.attach("chrome.exe")
script = session.create_script("""
var baseAddr = Module.findBaseAddress("chrome.exe");
print("chrome.exe baseAddress is at :"+baseAddr);
View gist:36f18e6aaa87f83ebde803e3716985a8
### Keybase proof
I hereby claim:
* I am xhlove on github.
* I am xhlove (https://keybase.io/xhlove) on keybase.
* I have a public key ASAZcYiIT8HJX42n3c1UN54URbLtogsFW93FUYjy_gmWAQo
To claim this, I am signing this object: