Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.01.29;
Скачать: CL | DM;

Вниз

Помогите перевести на Delphi   Найти похожие ветки 

 
ZLOFENIX ©   (2005-12-18 23:39) [0]


#ifndef _UOENCRYPTION_H_INCLUDED
#define _UOENCRYPTION_H_INCLUDED

#ifdef _cplusplus
extern "C" {
#endif

/* Huffman adapted for network usage */
typedef struct tagHuffmanObj
{
int has_incomplete;
int incomplete_node;
char incomplete_byte;
}HuffmanObj;

/* declares the minimal size of a buffer to decompress n bytes */
#define MIN_DECBUF_SIZE(in) ((in * 4) + 4)

void Compress(char *dest, const char *src, int *dest_size, int *src_size);
void Decompress(char *dest, const char *src, int *dest_size, int *src_size, HuffmanObj *obj);
void DecompressClean(HuffmanObj *obj);

/* Login crypt */
#define GETKEYS_MIN_SIZE 61

typedef struct tagLoginCryptInfo
{
/* public, must be declared */
   unsigned int pseed;
unsigned int k1, k2;
/* private, dynamic vars used by the crypt code, each encrypted byte changes them */
unsigned int m_key[2]; /* [0] - m_CryptMaskLo [1] - m_CryptMaskHi */
unsigned int m_k1, m_k2; /* [1] - m_MasterHi  [2] - m_MasterLo */
}LoginCryptObj;

void LoginCryptInit(LoginCryptObj *obj);
void LoginCryptEncrypt(LoginCryptObj *obj, unsigned char * in, unsigned char * out, int len);
int CalculateKeys(unsigned char *Plaintext, unsigned char *Ciphertext, unsigned int *Seed, unsigned int *Key1, unsigned int *Key2);

/* Game crypt */
#define CRYPT_GAMEKEY_COUNT     25
#define CRYPT_GAMESEED_LENGTH   8

/* BLOWFISH */
typedef struct tagBlowfishObject
{
unsigned char seed[CRYPT_GAMESEED_LENGTH];
int table_index; /* init: 0 */
int stream_pos; /* init: 0 */
int block_pos; /* init: 0 */
}BlowfishObj;

void BlowfishInit(BlowfishObj *Obj);
void BlowfishEncrypt(BlowfishObj *Obj, unsigned char * in, unsigned char * out, int len);
void BlowfishDecrypt(BlowfishObj *Obj, unsigned char * in, unsigned char * out, int len);

/* UO.cfg Password crypt */
void PWEncrypt(unsigned char *in, unsigned char *out, int len);
void PWDecrypt(unsigned char *in, unsigned char *out, int len);

#if _cplusplus
}
#endif

#endif

Все функции вызываются из Dll


 
ZLOFENIX ©   (2005-12-24 11:08) [1]

И никто не поможет ?
Все тупые ?



Страницы: 1 вся ветка

Текущий архив: 2006.01.29;
Скачать: CL | DM;

Наверх




Память: 0.44 MB
Время: 0.039 c
15-1136806914
psa247
2006-01-09 14:41
2006.01.29
Кодировка ?


15-1136762101
iZEN
2006-01-09 02:15
2006.01.29
Mind map, или Научите себя думать.


15-1136457482
Игорь Шевченко
2006-01-05 13:38
2006.01.29
А вы говорите, Delphi....


3-1133363995
keal
2005-11-30 18:19
2006.01.29
как востановить данные после delete?


2-1136988441
RDS
2006-01-11 17:07
2006.01.29
процессы





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский