易截截图软件、单文件、免安装、纯绿色、仅160KB

寻C++、Delphi双修高手(10.01.14)

哪位高手帮忙把C翻译成delphi,多谢

static void encipher(unsigned int *const v, const unsigned int *const k, unsigned int *const w)
{
register unsigned int
y    = ntohl(v[0]),
z    = ntohl(v[1]),
a    = ntohl(k[0]),
b    = ntohl(k[1]),
c    = ntohl(k[2]),
d    = ntohl(k[3]),
n    = 0x10,      /* do encrypt 16 (0x10) times */
sum  = 0,
delta = 0x9E3779B9; /*  0x9E3779B9 - 0x100000000 = -0x61C88647 */

while (n-- > 0) {
sum += delta;
y += ((z < < 4) + a) ^ (z + sum) ^ ((z >> 5) + b);
z += ((y < < 4) + c) ^ (y + sum) ^ ((y >> 5) + d);
}

w[0] = htonl(y); w[1] = htonl(z);
}

static void decipher(unsigned int *const v, const unsigned int *const k, unsigned int *const w)
{
register unsigned int
y    = ntohl(v[0]),
z    = ntohl(v[1]),
a    = ntohl(k[0]),
b    = ntohl(k[1]),
c    = ntohl(k[2]),
d    = ntohl(k[3]),
n    = 0x10,
sum  = 0xE3779B90,
/* why this ? must be related with n value*/
delta = 0x9E3779B9;

/* sum = delta < <5, in general sum = delta *


相关问答:

linux环境下gethostbyname函数问题 - C/C++ / C语言

写了个测试程序如下
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

Python中的Unicode在Delphi如何还原成Gb2312?

已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试

在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......

C 程序问题(四) - C/C++ / C语言

#include "stdio.h"
int main()
{
  char *ch(char *, char *);
  char str1[]="I am glad to meet you!";
  char str2[]="Welcom to study C!";
&nb ......

求教c/c++语言相关问题 - C/C++ / C语言

有一10*10矩阵,除去第一个点(0,0)和最后一点(9,9),还有八个点为1,其他都为0,要求用二维数组表示。八个点是随机生成的,编写相关程序表示矩阵所有可能情况。
真心求教各位高手,哎!本人太菜了!呵呵!
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号