marlkiller / dylib_dobby_hook

A macOS dylib project , aimed at enhancing and extending the functionality of target software.
MIT License
244 stars 73 forks source link

可以改进的地方 #13

Closed miosx closed 7 months ago

miosx commented 7 months ago

TablePlus


static int64_t* (*original_sub2)();
static int64_t* replaced_sub2() {
    int64_t* ret = original_sub2();
    NSObject* obj = (NSObject*)*(ret+5);
    g_licenseModel.deviceID = [obj description];
    return ret;
}

这样就不用hook_device_id了。这个函数是crash的根源。

marlkiller commented 7 months ago

地址不能写死, 不然下个版本就废了,最好用特征码; 而且设备id 有固定的算法, 可以纯本地实现, 可以参考下

mac=$(ifconfig en0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')
Serial=$(system_profiler SPHardwareDataType | grep Serial | awk '{print $4}')
deviceID=$(echo -n "${mac}${Serial}" | md5)
echo $deviceID