c 语言的基础语法.

c 语言的基础. c 语言没有字符串. 一个 int 整形, 占用 4 个字节.    ===> sizeof 是指 字节的长度 ,  不是元素的个数. ..... 想要得到有多少个元素, 就直接 就是     sizeof(v2)/sizeof(char),   或者  sizeof(v3)/sizeof(int)   ==>. 得到元素的个数.... 5 期 day9, 10.4 语法--字符....和  字符串.... 中文实际上使用的是 utf-8 编码的.  一个中文, 字, 占用 3 个字节... # include <stdio.h> # include <string.h> int main(int argc, char const *argv) { // 字符类型,用1个字节来存储。 char v1 = \'w\'; printf(\"v1的值为: %c\\n\", v1); // 字符数组 -> 字符串 char v2 = {\'w\',\'u\',\'p\',\'e\',\'i\',\'q\',\'i\',\'\\0\'}; printf(\"v2的值为: %s\\n\", v2); // 字符数组, sizeof大小 char v3 = \"wupeiqi\"; int length = sizeof(v3)/sizeof(char); printf(\"v3的值为: %s,长度为:%d\\n\", v3, length); // 字符数组 char v4 = \"武沛齐\"; int len = sizeof(v4)/sizeof(char); printf(\"v4的值为: %s,长度为:%d\\n\", v4, len); // 字符串长度 unsigned long dataLen = strlen(v4); // c 语言自身提供的. 不包含 \\0,结束的长度... printf(\"Length: %d\\n\", dataLen); return 0; } // /Users/exp/.idapro/plugins/untitled/cmake-build-debug/untitled // v1的值为: w // v2的值为: wupeiqi // v3的值为: wupeiqi,长度为:8 // v4的值为: 武沛齐,长度为:10 // Length: 9 // // Process finished with exit code 0     指针 其实是  一种类型.   数据类型和 指针是有关系的. char 类型的指针的,  就是 char *  , 就是 char 星.   指针类型是 可以 进行,相加  和 相减的...  ==> 他根据 他的类型,,,  往后跳多少 ?  跳多少 ?   prinf()  是输出 sprintf ()  是格式化 ....        

Frida检测___对待武沛奇老师的课程需怀有敬畏的心态.

proc检测   .../local/tmp # ps -ef | grep che168 u0_a205 16928 12075 6 18:16 ? 00:00:04 com.che168.autotradercloud u0_a205 17051 12075 0 18:16 ? 00:00:00 com.che168.autotradercloud:ipc u0_a205 17118 12075 2 18:16 ? 00:00:01 com.che168.autotradercloud:pushservice root 17804 17584 2 18:17 pts/1 00:00:00 grep che168 .../local/tmp # ps -A | grep com.che168.autotradercloud 16928 ? 00:00:05 com.che168.autotradercloud 17051 ? 00:00:00 com.che168.autotradercloud:ipc 17118 ? 00:00:01 com.che168.autotradercloud:pushservice .../local/tmp # cd /pro bash: cd: /pro: No such file or directory .../local/tmp # cd /pro proc/ product/ product_services .../local/tmp # cd /proc /proc # cd 16928 /proc/16928 # ls attr/ comm fd/ mem oom_adj root@ smaps syscall autogroup coredump_filter fdinfo/ mountinfo oom_score sched smaps_rollup task/ auxv cpuset io mounts oom_score_adj sched_group_id stack time_in_state cgroup cwd@ limits mountstats pagemap sched_init_task_load stat timerslack_ns clear_refs environ map_files/ net/ personality sched_wake_up_idle statm top_app cmdline exe@ maps ns/ reclaim schedstat status wchan /proc/16928 # maps文件 , 记录了当前app运行时候, 加载的依赖. 全部都存储到了文件中. 车智赢 所有加载的app的so文件,都会在map中存在的. 这里面就有一些 libnative.so 这样的文件. 所以存在于maps文件中. /proc/16928 # cat maps | grep libnative 78f6b5b000-78f6c1b000 r-xp 00000000 103:05 5431580 /data/app/com.che168.autotradercloud-LTGEbEGKyOrdPogMOL27SQ==/lib/arm64/libnative-lib.so 78f6c1c000-78f6c23000 r--p 000c0000 103:05 5431580 /data/app/com.che168.autotradercloud-LTGEbEGKyOrdPogMOL27SQ==/lib/arm64/libnative-lib.so 78f6c23000-78f6c24000 rw-p 000c7000 103:05 5431580 /data/app/com.che168.autotradercloud-LTGEbEGKyOrdPogMOL27SQ==/lib/arm64/libnative-lib.so 79f840f000-79f8412000 r--p 00000000 fd:00 340 /apex/com.android.runtime/lib64/libnativehelper.so 79f8412000-79f8415000 r-xp 00003000 fd:00 340 /apex/com.android.runtime/lib64/libnativehelper.so 79f8415000-79f8416000 rw-p 00006000 fd:00 340 /apex/com.android.runtime/lib64/libnativehelper.so 79f8416000-79f8417000 r--p 00007000 fd:00 340

移动安全_抓包__底层通信_http和SSL请求的本质

例如:你在Python中使用requests模块发送一个http请求,其底层就是使用socket模块+TCP实现发送的请求。 import requests res = requests.get(\"http://192.168.1.37:8080/index\") print(res.text) 如果基于底层的socket模块+TCP协议实现如下: import socket client = socket.socket() client.connect((\'192.168.1.37\', 8080)) content_list = content_list.append(\"GET /index HTTP/1.1\\r\\n\") content_list.append(\"host: wiki.mikecrm.com\\r\\n\") content_list.append(\"user-Agent: test\\r\\n\") content_list.append(\"\\r\\n\") content_string = \"\".join(content_list) client.sendall(content_string.encode(\'utf-8\')) response = b\"\" while True: chunk = client.recv(1024) if not chunk: break response += chunk print(response.decode(\'utf-8\')) client.close() 2.1 http请求 详见示例  ---  net.demo2.netd10_ssl01 public class MainActivity extends AppCompatActivity { private Button btn1; // 定义一个按钮 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EdgeToEdge.enable(this); // 启用边到边显示 setContentView(R.layout.activity_main);// 设置布局文件 ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {// 处理窗口内边距, 适应系统栏 Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); return insets; }); // 初始化按钮 btn1 = findViewById(R.id.btn1); //通过 ID 找到按钮 btn1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { doRequest(); } }); } private void doRequest() { new Thread() { @Override public void run() { try { // http://wiki.mikecrm.com/index?ajax=1&page=2 Socket socket = new Socket(\"192.168.1.37\", 8080); // 1.构造请求头 StringBuilder sb = new StringBuilder(); sb.append(\"GET /index HTTP/1.1\\r\\n\"); sb.append(\"host: wiki.mikecrm.com\\r\\n\"); sb.append(\"user-Agent: test\\r\\n\"); sb.append(\"\\r\\n\"); // 2.写入数据(发送数据) // java.net.SocketOutputStream OutputStream outputStream = socket.getOutputStream(); outputStream.write(sb.toString().getBytes()); Log.e(\"outputStream的类 => \", outputStream.getClass().getName()); // 3.读取数据(获取数据) // java.net.SocketInputStream InputStream inputStream = socket.getInputStream(); Log.e(\"inputStream的类 => \", inputStream.getClass().getName()); while (true) { byte buffer = new byte; int len = inputStream.read(buffer, 0, buffer.length); if (len == -1) { break; } Log.e(\"读取相应内容 =>\", new

关于甄哥我想说的话

1,  在你没有发言之前,我不会在和你的群里面说上任何一句话 2, 在目前,该说的话题,已经说尽了. 剩下的就是看你执行了多少 ? 看我 xina  本人执行了多少? 3, 站在对方角度上来说, 需要的冷却.  最后可靠的人, 不会因为什么而存在懊恼. 4, 我发的由我所感受的, 你也是倔强,从新人走过来的. 没有必要浇灭我的热情. 5, 技术聊天不到, 不是一个 水平上我,我就少说话, 多做事.把自己短板的部分补齐一下. 6, 其他的聊天不到 生活上也聊天不到的地方,我就先安静.  把前面说过的话,先慢慢消化了了再说. 7, 和他在一起的群,就不要发言了, 发言也会找人私下聊天, 不会在群里公开聊. 8, 群里如何相处. a, 少提问, 多解决问题. b,有问题, 在论坛里面提问.... 不要使用 im工具,无法进行详细的问题描述. c, 对于有帮助的人,及时感恩.... d, 常常把感恩的事情,放在首要的, 对人要有一个敬畏之心. 1, 我目前还有点浮躁, 最重要是静, 只有平静了, 一切都才会, 看的透彻. 2, 甄哥曾经说过的话, 用心去领悟,翻翻历史对话, 案例说到的 ,是否用心去记录,去攻破它.到底攻破了几个? 你鲜福鑫有列表吗? 3, 感受到自己不足,群里就少发言, 在没有爬上岸之前. 说再多都是空话, 你能解决几个问题,反调试能过, 能为别人带来利益,才是方向. 4, 最后, 甄哥说的, 你非常浮躁, 真的,真的, 沉下心, 专著. 少浪费时间.... 技术不懂 的要低调, 少暴露自己的弱点. .. 以上问题, 从没有认真考虑过....... 针对以上问题, 我会在接下来的 交往中,一一 求解...   怎么突然想起, 我脑壳不好用, 原来, 是有意带我, 群里消息及时看, 私底下,测试下,验证下, 和思路. 了解.流程.....多练练, 算是开悟了.... 还是的安静才能想到

自定义证书的 客户端校验 和 服务端校验. [客户端证书校验源码和证明] pinner + host + 证书 [okhttp的单向校验-代码混淆解读]

关于一些方法 1,  okhttp的一些特征, 找 Frida特征的时候, 被那么多的人拔掉底裤分析.那么分析 被混淆的 retrofio 和 okhttp3的时候,同样适用, 昨天这几天把混淆的 okhttp3的源码,特别证书校验的部分, 搞明白, 跨版本的逻辑小小改变是有的, 但是大体逻辑不会变化太多.  如果在2024年常用的库的分析 , okhttp3的跨大版本的更新. 知道变化的趋势. 2, 在看视频时候,一定要知道,特别原理分析时候, 调用栈, 是哪个包,哪个函数被hook, 重点照顾它,熟悉它,   因为被混淆的函数和没有被混淆的,逻辑是不会变得. 做笔记时候, 给出 hook的具体命令,和脚本路径. 可以溯源. 3, 多次观看,多次实践, >= 5次左右, 任何细节,绝不放过. 哪怕一个字一个字打出来! 4, 抓包的设计,    UDP, TCP, QUIC协议, websockt协议, 双向证书校验. 5, Frida 反调试, so层面反调试, 反hook,  修改So的逻辑, dump出修复, Native层的 模拟执行. 非常多的知识点. 6, 调用栈分成,  调用第三方库的某个具体函数, 是由1-屏幕事件, 2-调用,界面元素, 3-app内部路由, 4-底层功能模块这样的路径. 如果遇到混淆, SSLSession 作为第二参数, 寻找,到hook,  =====>因为系统包, 他混淆不了.!!! 所以是这样. 搜索  SSLSession 作为第二参数出现在 , 7, 校验完成了,没有问题了,才会发送.---> 请求. 你提到的三个步骤(证书校验、主机校验、pinner公钥校验)是客户端对服务器的验证过程,属于 单向认证 ============================================= 在哪里执行 的这个三个校验--> okhttp3.internal.connection.RealCoonnection. 类别中的  connectTLS方法. 1+++++> 证书  2+++++>HOST 3+++++>Pinner   类名和方法名字会变,   但是代码的执行过程是不会变的. 客户端校验的顺序分别是: - 第1步:调用证书校验--服务端--> 合法性 - 第2步:主机校验--->是否域名匹配 - 第3步:pinner公钥校验,这个校验过程本质上是调用`CertificatePinner`类中的`check`方法--> 服务端证书公钥sha256-->是否本地一致.不被监听 ========================================================= -1,  证书校验:验证服务端证书的合法性(证书链、有效期、吊销状态)。 -2, 主机校验:验证服务端证书中的域名是否与客户端请求的主机名匹配。 -3,  Pinner 公钥校验:验证服务端证书的公钥 SHA-256 是否与本地预置的公钥哈希值一致。   1, 生成 key (RSA 私要) openssl genrsa -out server/server-key.key 2048  // 无加密 2, 生成服务端证书请求文件, openssl req -new -out server/server-req.csr -key server/server-key.key 3, 生成 服务端证书 // openssl 3.x openssl x509 -req -in server/server-req.csr -out server/server-cert.cer -signkey server/server-key.key -days 3650 1, 生成客户端 私密钥 openssl genrsa -out client/client-key.key 2048  // 无加密 2, 生成客户端证书请求文件 openssl req -new -out client/client-req.csr -key client/client-key.key // 3, 生成客户端证书 // openssl 3.x openssl x509 -req -in client/client-req.csr -out client/client-cert.cer -signkey client/client-key.key -days 3650   生成客户端带密码的p12证书(可集成在安卓中来实现服务端校验) openssl pkcs12 -export -clcerts -in client/client-cert.cer -inkey client/client-key.key -out client/client.p12  

关于一次来找事儿做不是享受的感悟.享受阳光, 在莎莎姐原位置书房门前扫落叶.2025年1月17号

1, 没有注意的话, 你以为他不会, 却偏偏你忽略了,而伤害了你下垂的屋檐. 2, 往往看起来复杂, 你却要偷懒, 反而被限制的无处走, 被他的限制决定清扫方法, 但是细细看, 举手片刻,得到全区域. 3,落叶归根, 只有扫过地的人知道, 乔木到了四川(南方)依然落叶, 他却不愿意,成了习惯.到了冬天我就落叶 4, 叶子还是他的吗,被人的改变, 地面被阻断, 所以, 他不是垃圾, 是养分,给花圃的花花草草.价值在另外地方发光发热. 5, 多了一件事情, 往往,完整的流程, 3个满满箱子的倾泻, 花草被压弯了腰杆, 是给他养分呢,还是同归于尽? 施政也是这样, 上面赋予的权限, 不是我的, 倾泻而下,  省事麻烦少,  ---> 我的姑父总是多多做点环节, 真的是彻底的解决后患!!! 6, 想想 , 一定需要表达清楚吗, 不是? 因为你是执行人, 只有自己明白!  说的清楚, 不如写的清楚. 7, 角色, 动用了什么工具, 设备, 始终要归还原位, 整理(井井有序的概念), 尊重, 别人, 如果别人找不到了, 做了好事, 还是需要背恶.(功盖三分过错?)

关于抓包的总体的思路和方法. 2025年1月14号

1, 抓包的单向证书, 通过实际的例子去解读这个问题.     , 服务端证书, 校验原理.  --- 本质 ---> 后续只要发送, 就能发送过去.  接收到请求, 才能,  返回数据. 才能集成证书. 通过离线的代码python  和  加上证书, 脱离app 做操作. 如果有服务端证书校验,  你的charles 没有证书,使用抓包工具自带证书, 你也不能做到.  ----> 找到 服务端可以绕过证书校验,就可以返回值.  使用 Charles 可以愉快的进行抓包了. 绕过:    1, 找到集成在手机上的证书.p12 . 或者 .bks 后缀而存在的. 2, 需要找到证书的密码,  (导入证书需要) 手机集成客户端校验,   piner, 集成 sha256 ,  集成服务端,校验  + p12 的证书, + 密码, 举例子的代码: KeyStore.getInstance(\"BKS\")   ===> KeyStore.getInstance(\"PKCS12\")   ==> 这两种不同的格式的证书. ===> 使用了,    openRawResource 在 Raw 这个目录下存在的 ===> 使用额,    getAssets().open(\"TLS\");  就是在  Assets这个目录下存在. Request 请求的证书, 需要把  Request 发送过去. hook密码 Java.perform(function () { var KeyStore = Java.use(\"java.security.KeyStore\"); KeyStore.load.overload(\'java.io.InputStream\', \'

3, Bringing Up Children —Gerald Mosback __ Vivienne Mosback

. It is generally accepted that the  experiences of the child in his first years largely determine his character and later personality. Every experience teaches the child something and the effects are cumulative. \"Upbringing \" is normally used to refer to the treatment and training of the child within the home, This is closely related to the treatment and training of the child in school, which is usually distinguished by the term \"education\". In a society such as ours, both parents and teachers are responsible for the opportunities provided for the development of the child , so that upbringing and education are interdependent. The ideals and practices of child rearing vary from culture to culture. In general, the more rural the community, the more uniform are the customs  of child upbringing. In more technologically developed societies, the period of childhood and adolescence tends to be extended over a long time, resulting in more opportunity for education and greater variety in character development. Early upbringing in the home is naturally affected both by the cultural pattern of the community and by the parents\' capabilities and their aims and depends not only on upbringing and education but also on the innate abilities

2. The Open Window –After Saki — and ZOOM meeting test

\"My aunt will com down every soon, Mr  Nuttel, \" said  a very clam young lady of fifteen years of age; \" meanwhile you must try to bear my company. \" Framton Nuttel tried to say something which would please the niece now present, without annoying the aunt that was about to come . He was supposed to be going through a cure for his nerves, but he doubted whether those polite visits to a number of total strangers would help much. \"I know how it will be, \" his sister had said when  he was preparing to go away into the country; \"you will lose yourself down there and not speak to living soul, and your nerves will be worse than ever through loneliness. I shall just give you  letters of introduction to all the people I know there. Some of them, as far as I can remember, were quite nice.\" Framton wondered whether Mrs. Sappleton, the lady to whom he was bringing one of the letters of introduction , one of the nice ones. \"Do you know many of the people  round here? \" asked the niece, when she thought that  they had sat  long enough in silence.