亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? autil.c

?? 最新主流石器時代源代碼,包含諸多目前流行功能代碼.
?? C
字號:
// Arminius' protocol utilities ver 0.1//// Any questions and bugs, mailto: arminius@mail.hwaei.com.tw// -------------------------------------------------------------------// The following definitions is to define game-dependent codes.// Before compiling, remove the "//".#define __STONEAGE#include "version.h"#include <stdio.h>#include <stdlib.h>#include "autil.h"#include "char.h"#ifdef __STONEAGE#include "lssproto_util.h"#include "common.h"#endif// Nuke 0701 fixchar *MesgSlice[SLICE_MAX];int SliceCount;char PersonalKey[4096];// -------------------------------------------------------------------// Initialize utilities//BOOL util_Init( void){  int i;  for (i=0; i<SLICE_MAX; i++){    MesgSlice[i] = (char *) calloc( 1,SLICE_SIZE);    if(MesgSlice[i]==NULL) return FALSE;  }  SliceCount = 0;  strcpy(PersonalKey, _DEFAULT_PKEY);	return TRUE;}// -------------------------------------------------------------------// Split up a message into slices by spearator.  Store those slices// into a global buffer "char **MesgSlice"//// arg: source=message string;  separator=message separator (1 byte)// ret: (none)// WON ADD//void util_SplitMessage(char *source, char *separator)BOOL util_SplitMessage(char *source, char *separator){  if (source && separator) {	// NULL input is invalid.    char *ptr;    char *head = source;        // Nuke 1006 : Bug fix    while ((ptr = (char *) strstr(head, separator)) && (SliceCount<SLICE_MAX) && (SliceCount>=0)) {      ptr[0] = '\0';      if (strlen(head)<SLICE_SIZE) {	// discard slices too large		// Nuke 0701//		if (*MesgSlice != *dumb) {				//print("Warning! Mem may be broken\n");		//}/*        if (MesgSlice[SliceCount]==0xffffffff) {                print("MesgSlice[%d] broken\n",SliceCount);                return FALSE;        } else {*/                strcpy(MesgSlice[SliceCount], head);                SliceCount++;        //}      }      head = ptr+1;    }    strcpy(source, head);	// remove splited slices	  }  return TRUE;}// -------------------------------------------------------------------// Encode the message//// arg: dst=output  src=input// ret: (none)void util_EncodeMessage(char *dst, char *src){//  strcpy(dst, src);//  util_xorstring(dst, src);  int rn = rand() % 99;  int t1, t2;  char t3[65500], tz[65500];  // encode seed#ifdef _BACK_VERSION  util_swapint(&t1, &rn, "3421");#else  util_swapint(&t1, &rn, "2413");#endif  t2 = t1 ^ 0xffffffff;  util_256to64(tz, (char *) &t2, sizeof(int), DEFAULTTABLE);  util_shlstring(t3, src, rn);  strcat(tz, t3);  util_xorstring(dst, tz);}// -------------------------------------------------------------------// Decode the message//// arg: dst=output  src=input// ret: (none)void util_DecodeMessage(char *dst, char *src){//  strcpy(dst, src);//  util_xorstring(dst, src);#define INTCODESIZE	(sizeof(int)*8+5)/6  int rn;  int *t1, t2;  char t3[4096], t4[4096];	// This buffer is enough for an integer.  char tz[65500];  if (src[strlen(src)-1]=='\n') src[strlen(src)-1]='\0';  util_xorstring(tz, src);  // get seed  strncpy(t4, tz, INTCODESIZE);  t4[INTCODESIZE] = '\0';  util_64to256(t3, t4, DEFAULTTABLE);  t1 = (int *) t3;  t2 = *t1 ^ 0xffffffff;#ifdef _BACK_VERSION  util_swapint(&rn, &t2, "4312");#else  util_swapint(&rn, &t2, "3142");#endif  util_shrstring(dst, tz + INTCODESIZE, rn);}// -------------------------------------------------------------------// Get a function information from MesgSlice.  A function is a complete// and identifiable message received, beginned at DEFAULTFUNCBEGIN and// ended at DEFAULTFUNCEND.  This routine will return the function ID// (Action ID) and how many fields this function have.//// arg: func=return function ID    fieldcount=return fields of the function// ret: 1=success  0=failed (function not complete)int util_GetFunctionFromSlice(int *func, int *fieldcount){  char t1[16384];  int i;//  if (strcmp(MesgSlice[0], DEFAULTFUNCBEGIN)!=0) util_DiscardMessage();    strcpy(t1, MesgSlice[1]);  // Robin adjust  //*func=atoi(t1);  *func=atoi(t1)-13;  for (i=0; i<SLICE_MAX; i++)    if (strcmp(MesgSlice[i], DEFAULTFUNCEND)==0) {      *fieldcount=i-2;	// - "&" - "#" - "func" 3 fields      return 1;    }  return 0;	// failed: message not complete}void util_DiscardMessage(void){  SliceCount=0;}#ifdef _CHECK_BATTLE_IOextern int InBattleLoop;extern int battle_write;extern int other_write;extern int battle_write_cnt;extern int other_write_cnt;#endifvoid _util_SendMesg(char *file, int line, int fd, int func, char *buffer){  //char t1[16384], t2[16384];	char t1[1024*64], t2[1024*64];  // WON ADD  if( fd < 0 ){	print("\n SendMesg fd err %s:%d!! ==> func(%d)\n", file, line, func);	return;  }  // Robin adjust  //sprintf(t1, "&;%d%s;#;", func, buffer);  sprintf(t1, "&;%d%s;#;", func+23, buffer);  util_EncodeMessage(t2, t1);#ifdef _CHECK_BATTLE_IO  if( InBattleLoop) {	  battle_write_cnt++;	  battle_write += strlen( buffer);  }  else {	  other_write += strlen( buffer);	  other_write_cnt++;  }#endif#ifdef __STONEAGE  lssproto_Send(fd, t2);#endif}int util_256to64(char *dst, char *src, int len, char *table){  unsigned int dw,dwcounter,i;  if (!dst || !src || !table) return 0;  dw=0;  dwcounter=0;  for (i=0; i<len; i++) {    dw = ( ((unsigned int)src[i] & 0xff) << ((i%3)*2) ) | dw;    dst[ dwcounter++ ] = table[ dw & 0x3f ];    dw = ( dw >> 6 );    if (i%3==2) {      dst[ dwcounter++ ] = table[ dw & 0x3f ];      dw = 0;    }  }  if (dw) dst[ dwcounter++ ] = table[ dw ];  dst[ dwcounter ] = '\0';  return dwcounter;}// -------------------------------------------------------------------// Convert 6-bit strings into 8-bit strings, buffers that store these strings// must have enough space.//// arg: dst=6-bit string;  src=8-bit string;  table=mapping table// ret: 0=failed  >0=bytes convertedint util_64to256(char *dst, char *src, char *table){  unsigned int dw,dwcounter,i;  char *ptr = NULL;  dw=0;  dwcounter=0;  if (!dst || !src || !table) return 0;  for (i=0; i<strlen(src); i++) {    ptr = (char *) index(table, src[i]);    if (!ptr) return 0;    if (i%4) {      dw = ((unsigned int)(ptr-table) & 0x3f) << ((4-(i%4))*2) | dw;      dst[ dwcounter++ ] = dw & 0xff;      dw = dw >> 8;    } else {      dw = (unsigned int)(ptr-table) & 0x3f;    }  }  if (dw) dst[ dwcounter++ ] = dw & 0xff;  dst[ dwcounter ] = '\0';  return dwcounter;}// -------------------------------------------------------------------// This basically is a 256to64 encoder.  But it shifts the result by key.//// arg: dst=6-bit string;  src=8-bit string;  len=src strlen;//      table=mapping table;  key=rotate key;// ret: 0=failed  >0=bytes convertedint util_256to64_shr(char *dst, char *src, int len, char *table, char *key){  unsigned int dw,dwcounter,i,j;  if (!dst || !src || !table || !key) return 0;  if (strlen(key)<1) return 0;	// key can't be empty.  dw=0;  dwcounter=0;  j=0;  for (i=0; i<len; i++) {    dw = ( ((unsigned int)src[i] & 0xff) << ((i%3)*2) ) | dw;    dst[ dwcounter++ ] = table[ ((dw & 0x3f) + key[j]) % 64 ];	// check!    j++;  if (!key[j]) j=0;    dw = ( dw >> 6 );    if (i%3==2) {      dst[ dwcounter++ ] = table[ ((dw & 0x3f) + key[j]) % 64 ];// check!      j++;  if (!key[j]) j=0;      dw = 0;    }  }  if (dw) dst[ dwcounter++ ] = table[ (dw + key[j]) % 64 ];	// check!  dst[ dwcounter ] = '\0';  return dwcounter;}// -------------------------------------------------------------------// Decoding function of util_256to64_shr.//// arg: dst=8-bit string;  src=6-bit string;  table=mapping table;//      key=rotate key;// ret: 0=failed  >0=bytes convertedint util_shl_64to256(char *dst, char *src, char *table, char *key){  unsigned int dw,dwcounter,i,j;  char *ptr = NULL;  if (!key || (strlen(key)<1)) return 0;	// must have key  dw=0;  dwcounter=0;  j=0;  if (!dst || !src || !table) return 0;  for (i=0; i<strlen(src); i++) {    ptr = (char *) index(table, src[i]);    if (!ptr) return 0;    if (i%4) {      // check!      dw = ((((unsigned int)(ptr-table) & 0x3f) + 64 - key[j]) % 64)           << ((4-(i%4))*2) | dw;      j++;  if (!key[j]) j=0;      dst[ dwcounter++ ] = dw & 0xff;      dw = dw >> 8;    } else {      // check!      dw = (((unsigned int)(ptr-table) & 0x3f) + 64 - key[j]) % 64;      j++;  if (!key[j]) j=0;    }  }  if (dw) dst[ dwcounter++ ] = dw & 0xff;  dst[ dwcounter ] = '\0';  return dwcounter;}// -------------------------------------------------------------------// This basically is a 256to64 encoder.  But it shifts the result by key.//// arg: dst=6-bit string;  src=8-bit string;  len=src strlen;//      table=mapping table;  key=rotate key;// ret: 0=failed  >0=bytes convertedint util_256to64_shl(char *dst, char *src, int len, char *table, char *key){  unsigned int dw,dwcounter,i,j;  if (!dst || !src || !table || !key) return 0;  if (strlen(key)<1) return 0;	// key can't be empty.  dw=0;  dwcounter=0;  j=0;  for (i=0; i<len; i++) {    dw = ( ((unsigned int)src[i] & 0xff) << ((i%3)*2) ) | dw;    dst[ dwcounter++ ] = table[ ((dw & 0x3f) + 64 - key[j]) % 64 ];	// check!    j++;  if (!key[j]) j=0;    dw = ( dw >> 6 );    if (i%3==2) {      dst[ dwcounter++ ] = table[ ((dw & 0x3f) + 64 - key[j]) % 64 ];	// check!      j++;  if (!key[j]) j=0;      dw = 0;    }  }  if (dw) dst[ dwcounter++ ] = table[ (dw + 64 - key[j]) % 64 ];	// check!  dst[ dwcounter ] = '\0';  return dwcounter;}// -------------------------------------------------------------------// Decoding function of util_256to64_shl.//// arg: dst=8-bit string;  src=6-bit string;  table=mapping table;//      key=rotate key;// ret: 0=failed  >0=bytes convertedint util_shr_64to256(char *dst, char *src, char *table, char *key){  unsigned int dw,dwcounter,i,j;  char *ptr = NULL;  if (!key || (strlen(key)<1)) return 0;	// must have key  dw=0;  dwcounter=0;  j=0;  if (!dst || !src || !table) return 0;  for (i=0; i<strlen(src); i++) {    ptr = (char *) index(table, src[i]);    if (!ptr) return 0;    if (i%4) {      // check!      dw = ((((unsigned int)(ptr-table) & 0x3f) + key[j]) % 64)           << ((4-(i%4))*2) | dw;      j++;  if (!key[j]) j=0;      dst[ dwcounter++ ] = dw & 0xff;      dw = dw >> 8;    } else {      // check!      dw = (((unsigned int)(ptr-table) & 0x3f) + key[j]) % 64;      j++;  if (!key[j]) j=0;    }  }  if (dw) dst[ dwcounter++ ] = dw & 0xff;  dst[ dwcounter ] = '\0';  return dwcounter;}// -------------------------------------------------------------------// Swap a integer (4 byte).// The value "rule" indicates the swaping rule.  It's a 4 byte string// such as "1324" or "2431".//void util_swapint(int *dst, int *src, char *rule){  char *ptr, *qtr;  int i;  ptr = (char *) src;  qtr = (char *) dst;  for (i=0; i<4; i++) qtr[rule[i]-'1']=ptr[i];}// -------------------------------------------------------------------// Xor a string.  Be careful that your string contains '0xff'.  Your// data may lose.//void util_xorstring(char *dst, char *src){	int i;	if (strlen(src)>65500) return;DebugPoint=100000;	for (i=0; i<strlen(src); i++){DebugPoint=100000+i;	  dst[i]=src[i]^255;	}	dst[i]='\0';DebugPoint=1000;}// -------------------------------------------------------------------// Shift the string right.//void util_shrstring(char *dst, char *src, int offs){  char *ptr;  if (!dst || !src || (strlen(src)<1)) return;    offs = strlen(src) - (offs % strlen(src));  ptr = src+offs;  strcpy(dst, ptr);  strncat(dst, src, offs);  dst[strlen(src)]='\0';}// -------------------------------------------------------------------// Shift the string left.//void util_shlstring(char *dst, char *src, int offs){  char *ptr;  if (!dst || !src || (strlen(src)<1)) return;    offs = offs % strlen(src);  ptr = src+offs;  strcpy(dst, ptr);  strncat(dst, src, offs);  dst[strlen(src)]='\0';}// -------------------------------------------------------------------// Convert a message slice into integer.  Return a checksum.//// arg: sliceno=slice index in MesgSlice    value=result// ret: checksum, this value must match the one generated by util_mkintint util_deint(int sliceno, int *value){  int *t1, t2;  char t3[4096];	// This buffer is enough for an integer.  if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);  util_shl_64to256(t3, MesgSlice[sliceno], DEFAULTTABLE, PersonalKey);  t1 = (int *) t3;  t2 = *t1 ^ 0xffffffff;#ifdef _BACK_VERSION  util_swapint(value, &t2, "3421");#else  util_swapint(value, &t2, "2413");#endif  return *value;}int util_mkint(char *buffer, int value){  int t1, t2;   char t3[4096];  if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);#ifdef _BACK_VERSION  util_swapint(&t1, &value, "4312");#else  util_swapint(&t1, &value, "3142");#endif  t2 = t1 ^ 0xffffffff;  util_256to64_shr(t3, (char *) &t2, sizeof(int), DEFAULTTABLE, PersonalKey);  strcat(buffer, ";");  strcat(buffer, t3);  return value;}// -------------------------------------------------------------------// Convert a message slice into string.  Return a checksum.//// arg: sliceno=slice index in MesgSlice    value=result// ret: checksum, this value must match the one generated by util_mkstringint util_destring(int sliceno, char *value){  if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);  util_shr_64to256(value, MesgSlice[sliceno], DEFAULTTABLE, PersonalKey);    return strlen(value);}// -------------------------------------------------------------------// Convert a string into buffer (a string).  Return a checksum.//// arg: buffer=output   value=data to pack// ret: checksum, this value must match the one generated by util_destringint util_mkstring(char *buffer, char *value){  char t1[SLICE_SIZE];  if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);  util_256to64_shl(t1, value, strlen(value), DEFAULTTABLE, PersonalKey);  strcat(buffer, ";");	// It's important to append a SEPARATOR between fields  strcat(buffer, t1);  return strlen(value);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲尤物久久| 一区二区在线观看av| 国产精品一区二区男女羞羞无遮挡| 91精品国产欧美一区二区| 奇米777欧美一区二区| 欧美成人一区二区三区片免费| 美国三级日本三级久久99| 精品国产网站在线观看| 国产精品1区2区3区在线观看| 国产精品情趣视频| 欧美亚洲综合另类| 免费观看久久久4p| 国产拍揄自揄精品视频麻豆| av爱爱亚洲一区| 五月激情综合婷婷| 精品1区2区在线观看| 成人精品鲁一区一区二区| 亚洲日本在线a| 欧美一区二区三区四区视频| 国产精品羞羞答答xxdd| 一区二区三区四区亚洲| 日韩亚洲欧美在线| 97久久超碰国产精品电影| 丝袜美腿成人在线| 国产精品素人视频| 制服.丝袜.亚洲.另类.中文| 岛国av在线一区| 日韩在线一区二区三区| 中文字幕国产一区二区| 717成人午夜免费福利电影| 丁香五精品蜜臀久久久久99网站 | 欧美日韩黄色一区二区| 极品美女销魂一区二区三区免费| 国产精品成人一区二区艾草| 欧美日韩在线电影| 成人午夜精品一区二区三区| 日韩成人免费在线| 国产精品护士白丝一区av| 在线播放中文一区| 成人精品小蝌蚪| 毛片一区二区三区| 亚洲综合色区另类av| 久久久一区二区| 欧美一区二区三区啪啪| 色琪琪一区二区三区亚洲区| 国产成人99久久亚洲综合精品| 亚洲va欧美va人人爽午夜| 国产精品色婷婷久久58| 精品国产区一区| 欧美一区二区三区不卡| 欧美性一二三区| av电影在线观看不卡| 国产二区国产一区在线观看| 蜜臀av一区二区在线观看 | 午夜久久久久久久久久一区二区| 国产日韩欧美精品电影三级在线| 欧美一级欧美一级在线播放| 91国内精品野花午夜精品| 99热精品一区二区| 国产精品一区二区三区网站| 青青青伊人色综合久久| 午夜精品久久久久| 亚洲一区二区欧美激情| 亚洲视频电影在线| 亚洲欧美在线aaa| 国产精品人妖ts系列视频| 国产日韩欧美精品综合| 久久久久88色偷偷免费| 26uuu精品一区二区| 欧美大胆人体bbbb| 日韩一级欧美一级| 欧美草草影院在线视频| 日韩女优视频免费观看| 欧美一二三区在线| 日韩三级精品电影久久久| 日韩亚洲欧美综合| 日韩欧美激情四射| 日韩一区二区不卡| 337p日本欧洲亚洲大胆色噜噜| 日韩欧美一区二区免费| 欧美tk—视频vk| 26uuu精品一区二区| 久久久国产精华| 中文字幕一区在线观看| 亚洲人成电影网站色mp4| 1024亚洲合集| 亚洲成人tv网| 美美哒免费高清在线观看视频一区二区| 婷婷开心久久网| 久久精品99国产精品| 激情六月婷婷久久| 国产99久久久久久免费看农村| 成人aa视频在线观看| 在线亚洲一区二区| 91精品免费在线| 亚洲精品一区二区三区影院 | 91精品国产色综合久久ai换脸| 欧美高清性hdvideosex| 欧美一区二区三区视频在线 | 国产日产亚洲精品系列| 国产精品久久久久四虎| 亚洲精品一二三区| 男女男精品网站| 国产+成+人+亚洲欧洲自线| 色综合欧美在线| 欧美一区二区三区播放老司机| 精品国产一区二区三区久久影院 | 亚洲激情成人在线| 亚洲va韩国va欧美va精品| 国内外成人在线| 91美女蜜桃在线| 欧美一区二区视频在线观看2022| 欧美精品一区二区蜜臀亚洲| 亚洲丝袜另类动漫二区| 日韩精品午夜视频| 成人一区在线观看| 欧美午夜精品久久久久久孕妇| 精品久久久久久久久久久久包黑料| 亚洲国产精品国自产拍av| 亚洲成av人片www| 成人伦理片在线| 欧美一区二区三区免费| 亚洲视频图片小说| 久久精品国产久精国产爱| 91网站视频在线观看| 日韩一区二区三区四区| 亚洲日本在线视频观看| 韩国三级中文字幕hd久久精品| 日本高清不卡视频| 国产人久久人人人人爽| 婷婷久久综合九色国产成人 | 国内精品在线播放| 欧洲精品在线观看| 欧美经典一区二区三区| 日韩在线卡一卡二| 91丨九色丨尤物| 日韩精品一区二区三区在线播放 | 亚洲成人资源网| 不卡一区二区中文字幕| 欧美大胆一级视频| 午夜不卡av在线| 色综合久久综合网97色综合| 亚洲国产精品传媒在线观看| 久久av资源网| 日韩一区二区三区在线| 亚洲成人综合在线| 色悠久久久久综合欧美99| 国产欧美一区二区在线| 精品综合免费视频观看| 欧美绝品在线观看成人午夜影视| 最新国产精品久久精品| 国产成人精品一区二| www一区二区| 免费成人在线观看视频| 7777精品伊人久久久大香线蕉经典版下载| 成人欧美一区二区三区小说| 福利电影一区二区三区| 精品粉嫩超白一线天av| 久久99精品国产.久久久久久| 欧美精品乱码久久久久久 | xfplay精品久久| 美女视频网站久久| 欧美日韩高清在线播放| 一区二区欧美在线观看| 色噜噜久久综合| 亚洲品质自拍视频| 色噜噜狠狠色综合欧洲selulu| 亚洲人精品午夜| 91香蕉视频污| 夜夜精品浪潮av一区二区三区| 在线精品亚洲一区二区不卡| 亚洲男人电影天堂| 色综合久久综合| 一区二区三区精品| 欧美日韩久久一区二区| 亚洲少妇最新在线视频| 91免费视频观看| 国产精品短视频| 91亚洲精品久久久蜜桃| 一区二区三区四区不卡在线| 欧美性色黄大片手机版| 日韩国产欧美在线视频| 日韩欧美中文一区二区| 国产乱人伦偷精品视频免下载| 久久久精品综合| 一区二区三区资源| 91一区二区三区在线观看| 国产精品日日摸夜夜摸av| 一本到高清视频免费精品| 一区二区三区中文在线观看| 欧美在线视频不卡| 久久精品亚洲乱码伦伦中文| 国产精品一区二区免费不卡| 久久久久国产成人精品亚洲午夜| 波多野结衣在线一区| 亚洲欧美日韩中文字幕一区二区三区 | 久久免费精品国产久精品久久久久| 成人午夜视频在线| 国产亚洲视频系列| 972aa.com艺术欧美|