验证中...
开源中国 2018 年度最后一场技术盛会邀你来约~错过就要等明年啦!点此立即预约
语言: PHP
分类: 其他
最后更新于 2018-12-09 10:36
片段 1 片段 2 片段 3
版本1
原始数据 复制代码
#!/usr/bin/env php
<?php
$hone_dir_lib = '/Users/phpdragon/library/preferences/';
del_libary_files($hone_dir_lib);
$platformEpert = random_generator(6);
$platformSerialNumber = random_generator(8);
$replace_str = sprintf('IOPlatformExpert%s%sIOPlatformSerialNumber%s%s%sUUID',$platformEpert,chr(0),chr(0),$platformSerialNumber,chr(0));
$nul_str = '\x00'; //空字符
$pattern = sprintf('/IOPlatformExpert[0-9a-zA-Z]{6,6}\x00IOPlatformSerialNumber%s[0-9a-zA-Z]{8,8}%sUUID/',$nul_str,$nul_str);
$files = [
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer',
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Service',
'/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Desktop',
];
foreach($files as $file){
idpatch($file,$pattern,$replace_str);
}
echo "
ID changed sucessfully.
!!! Restart computer before using TeamViewer !!!!
";
function idpatch($file,$pattern,$replace_str){
if(!is_file($file)){
return;
}
$content = file_get_contents($file);
echo('a: '.substr($content,strpos($content, 'IOPlatformExpert'),59))."\r\n";
$content = preg_replace($pattern,$replace_str, $content);
echo('c: '.substr($content,strpos($content, 'IOPlatformExpert'),59))."\r\n";
file_put_contents($file,$content);
}
function del_libary_files($dir){
if(!is_dir($dir)) return false;
$handle = opendir($dir);
$files = [];
if($handle){
while(($fl = readdir($handle)) !== false){
$file = $dir.$fl;
if(is_file($file) && (strpos(strtolower($file),'teamviewer') !== false)){
echo "delete ".$file ."\r\n";
unlink($file);
}
}
}
return $files;
}
function random_generator($length = 8){
$pattern = '1A2B3C4D5E6F7G8H9IJKLOMNOPQRSTUVWXYZ';
for($i=0;$i<$length;$i++){
$key .= $pattern{mt_rand(0,35)}; //生成php随机数
}
return $key;
}
版本2
原始数据 复制代码
#!/usr/bin/env php
<?php
$hone_dir_lib = '/Users/phpdragon/library/preferences/';
del_libary_files($hone_dir_lib);
$platformEpert = random_generator(6);
$platformSerialNumber = random_generator(8);
$files = [
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer',
'/Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Service',
'/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Desktop',
];
foreach($files as $file){
idpatch($file,$platformEpert,$platformSerialNumber);
}
echo "
ID changed sucessfully.
!!! Restart computer before using TeamViewer !!!!
";
function idpatch($file,$platformEpert,$platformSerialNumber){
if(!is_file($file)){
return;
}
$content = file_get_contents($file);
echo('a: '.substr($content,strpos($content, 'IOPlatformExpert'),59))."\r\n";
$pattern = '/IOPlatformExpert[0-9a-zA-Z]{6,6}/';
$replace_str = sprintf('IOPlatformExpert%s',$platformEpert);
$content = preg_replace($pattern,$replace_str, $content);
$nul_str = '\x00'; //空字符
$pattern = sprintf('/IOPlatformSerialNumber%s[0-9a-zA-Z]{8,8}%sUUID/',$nul_str,$nul_str);
$replace_str = sprintf('IOPlatformSerialNumber%s%s%sUUID',chr(0),$platformSerialNumber,chr(0));
$content = preg_replace($pattern,$replace_str, $content);
//preg_match_all($pattern,$content,$outPut);
//var_dump($outPut);exit;
echo('c: '.substr($content,strpos($content, 'IOPlatformExpert'),59))."\r\n";
file_put_contents($file,$content);
}
function del_libary_files($dir){
if(!is_dir($dir)) return false;
$handle = opendir($dir);
$files = [];
if($handle){
while(($fl = readdir($handle)) !== false){
$file = $dir.$fl;
if(is_file($file) && (strpos(strtolower($file),'teamviewer') !== false)){
echo "delete ".$file ."\r\n";
unlink($file);
}
}
}
return $files;
}
function random_generator($length = 8){
$pattern = '1A2B3C4D5E6F7G8H9IJKLOMNOPQRSTUVWXYZ';
for($i=0;$i<$length;$i++){
$key .= $pattern{mt_rand(0,35)}; //生成php随机数
}
return $key;
}
TeamViewer-v13.2.26558.dmg下载地址
原始数据 复制代码
https://pan.baidu.com/s/1Dcb9ql8G-RnpOOIb1mzN4Q
ps:
https://2726266496.github.io/2018/08/21/%E6%9B%B4%E6%94%B9TeamViewerID%E6%96%B9%E6%B3%95%E6%80%BB%E7%BB%93/
https://github.com/xxsvip/doc/blob/af7a79220f98c09d5aad4aeb718049fefd87414c/teamviewer/windows%E6%9B%B4%E6%8D%A2id.md

评论列表( 0 )

你可以在登录后,发表评论

搜索帮助