Skip to content

Instantly share code, notes, and snippets.

View betteray's full-sized avatar
🙃

Ray betteray

🙃
  • Beijing
View GitHub Profile
@betteray
betteray / apk_renamer.py
Last active June 24, 2023 06:19
重命名apk文件。下载的某些apk及从设备pull出来的apk文件名称不可读,使用脚本读取包名及版本,以此命名。
import os
import sys
from pyaxmlparser import APK
def main(argv):
src = argv[0]
apk = APK(src)
new_file = os.path.join(os.path.dirname(src), apk.package + "_" + apk.version_name + "_" + apk.version_code) + ".apk"
apk.zip.close()
os.rename(src, new_file)
@betteray
betteray / com.klzgrad.naiveproxy.plist
Last active August 1, 2023 03:44
naiveproxy macos service
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.klzgrad.naiveproxy</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/naive</string>
<string>/usr/local/etc/naiveproxy/config.json</string>
@betteray
betteray / cvimrc
Created March 29, 2021 10:23
my cvim config
set smoothscroll
@betteray
betteray / recover_whatsapp_objc_call.py
Created March 16, 2021 07:05
recovery whatsapp ios client _objc_ call
"""
recovery whatsapp ios client _objc_ call.
"""
for func in idautils.Functions():
flags = idc.get_func_attr(func, FUNCATTR_FLAGS) # skip library & thunk functions
if flags & FUNC_LIB or flags & FUNC_THUNK:
continue
func_name = idc.get_func_name(func)
if func_name.startswith("sub_"):
dism_addr = list(idautils.FuncItems(func))
#find all system call in moudle, and and break point on it
form = idaapi.find_tform("Output window")
idaapi.switchto_tform(form, True)
idaapi.process_ui_action("msglist:Clear")
SVC_TABLE = {0: 'io_setup', 1: 'io_destroy', 2: 'io_submit', 3: 'io_cancel', 4: 'io_getevents', 5: 'setxattr', 6: 'lsetxattr', 7: 'fsetxattr', 8: 'getxattr', 9: 'lgetxattr', 10: 'fgetxattr', 11: 'listxattr', 12: 'llistxattr', 13: 'flistxattr', 14: 'removexattr', 15: 'lremovexattr', 16: 'fremovexattr', 17: 'getcwd', 18: 'lookup_dcookie', 19: 'eventfd2', 20: 'epoll_create1', 21: 'epoll_ctl', 22: 'epoll_pwait', 23: 'dup', 24: 'dup3', 25: 'fcntl', 26: 'inotify_init1', 27: 'inotify_add_watch', 28: 'inotify_rm_watch', 29: 'ioctl', 30: 'ioprio_set', 31: 'ioprio_get', 32: 'flock', 33: 'mknodat', 34: 'mkdirat', 35: 'unlinkat', 36: 'symlinkat', 37: 'linkat', 38: 'renameat', 39: 'umount2', 40: 'mount', 41: 'pivot_root', 42: 'nfsservctl', 43: 'statfs', 44: 'fstatfs', 45: 'truncate', 46: 'ftruncate', 47: 'fallocate', 48: 'faccessat', 49: 'chdir',
set smoothscroll
iOS Simulator
$ lldb
> process attach -n "AppName" -w
Then start app in iOS Simulator (ioslib can do this from command line). LLDB will connect once it discovers the app process.
iOS Device
Use ios-deploy (ios-deploy -d -W -b path/to/foo.app). It will launch and connect an LLDB session.
@betteray
betteray / Online KMS Activator.cmd
Created April 26, 2019 16:46
Activate Windows & Office for 180 Days with online KMS Servers. This script does not install any files in your system and it clears all the leftovers including kms server name after the Activation. For Successful Activation, Internet Must be connected.
@echo off
::::::::::::::::::::::::::::
set "params=Problem_with_elevating_UAC_for_Administrator_Privileges"&if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
fsutil dirty query %systemdrive% >nul 2>&1 && goto :GotPrivileges
:: The following test is to avoid infinite looping if elevating UAC for Administrator Privileges failed
If "%1"=="%params%" (echo Elevating UAC for Administrator Privileges failed&echo Right click on the script and select 'Run as administrator'&echo Press any key to exit...&pause>nul 2>&1&exit)
cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%params%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs"&exit
:GotPrivileges
::::::::::::::::::::::::::::
color 1F
This can be expanded to include CRC8, CRC16 , etc...
: (Objective-C)
#define DEFAULT_POLYNOMIAL 0xEDB88320L
#define DEFAULT_SEED 0xFFFFFFFFL
@interface NSData (CRC)
-(uint32_t) crc32;
-(uint32_t) crc32WithSeed:(uint32_t)seed;
@betteray
betteray / gist:628bd58712b9b07bc02b1582d0a2640e
Created August 29, 2018 06:25 — forked from lee-dohm/gist:3439284
Detect the debugger using Objective-C on iOS or OS X
#include <assert.h>
#include <stdbool.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/sysctl.h>
static bool AmIBeingDebugged(void)
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
{