Category Archives

26 Articles

交叉編譯openresty,修復支持大文件 (LFS)

0   115 轉為簡體

老文存檔,有時間補全

http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html

http://cgit.openembedded.org/meta-openembedded/tree/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch

https://stackoverflow.com/questions/4357570/use-file-offset64-vs-file-offset-bits-64

https://digital-domain.net/largefiles.html

https://stackoverflow.com/questions/35575749/how-to-define-file-offset-bits-large-files-macro-for-solaris-and-hp-aix

http://users.suse.com/~aj/linux_lfs.html

SIM800L EVB x 樹莓派

9   5116 轉為簡體

從Aliexpress上剁了一個SIM800L模塊,長這樣:

VDD接TTL參考電平,需要串口輸出5v(比如51)就接5v,需要輸出3.3v(比如樹莓派)就接3.3v。

要注意的是TTL需要交叉連接,即這個PCB板上的TxDRxD應該分別接樹莓派上的RxDTxD

浪費了我一晚上的青春。

cloudflare-partner-cli: using CNAME on cloudflare

中文版本

This is a CLI program that let you set CNAME to use Cloudflare using the partner program.

Both Python2.x and Python3.x is supported. No extra library is needed.

To use Chinese menu, set environment variable LANG to use UTF-8 (for example, zh_CN.UTF-8).

Usage

  1. Apply for partner program at https://www.cloudflare.com/partners/.
  2. Clone this repository or download script.
  3. Run python ./cloudflare-partner-cli.py.
  4. Enter your host_key. You can get it here.
  5. Enter the account you use to manage domains (your personal account, not partner login account). User key is stored in .cfhost.
  6. Follow the instructions on screen.

Note

  • Value of resolve_to has to be DNS record (for example: google.com) instead of IP address.

cloudflare-partner-cli: 使用CNAME方式接入Cloudflare

0   5188 轉為簡體

English Version

使用Cloudflare partner功能用CNAME方式接入cloudflare。

你可以使用Python2.x或者Python3.x。無需安裝任何依賴。

如需使用中文菜單,請將環境變量的LANG設置為使用UTF-8 (比如zh_CN.UTF-8)。

使用方法

  1. 申請Cloudflare partner計劃 https://www.cloudflare.com/partners/ 。
  2. clone本項目或者直接下載腳本
  3. 運行 python ./cloudflare-partner-cli.py
  4. 輸入 host_key。可以從這裡獲得。
  5. 輸入要用來管理域名的賬號 (你的個人賬號,不是partner賬號)。賬戶信息保存在.cfhost文件中。
  6. 按照屏幕提示操作。

注意

  • 源站地址必須為DNS記錄,如google.com,不能填寫IP地址。

 

解密shc生成的mips架構二進制文件

0   3880 轉為簡體

SHC 是一個將shell腳本加密成二進制文件的腳本。使用隨機生成的密鑰對shell腳本進行RC4加密放到一個全局變量中(編譯後存在data段),然後在運行時解密。

這個解密腳本修改自UnSHc,使之能解密MIPS架構的二進制文件。原始的版本只支持x86/x64指令集,與MIPS指令集的彙編和調用方式略有不同。

目前有一個偏移量(DATASEGBASE)是硬編碼的,由於MIPS的addui使用相對地址,這個值用於和相對地址相加得到變量的絕對地址。暫時還沒搞懂是怎麼來的,但是可以通過IDA的反彙編得到。

辛酸歷程

 

Read More

Solve Xposed module list become empty on Android 6.0 Marshmallow

0   3021 轉為簡體

中文版本

Recently I found module list in Xposed become empty after I upgrade my Nexus5 to 6.0.1 (M4B30Z, Dec 2016). And all the modules are not activating. So I open logcat and see the following:

Rovo89 said on a xda post that this file should be created if any module is activated. But somehow it didn’t do so on my Nexus5. So I create one myself and set correct permission (0644) and uid (you can run the Xposed Installer app and check the uid through ps |grep xposed). Then I reboot and check logcat again:

Looks like it’s still not working.

Then I realise that Android started to set SELinux to enforce from Lollipop (5.0) so this should be the problem. (We can use dmesg|grep audit to check if the problem really related to SELinux. ) I compared a random file under /data/data to the file we just created:

So all we need to do is to change this conf/modules.list to u:object_r:app_data_file:s0:c512,c768 as well

restorecon is a applet shipped with toybox, we can also use chcon to manually set SELinux context.