11 2018 档案

BCode解码练习
摘要:在学习BT协议中的一个小练习 参考了 https://github.com/airtrack/bitwave 具体B编码解释 可以自行搜索或者参考 这篇文章 bittorrent 学习(一) 种子文件分析与bitmap位图 代码 1 #pragma once 2 #include "pre.h" 3 阅读全文

posted @ 2018-11-11 21:37 itdef 阅读(867) 评论(0) 推荐(0) 编辑

bittorrent 学习(四) tracker peer通讯
摘要:看看 tracker.c文件 http_encode() 为http发送进行编码转换 1 int http_encode(unsigned char *in,int len1,char *out,int len2) 2 { 3 int i, j; 4 char hex_table[16] = "01 阅读全文

posted @ 2018-11-08 14:44 itdef 阅读(378) 评论(0) 推荐(0) 编辑

sha1 算法源码
摘要:原来指望sha1 这种烂大街的算法 不会出什么幺蛾子 结果《linux C编程实战Code》bt章节的sha1 代码 我在linux和windows下的结果不一样 然后用了哈希工具查看了下 发现结果也不一样。 windows和linux自带工具是一致的,但是和《linux C编程实战Code》的代码 阅读全文

posted @ 2018-11-08 10:32 itdef 阅读(1548) 评论(0) 推荐(0) 编辑

bittorrent 学习(三) MSG
摘要:msg.c中 int转化 char[4] char[4]转化int的函数 如下(有多种方案) 1 int int_to_char(int i, unsigned char c[4]) 2 { 3 c[3] = i % 256; 4 c[2] = (i - c[3]) / 256 % 256; 5 c 阅读全文

posted @ 2018-11-02 13:50 itdef 阅读(360) 评论(0) 推荐(0) 编辑

bittorrent 学习(二) LOG日志和peer管理连接
摘要:代码中的log.h log.c比较简单 void logcmd() 记录命令 int logfile();运行日志的记录 int init_logfile() 开启log文件 源码比较清晰也很简单。 可以直接看代码 // peer代码中 我们先来看看结构体 1 typedef struct _Req 阅读全文

posted @ 2018-11-01 10:11 itdef 阅读(503) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示