VMP 的逻辑运算只有一个或非, nor, 而不是什么与非

使用或非组合可以实现与, 或, 异或三个运算

# not eax
# not edx
# and eax, edx

def nor(a):
    return ~(a | a)

def nor(a, b):
    return ~a & ~b

def and(a, b):
    # ~(~a | ~b) = a & b
    return nor(nor(a), nor(b))

def or(a, b):
    # ~(~(a | b)) = a | b
    return nor(nor(a, b))

def xor(a, b):
    # ~((~a & ~b) | (a & b))
    return nor(nor(a, b), nor(nor(a), nor(b)))

新买的白色 Nexus 5,要装电信 3G 卡,过程曲折离奇,困难重重,特记录于此,望能救后人于苦海

  1. 准备好 adb 和 fastboot ,然后把手机卡拆下来

  2. 首先,要下载 4.4.2 的 Factory Image

    因为大神做的 boot_with_diag.img 是基于 4.4.2 的

    然后开始刷系统:

    1. 打开 USB 调试,
      1
      
      adb reboot-bootloader
      
    2. 命令行进入 4.4.2 镜像目录,执行
      1
      
      flash-all.bat
      
  3. 刷好后再次进入 bootloader,把 TWRP 2.8.1.0 刷进去

    因为已经下不到 4.4.2 的CF-Auto-Root,所以直接用 TWRP 来 ROOT

    1
    
    fastboot.exe flash recovery openrecovery-twrp-2.8.1.0-hammerhead.img
    

    1
    
    fastboot.exe reboot-bootloader
    

    现在进入 recovery,点击 reboot -> system,把 supersu 刷进去。如果刚才没有拆掉手机卡,这时候进系统会更新半天……

  4. 进系统后,先把 supersu 装好,然后上 Play 装一个 Nexus 5 Field Test Mode,至于怎么上,自己想办法

  5. 进去 Nexus 5 Field Test Mode -> Settings -> LTE,这时候先别点,在命令行里输入

    1
    
    adb shell logcat
    

    然后才点 Edit

    1
    
    D/LG_SVC_CMD( 5768): itemID = 200, Value = XXXXXX
    

    看到日志里有这么一行的,把后面的 Value 记下来,这是你的 SPC,停掉 logcat。把 SPC 输入到 Service Code 里,修改成这样:

    然后点返回,会自动重启手机,此时紧按音量下键,直接进入 bootloader,把上面的 boot_with_diag.img 刷进去

    1
    
    fastboot flash boot boot_with_diag.img
    

    1
    
    fastboot reboot
    

  6. 装好后,打开 USB 调试:

    1
    
    >adb shell
    

    1
    
    shell@hammerhead:/ $ su
    

    1
    
    root@hammerhead:/ # setprop sys.usb.config diag,adb
    

    这时候系统会提示找到新设备,这时候就要安装 LG United Mobile Driver ,否则会变成无法识别的设备

    装好后启动DFS官网), 如下图,双击添加端口

    填写 SPC,点击旁边的 Send SPC

    然后按照下面的图,分别修改,注意要先点 Read,修改后再点 Write,并且只修改图中标注的地方

    注意第一张图的 RumiOnly

    302.prl

    全部改完后,点 Ports 旁边的小插头断开连接,然后重启手机

  7. 重启后再进 DFS 查看 RumiOnly,如果没有变回 NV_ONLY,那么下面就没你什么事了。

    1. 现在把卡插进去,提示重启,不管它,直接关机
    2. 拔卡,再开机。这时候显示有信号,并且运营商显示 SPRINT(或者是禁用漫游指示符)
    3. 再进 DFS,这时候会发现已经是 RumiOnly 了,再重启
    4. 这次会显示无信号了,关机插卡
    5. 开机,这时候已经能正确识别电信了

    最后这步参考了 这个帖子, 感谢 xiaovi123

  8. 最后,进 TWRP 备份你的 EFS

  9. 最后最后,发现手机识别不了 5G Wifi 了,据说解决方法是把路由器 5G 的频段设为两位数即可

  10. 嗯,还没结束。保留数据刷到 5.0.1,方法是去掉 bat 里的 -w 参数,over。是的,over。

    哦,还有 Root 和 TWRP 就不多说了

    另外上面说的 5G 问题也消失了,简直赞

恢复的话, 引用这一段

1
2
3
4
5
6
我在湘潭,刚入的n5,用联通的流量卡时赫然发现只有2g信号,不能上网。
查了一下发现好像湖南联通好像都有这毛病,对n5不友善啊。
解决方法:拨号界面输入*#*#4636#*#*后会跳出测试界面,再按手机信息,
之后下拉至设置首选网络类型,点开列表先选择GSM only,稍等几秒,
可以看到上面的参数变化并且有Edge网络信号了,之后点选WCDMA preferred (wcdma 网络优先),
再稍等几秒,信号就变成3G网络啦

遇到一个企业帐号点不开的问题, 比如搜 4006528705, 点咨询, 会启动一个程序

1
"Z:\QQ\Bin\Timwp.exe" "tencent://message/?Menu=yes&uin=938077113&Service=58&SigT=A7F6FEA02730C988A849DDB63EE9D70AF46E12C7DD07D8ADD698AFE06CA6627AC03EF688EF08C4394715AAB5040917A2F527E1290EB539B00345D474909A3EF426971C04F9B73C4BDD9C4AB546F5710092D4C4D932BB31F7262D5B8B0668013B0245D61EF52DA87859971887B93AB0A75770C7650E0E54DB&SigU=30E5D5233A443AB2B04653BF156181D4CA7EA281D4FE45AC641E25C3DC317E1BCFE44BDDA72FC7827F6A52B67F69B9AEFE596C048A2EFE36E7EF82A24A75B201B47E0C0DFCFC3EA1&fuin={QQUIN}"

该进程通过 RPC 跟 QQ 通讯, 拉起聊天窗口

最后发现是少了一个组件

1
{4534331A-368F-4565-A9F2-46105A68F0DA}

如果没有注册, QQ 会自动注册, 但需要管理员权限

所以用管理员权限启动一次 QQ, 然后打开一次企业帐号, 就 OK 了

QQ 头像右下角没有状态小图标的问题

1
%appdata%\Tencent\QQ\Misc\ClientType

找一个正常的系统, 复制一下上面这个目录下的文件就好了

1
font.js

// ==UserScript==
// @name        font
// @namespace   font
// @version     1
// @match       http*://*/*
// @grant       none
// @run-at document-start
// ==/UserScript==

hosts =[
    'tower.im',
    'qingcloud.com',
    'alipay.com',
    'qunar.com',
    'play.golang.org',
    'atatech.org',
    'knewone.com',
    'coolapk.com',
    '100offer.com',
    'virustotal.com',
    'www.sonkwo.com',
    'v2ex.com',
    'github.com',
    'tmall.com',
    'atom.io',
    //'taobao.com',
    'leetcode.com',
    'qt.io',
    'uber.com',
    'tudou.com',
    'coding.net',
    'faceplusplus.com',
    'alibaba-inc.com',
    'sumisora.org',
    'msdn.itellyou.cn',
    'iosre.com',
    'live.com',
    'android.com',
    '36kr.com',
    'jsonformatter.curiousconcept.com',
    'meituan.com',
    'github.io',
    'acfun.tv',
    'id.apple.com',
    'wholetomato.com',
    'bilibili.com',
    "microsoft.com",
    "vultr.com",
    "aliyun.com",
    "play.rust-lang.org",
];

exts = [
    ".pdf",
    "displayPDF",
    "PdfView",
    "/pdf/",
    "arxiv.org/submit/",
];

function rstr(f) {
  return f.toString().
      replace(/^[^\/]+\/\*!?/, '').
      replace(/\*\/[^\/]+$/, '');
}

var style = rstr(function() {/*!
* {
  font-family: "YaHei Consolas Hybrid", "WenQuanYi Micro Hei Mono", "WenQuanYi Micro Hei", "Microsoft Yahei Mono", "Microsoft Yahei", sans-serif, "Simsun" !important;
}

// for taobao.com, alipay.com, tmail.com
.iconfont {
  font-family: "iconfont", "shop-iconfont", "global-iconfont", "global", "uxiconfont", "rei" !important;
}

.mui-iconfont {
  font-family: "mui-iconfont", "iconfont", "shop-iconfont", "global-iconfont", "uxiconfont", "rei" !important;
}

a .icon {
  font-family: "vip-font", "iconfont", "shop-iconfont", "global-iconfont", "uxiconfont", "rei" !important;
}

// for github.com
[class*="octicon"] {
  font-family: octicons !important;
}

input:focus, input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
outline: 2px solid #6FA1D9 !important;
-webkit-box-shadow:0px 0px 5px #6FA1D9 !important;
}

input[type="checkbox"]:focus,input[type="submit"]:focus,input[type="reset"]:focus, input[type="radio"]:focus {
outline: 1px solid #6FA1D9 !important;
}

input[type="text"], input[type="password"], textarea {
border:#ccc 1px solid;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}

input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
border: 2px solid #6FA1D9 !important;
-webkit-box-shadow:0px 0px 5px #6FA1D9 !important;outline:none
}

input[type="checkbox"]:focus,input[type="submit"]:focus,input[type="reset"]:focus, input[type="radio"]:focus {
border: 1px solid #6FA1D9 !important; outline:none
}


*/});

(function () {
    for (var h of hosts) {
        if (location.hostname.indexOf(h) != -1)
            return;
    }

    for (var e of exts) {
        if (location.href.indexOf(e) != -1)
            return;
    }

    var link = document.createElement("link");
    link.href = 'data:text/css;base64,' + btoa(style);
    link.type = "text/css";
    link.rel = "stylesheet";
    document.documentElement.insertBefore(link, null);
})();

1
aliway.js

// ==UserScript==
// @name        aliway
// @namespace   aliway
// @version     1
// @grant       none
// @run-at document-end
// ==/UserScript==

function rstr(f) {
  return f.toString().
      replace(/^[^\/]+\/\*!?/, '').
      replace(/\*\/[^\/]+$/, '');
}

var style = rstr(function() {/*!
body {
    -moz-user-select: text !important;
    -webkit-user-select: text !important;
    -ms-user-select: text !important;
    -khtml-user-select: text !important;
    user-select: text !important;
}

.tpc_content {
    background: none !important;
}

.score {
    background: none !important;
}

*/});

(function () {

    if (location.hostname.indexOf('www.aliway.com') == -1)
        return;

    document.onselectstart = null;
    document.oncontextmenu = null;
    document.body.ondrag = null;

    var link = document.createElement("link");
    link.href = "data:text/css;base64," + window.btoa(style)
    link.type = "text/css";
    link.rel = "stylesheet";
    document.documentElement.insertBefore(link, null);

})()

1
zhihu.js

// ==UserScript==
// @name        zhihu
// @namespace   zhihu
// @version     1
// @grant       none
// @run-at document-idle
// ==/UserScript==

function removeCopy() {
    var answers = $('div[class*=zm-item-rich-text][class*=js-collapse-body]');

    for (var i = 0; i != answers.length; ++i) {
        var e = answers[i]
        var events = $._data(e, 'events');
        events && delete(events.copy)
    }
}

(function () {

    if (location.hostname.indexOf('www.zhihu.com') == -1)
        return;

    document.addEventListener("copy", function(e){e.stopPropagation();}, true);
})()

1
login.taobao.com.js

// ==UserScript==
// @name        taobao login
// @namespace   taobao login
// @version     1
// @match       http*://*/*
// @grant       none
// @run-at document-idle
// ==/UserScript==

(function () {
    if (location.hostname.indexOf('login.taobao.com') == -1)
        return;

    var switched = false;

    var id = setInterval(function() {
            var loginBox = document.getElementById('J_LoginBox');
            if (loginBox === null) {
                //console.log('not found');
                return;
            }

            if (loginBox.attributes.class.value.indexOf('module-quick') == -1) {
                //console.log('not found 2');
                return;
            }

            //console.log('clicked');
            document.getElementById('J_Quick2Static').click();
            clearInterval(id);

        }, 100
    );
})();