Communauté Informatique NDFR.net : Quelqu'un peu me compiler ca ? - Programmation (C/C++, Delphi, VB, etc.)
 
Quelqu'un peu me compiler ca ?
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 24-03-2004, 06:05
wuub's Avatar
wuub wuub is offline
Membre senior
 
Join Date: 13-11-2002
Location: Montpellier
Age: 49
Posts: 552
Send a message via MSN to wuub
Quelqu'un pourrait me compiler ca ?

J'ai trouvé le code source d'un generateur dont j'aurai besoin
et je me demandais si quelqu'un pouvais me le compiler en me l'envoyer à wuub@fr.st ?
Ca n'a rien d'illégale ... enfin je ne crois pas...
D'avance merci

Quote:

/*
* sid.c
*/

unsigned char data_1[] =
{ 0x17,0x2D,0x25,0x29,0x17,0x2D,0x11,0x20,0x12,0x27,0x0E,0x23,0x1B,0x0B,0x27 };
unsigned char data_2[] = { 2,6,9,4,9 };
unsigned char data_3[5][15] = {
{ 0x17,0x2C,0x43,0x0E,0x22,0x13,0x43,0x4D,0x59,0x16,0x22,0x4E,0x37,0x58,0x5C },
{ 0x4B,0x2D,0x5A,0x12,0x24,0x43,0x35,0x4A,0x47,0x36,0x13,0x17,0x53,0x24,0x13 },
{ 0x22,0x47,0x1D,0x4E,0x62,0x22,0x41,0x17,0x26,0x30,0x2C,0x57,0x38,0x36,0x12 },
{ 0x42,0x2E,0x18,0x2D,0x4E,0x20,0x0E,0x23,0x4A,0x60,0x47,0x25,0x30,0x39,0x3F },
{ 0x21,0x24,0x19,0x13,0x1A,0x25,0x1F,0x36,0x4F,0x20,0x2E,0x43,0x36,0x21,0x15 }
};
unsigned char data_4[] = { 1, 5, 7, 6, 3 };

int security_code(char* imei, char* sec_code) {
int i,j;
unsigned char k;
char local_1[15];

if(strlen(imei) != 15)
return 0;
for(i = 0; i < 15; i++) {
local_1[i] = imei[i] - data_1[i];
}
for(i = 0; i < 5; i++) {
k = 0;
for(j = 0; j < 15; j++) {
k += (local_1[j] ^ local_1[(j + data_2[i]) % 15]) * data_3[i][j];
}
k = (k + data_4[i]) % 10;
sec_code[i] = k + 0x30;
}
return 1;
}

main(int argc, char** argv) {
char sec_code[6];

security_code(argv[1], sec_code);
sec_code[5] = 0;
printf("%s\n", sec_code);
}
__________________
L'ignorance n'excuse pas la CONNERIE

Last edited by wuub; 24-03-2004 at 06:11.
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cours de français Benjy Discussions sur le site et/ou le forum 47 01-05-2006 14:47
Est-ce que quelqu'un parle le slovaque? bigmech9 Discussions 2 07-12-2004 14:54
Premiers pas sous Linux Fred Articles 19 21-10-2003 05:46
Quelqu'un aurait une sorte de "Service Pack" pour Win98 ? KnuX Windows 95/98/98SE/ME 13 26-02-2003 13:45
Compiler une DLL Kaspof Programmation (C/C++, Delphi, VB, etc.) 8 07-01-2003 16:16

All times are GMT +2. The time now is 11:50.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.