Frida Hook 初体验

好久没有去做安卓的东西了,技术日新月异,貌似自己有点脱节了。其实之前也尝试过安装frida,好几次都比较蛋疼的卡在了安装的地方。同样,这一次又开在了安装的地方,仔细看了下没有找到wheel,取消之后可以先装wheel,然后再次安装,如果使用国外的源太慢,可以尝试切换到国内的源,个人比较倾向于清华大学的python源,地址自己去我的友链表复制。

Continue Reading

CentOS 6 更新php 从7.0到7.2

# 
yum install epel-release
#  install Remi repo
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm
# centos 7 rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# check installed version
yum list installed php*
# remove old version
yum remove php*
# install new version
yum install --enablerepo=remi-php72 php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
# check php version
php -v

Domoticz 插件开发教程

虽然domoticz官网提供了一个插件开发教程,但是在实际的开发过程中就会发现有很多内容写的不够详细,无法参考。 官网教程链接: https://en.domoticz.cn/wiki/Developing_a_Python_plugin 国内的中文wiki页面比较陈旧,文档也不是最新的,不建议参考。

其实真个插件主要分为两个部分:

  • 插件模板

  • 插件代码

插件模板主要就是插件的定义,以及相关的参数配置选项,格式为xml:


    
        

Baby Weather Plugin


支持从国内的天气服务器获取天气信息

Features

  • 支持和风天气
  • 支持彩云天气
  • 支持今天明天的天气预报信息

Devices

  • Temperature - 当前温度
  • Feeling Temperature - 当前体感温度
  • Humidity - 湿度
  • Pressure - 气压

Configuration

API KEY请自行注册相关的开发者账号,然后获取key。 技术支持:http://www.h4ck.org.cn 彩云天气:https://open.caiyunapp.com/ 和风天气:https://dev.heweather.com/
Continue Reading

Domoticz Baby Weather Plugin

支持彩云天气,和风天气,需要注册开发者账号之后添加apikey之后才能使用。
彩云天气:https://open.caiyunapp.com/
和风天气:https://dev.heweather.com/

支持信息:

  • Temperature – 当前温度
  • Feeling Temperature – 当前体感温度
  • Humidity – 湿度
  • Pressure – 气压
  • PM25 – 当前PM25浓度
  • PM10 – 当前PM10浓度
  • SO2 – 当前PSO2浓度
  • Weather forecast(Today) – 今天天气
  • Weather forecast(Tomorrow) – 明天天气
  • 等等

安装方法:

  1. 下载zip之后解压缩,放入Domoticz/plugins目录下,重启服务端。去网页端添加硬件即可。
  2. 切换到插件目录下,git clone https://github.com/obaby/baby_weather_plugin 重启服务端。去网页端添加硬件即可。
Continue Reading

ModuleNotFoundError: No module named ‘cryptography.hazmat.bindings._padding’

ubuntu下执行命令出现如下错误:

ubuntu@ip-172-31-11-253:~/nineuu_spider/Maomi$ python3 maomi.py
Traceback (most recent call last):
  File "maomi.py", line 8, in 
    from cryptography.hazmat.primitives import padding
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/padding.py", line 13, in 
    from cryptography.hazmat.bindings._padding import lib
ModuleNotFoundError: No module named 'cryptography.hazmat.bindings._padding'

但是实际上cryptography模块已经安装了:

如果要解决这个错误,安装paramiko即可:

pip3 install paramiko
Continue Reading

去掉模型车牌生成器的比例限制

原始版本比例最小可以设置为8,现在去除了这个限制,可以随意设置比例。

关键代码:

00DE410D  |.  83FA 5C       cmp edx,0x5C
00DE4110      0F87 E7020000 ja ChePai.00DE43FD  # 修改 此行为nop即可
00DE4116  |.  8B87 B0000000 mov eax,dword ptr ds:[edi+0xB0]
00DE411C  |.  03C0          add eax,eax
00DE411E  |.  03C0          add eax,eax
00DE4120  |.  03C0          add eax,eax
00DE4122  |.  99            cdq
00DE4123  |.  F7FE          idiv esi
00DE4125  |.  6A 4D         push 0x4D
00DE4127  |.  68 3092F300   push ChePai.00F39230                     ;  Bitmap Files (*.BMP)|*.BMP|JPEG Files (*.JPG)|*.JPG|PNG Files (*.PNG)|*.PNG||
00DE412C  |.  8D4C24 18     lea ecx,dword ptr ss:[esp+0x18]
00DE4130  |.  894424 2C     mov dword ptr ss:[esp+0x2C],eax
00DE4134  |.  8B87 B4000000 mov eax,dword ptr ds:[edi+0xB4]
Continue Reading

can’t open file ‘< unprintable file name>’: [Errno 2] No such file or directory

尝试从cmd或者bat中执行带有中文路径的命令时就可能会得到标题中的错误:can’t open file ‘<unprintable file name>’: [Errno 2] No such file or directory。例如下面的代码:

cd /d H:\PyCharmProjects\spider
call H:\PyCharmProjects\spider\venv\Scripts\activate
python "超碰视频\chaop.py"

出这个错误的关键是unprintable file name,而不是文件不存在,当命令执行完成之后,如果直接在终端中再次运行最后一条命令其实是可以执行的。所以要解决这个问题一个办法是不要使用非英文目录或者文件名。除此之外还有另外一个办法,修改cmd的编码,默认的cmd编码是936,通过chcp命令可以查看修改编码:

如果要想bat中的命令能够成功执行,在文件开头加上 chcp 65001即可,修改后如下:

chcp 65001
cd /d H:\PyCharmProjects\spider
call H:\PyCharmProjects\spider\venv\Scripts\activate
python "超碰视频\chaop.py"
Continue Reading