資源簡介
Netzob官網(wǎng)例子的server以及client,進行流量測試和驗證服務器時使用

代碼片段和文件信息
#include?“amo_api.h“
unsigned?char?key?=?0x42;
int?api_init()?{
??current_state?=?UNIDENTIFIED;
??return?0;
}
/*?auth/unauth?functions?*/
int?api_identify(unsigned?char?*name)?{
??unsigned?char?tmpName[10];
??strcpy(tmpName?name);
??if(?strlen(tmpName)?>?0)?{
????current_state?=?IDENTIFIED;
????return?0;
??}
??else?{
????current_state?=?UNIDENTIFIED;
????return?-1;
??}
}
int?api_authentify(unsigned?char?*password)?{
??if(?strlen(password)?>?0)?{
????current_state?=?AUTHENTIFIED;
????return?0;
??}
??else?{
????current_state?=?UNIDENTIFIED;
????return?-1;
??}
}
int?api_bye()?{
??current_state?=?UNIDENTIFIED;
??return?0;
}
/*?system?functions?*/
int?api_stats(struct?amo_stats?*current_stats)?{
??if(?current_state?==?IDENTIFIED?||?current_state?==?AUTHENTIFIED?)?{
????current_stats->counter?=?32000;
????current_stats->len?=?127;
????current_stats->max?=?512;
????return?0;
??}
??else
????return?-1;
}
int?api_info(struct?amo_info?*current_info)?{
??if(?current_state?==?IDENTIFIED?||?current_state?==?AUTHENTIFIED?)?{
????current_info->counter?=?32000;
????current_info->len?=?127;
????current_info->max?=?512;
????return?0;
??}
??else
????return?-1;
}
/*?crypto?functions?*/
int?api_encrypt(unsigned?char?*in?unsigned?int?len?unsigned?char?*out)?{
??unsigned?int?i;
??char?tmpData[10];
??if(?current_state?==?AUTHENTIFIED?)?{
????strcpy(tmpData?in);
????for(i?=?0;?i???????tmpData[i]?=?(in[i]?^?key)?%?0xff;
????strcpy(out?tmpData);
????return?0;
??}
??else
????return?-1;
}
int?api_decrypt(unsigned?char?*in?unsigned?int?len?unsigned?char?*out)?{
??return?api_encrypt(in?len?out);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1633??2015-07-20?05:07??tutorial_netzob_v1\amo_api.c
?????文件????????718??2015-07-20?05:07??tutorial_netzob_v1\amo_api.h
?????文件???????6536??2018-05-02?15:57??tutorial_netzob_v1\amo_api.o
?????文件???????1480??2015-07-20?05:07??tutorial_netzob_v1\amo_net.c
?????文件????????429??2015-07-20?05:07??tutorial_netzob_v1\amo_net.h
?????文件??????11248??2018-05-02?15:57??tutorial_netzob_v1\amo_net.o
?????文件???????5265??2015-07-20?05:07??tutorial_netzob_v1\amo_parser.c
?????文件????????489??2015-07-20?05:07??tutorial_netzob_v1\amo_parser.h
?????文件??????11624??2018-05-02?15:57??tutorial_netzob_v1\amo_parser.o
?????文件??????28184??2018-05-02?15:57??tutorial_netzob_v1\client
?????文件???????3269??2015-07-20?05:07??tutorial_netzob_v1\client.c
?????文件???????9008??2018-05-02?15:57??tutorial_netzob_v1\client.o
?????文件????????556??2015-07-20?05:07??tutorial_netzob_v1\common.c
?????文件????????109??2015-07-20?05:07??tutorial_netzob_v1\common.h
?????文件???????4136??2018-05-02?15:57??tutorial_netzob_v1\common.o
?????文件????????728??2015-07-20?05:07??tutorial_netzob_v1\Makefile
?????文件????????145??2015-07-20?05:08??tutorial_netzob_v1\README
?????文件??????27496??2018-05-02?15:57??tutorial_netzob_v1\server
?????文件????????834??2015-07-20?05:07??tutorial_netzob_v1\server.c
?????文件???????4744??2018-05-02?15:57??tutorial_netzob_v1\server.o
?????目錄??????????0??2018-12-07?17:42??tutorial_netzob_v1
-----------?---------??----------?-----??----
???????????????118631????????????????????21
- 上一篇:步進電機控制程序基于三菱plc
- 下一篇:電子商務網(wǎng)站概要設計
評論
共有 條評論