PDA

View Full Version : DCT4key algorithm?



ci-nyi
19-10-2004, 08:50 AM
I search for algorithm (or source in C if possible) of extracting box serial from unlocking key as used in DCT4key.exe. Could anybody help me?

Yotamz
19-10-2004, 03:01 PM
is this what you are looking for?

http://nokiafree.org/forums/t60683/h/s.html

ci-nyi
19-10-2004, 05:18 PM
is this what you are looking for?

http://nokiafree.org/forums/t60683/h/s.html

You mean post #99? Yes. Thank you.

ci-nyi
20-10-2004, 10:22 AM
OK, here is the dct4key algorithm in C.



/*
* dct4key.c by Ci-Nyi
*/

#include <string.h>

void dct4key(const unsigned char *code, unsigned char *box_serial)
{
unsigned char ai4[13];
unsigned char ai5[15];
char ai6[5];
unsigned char i, j;

for (i = 0; i < strlen(code); i++)
ai5[i] = code[i] - '0';
j = 1;
for (i = 1; i <= 13; i += 2)
ai4[j++] = (ai5[i] << 4) + ai5[i + 1] ;

ai4[0] = ai5[0] - '0';
ai4[8] = ai4[0] & 0xF;
ai4[9] = (ai4[1] - (ai4[1] & 0xF)) >> 4;
ai4[10] = ai4[1] & 0xF;
ai4[11] = (ai4[2] - (ai4[2] & 0xF)) >> 4;
ai4[12] = ai4[2] & 0xF;

for (i = 0; i < 5; i++)
ai6[i] = (ai4[3 + i] & 0xF0) >> 4;
for (i = 0; i < 5; i++)
ai6[i] = ai6[i] - ai4[i + 8];
for (i = 0; i < 5; i++)
if (ai6[i] < 0)
ai6[i] += 10;

for (i = 0; i < 5; i++)
box_serial[i] = ai6[i] + '0';

box_serial[i] = 0;
}

DCT4Calc
27-10-2004, 04:09 AM
If you want the same explained in normal maths:


Here is a mastercode:
#PW+ ABCDE FXGXHXIXJX +X#

The "X"-digits are put aside.

F-A
G-B
H-C
I-D
J-E

Then add +10 and keep only the last digit (ones). (The +10 is needed to ensure only positive results, because we assume 9+1=0)



HONGXING DCT4Calc 3.0R
======================
IMEI=354646464654647
TYPE=2
MCCMNC=23805

#PW+144062454414552+1#
#PW+234743741401236+2#
#PW+561256071146344+3#
#PW+653327667307616+4#
#PW+493785200321376+5#
#PW+645867457552656+6#
#PW+003721110351716+7#


[code]
14406 25445

2 - 1 + 10 = 11
5 - 4 + 10 = 11
4 - 4 + 10 = 10
4 - 0 + 10 = 14
5 - 6 + 10 = 09

So our box SN is 11049

I originally posted this at GSM-Freeboard some time ago (on 2004-12-04)

Yotamz
27-10-2004, 12:18 PM
@dct4calc

nice explanation :smile:

..

do you know how the codes algorythm works?

could be good to calc codes with a pen and paper..

DCT4Calc
27-10-2004, 03:06 PM
Yes, but it would talk long time.

ci-nyi
27-10-2004, 10:53 PM
If you want the same explained in normal maths:
[...]


Thank you, your explanation was very clear and useful. :-)

achtungbaby
26-11-2004, 01:15 PM
hey guys! could you kindly help me unlock a new model of Nokia. It's Nokia 2650 and it's included on the latest version (V3.10) of Nokia Flash Reverse. But I still recieve "code error". I have tried even the nokia free unlock but same result. I have already tried 3 times, thus I only have 2 more tries.

Please email me at [email protected] so that I can give you the IMEI and where locked.

Your help is HIGHLY appreciated.

Thanks in advance!!!

ninjana
07-12-2004, 05:59 AM
hi im a noob.. i don understand c++ so... i wonder i you could show to me a mathmatique analisis of your formula so i can develop my program in a language i understand like fortran 90??

please.. im steel to much noob in C language :roll:

[ExiTuS]
08-12-2004, 03:03 PM
maybe you understand my source code:
(in JavaScript, 100% working)

i think its a little bit easier than the c source ^^ and very simple to understand :)



// JavaScript Nokia Box-SN-Calculator
// Copyright (c)2004 [ExituS], NokiaPort.de
// E-Mail: [email protected]
// Date: 05.10.2004
// Description: This algorithm calculates the box-serial from a valid Nokia mastercode

function calcboxsn() {
var a = new Array(5);
var bsn;
var k = 5;
var j = 0
var mcode = document.form.mastercode.value;

for (i = 1; i < 6; i++) {
a[i] = mcode.charAt(k) - mcode.charAt(j);
a[i] += 10;
k += 2;
j += 1;
}

for (i = 1; i < 6; i++) {
bsn = a[i];
if (bsn > 9) {
bsn -= 10;
}
document.form.boxsn.value += bsn;
}
}

The variable 'mcode' contains the 15digit mastercode. (here: source from a form out of a html-document)
The resultated Box-SN also comes back to the form. Each calced digit will be joinedto the previos digit, until its 5 digits.

greetings from germany
[ExiTuS], NokiaPort.de

ninjana
08-12-2004, 10:10 PM
i now understand....
what we are searching here is new box numbers..
right?
so now i must get new original nokia master codes
and then post the box number if its new..
;)
am i right??... so what about the source code to produce master codes from "imei , MCCMNC, and BOX number"....?
can ani body post it? i would like to understand it.... ;)
:D

[ExiTuS]
08-12-2004, 11:11 PM
what we are searching here is new box numbers..
right?these sources are for extracting the box serial from a valid mastercode.

so now i must get new original nokia master codes
and then post the box number if its new..
am i right??...thats right. if you get some codes extarct the serial and hope there's a new serial, not released now.

so what about the source code to produce master codes from "imei , MCCMNC, and BOX number"....? can ani body post it?there are codes 4 free and published already. e.g. look on indear's pages.

i would like to understand it.... ;)he he, i wish much phun with it :) look the source, and u'll see what you want to do... i think u will close the document as fast as you can :) it's quite not easy and simple as the sources posted here!!

[ExiTuS]

ninjana
09-12-2004, 12:31 AM
indear's pages??
dont know here they are :sad:

but wont close it so fast..
im persistent....
lol

cant you post me those pages?

ninjana
09-12-2004, 12:44 AM
i understanded now... indears pages.. hihi
lol
already got the source codes..
now trying to understand
tnxs