Jump to content
Sign in to follow this  
Kyan

SL3NCK - Calculate NCK's from TARGET_HASH and MASTER_SP_CODE

Recommended Posts

Hi, SL3NCK calculates the 7 NCK's levels used for unlocking SL3 phones.

SL3NCK("0000000000000000000000000000000000000000", "080803080307030003010002020305")

_output:

#pw+283037116581614+1#
#pw+235518432205471+2#
#pw+595388505163502+3#
#pw+415333744058839+4#
#pw+259299316395048+5#
#pw+467723677207791+6#
#pw+690485095019780+7#

You can test run and see is the same code output as in the following websites:

#include <Crypt.au3>

; #Function# ===========================================================================================================
; Name...........: SL3NCK
; Description ...: Calculates 7 NCK levels for SL3.
; Syntax.........: SL3NCK("TARGET_HASH","MASTER_SP_CODE")
; Return values .: string with 7 levels NCK's.
; Author ........: kyan (autoIT code), oOXTCOo (PHP code).
; Remarks .......: $TargetHash is a string with 40 hex chars. $MasterSP is a string with 30 digits.
; Related .......: SimlFeistel(), _packH()
; Requeires .....: #include <Crypt.au3>
; ===============================================================================================================================
Func SL3NCK($TargetHash, $MasterSP)
    $result = ''
    $MasterSP = '000000' & StringMid($MasterSP, 0 + 1, 24)
    For $i = 1 To 7
        $hash = _packH('0' & $i & $TargetHash)
        $hash = StringTrimLeft(StringUpper(_Crypt_HashData($hash, $CALG_SHA1)), 2)
        $precode8 = StringMid($MasterSP, 0 + 1, 16)
        $precode7 = StringMid($MasterSP, 17 + 1, 30)
        For $magic = 0 To 1
            $sh = _packH('0' & $magic & StringMid($hash, 0 + 1, 32) & $precode8)
            $sh = StringTrimLeft(StringUpper(_Crypt_HashData($sh, $CALG_SHA1)), 2)
            $precode = SimlFeistel($sh, $precode7)
            $precode7 = $precode

            $sh = _packH('0' & $magic & StringMid($hash, 0 + 1, 32) & $precode)
            $sh = StringTrimLeft(StringUpper(_Crypt_HashData($sh, $CALG_SHA1), 2)
            $precode = SimlFeistel($sh, $precode8, 8)
            $precode8 = $precode
        Next
        $final = $precode8 & $precode7
        $x = 1
        $nck = ''
        For $y = 1 To 15
            $nck = $nck & StringMid($final, $x + 1, 1)
            $x += 2
        Next
        $result &= '#pw+' & $nck & '+' & $i & '#' & @CRLF
    Next
    Return $result
EndFunc   ;==>SL3NCK

Func SimlFeistel($sh, $precode, $bytes = 7)
    Local $result = '', $j = 0, $nck = '', $nck2 = ''
    While ($j < ($bytes * 2))
        $nck = StringMid($sh, $j + 1, 1) & StringMid($sh, $j + 2, 1)
        $nck2 = StringMid($precode, $j + 1, 1) + StringMid($precode, $j + 2, 1)
        $prenck = Mod((Dec($nck) + Dec($nck2)), 10)
        $result = $result & '0' & $prenck
        $j += 2
    WEnd
    Return $result
EndFunc   ;==>SimlFeistel

Func _packH($sInput)
    Local $sReply = ""
    For $xx = 1 To StringLen($sInput) Step 2
        $sReply &= Chr(Dec(StringMid($sInput, $xx, 2)))
    Next
    Return $sReply
EndFunc   ;==>_packH by Luigi

Hope it comes handy for someone :D

PS: You can't unlock a phone only with this. Google is your friend.

Edited by Kyan

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Dan_555
      Hi, 
      i'v just uploaded my latest project: Simple Snippet Manager to the Downloads. area :

       

       The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor.
          The Copy/Paste process happens over the (windows)Clipboard. 
          The previous clipboard content is not restored.
          There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive).  
          The Hotkey is reenabled, when the main Window is activated.
          
          This is a File/Folder based manager. 
          The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders.
          
          The root folder is freely selectable, but it  should be a Folder with writing permission.
          Please install the App in a folder with Writing permission, too. 
          This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App.
          
      First configuration:
      1. Open the config Window.
      2. Enter the Language name, create or seek a root folder, enter an extension.
      3. Click on Set button.
      4. Click on the Exit button.
      The Language configuration is done, adding files or folders are needed:
       1. Select the language from the dropbox list, and click on Get Lang button.
      2a. Right Click on the root folder, chose New folder to add categories.
      2b. or chose New/Edit file to open the builtin text editor
       3. Paste or Write a snippet-code, enter a filename and save it.
       
       (Repeat the 3. as needed)
       
      Usage:
      Select a language, then click on Get Lang button.
      Choose a file with the left mouse button.
      Check if the code was loaded in the Textarea at the bottom.
      Switch to your Sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text.
      There is a time limit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed.
      Changelog:
      V1.02        (24.06.2020)
                  Addition: Undocumented ini setting: StartLoadLastUsedLanguage
                            Setting this to 1 (default value) will now reload the Last used language at start.
                            Last used language counts for the Language, selected with [Get Lang] button. The [Config] button will delete the last used language.
                            LastUsedLanguageNr, LastUsedLanguageName ini settings are used internaly for the above function.
                   Added version string to the main Window title.
      V1.01        (23.06.2020)
                  Bugfix    : Starting the App without the ini file now sets the correct starting Hotkey (Ctrl b)
                  Addition: Clipboard is saved, before pasting, and restored after pasting. (May work with text data only. p.s. untested!)
    • By Dan_555
      Simple Snippet Manager (AutoIt v3.3.14.5)
       The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor.
          The Copy/Paste process happens over the (windows)Clipboard. 
          The previous clipboard content is not restored.
          There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive).  
          The Hotkey is reenabled, when the main Window is activated.
          
          This is a File/Folder based manager. 
          The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders.
          
          The root folder is freely selectable, but it  should be a Folder with writing permission.
          Please install the App in a folder with Writing permission, too. 
          This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App.
          
      First configuration:
      1. Open the config Window.
      2. Enter the Language name, create or seek a root folder, enter an extension.
      3. Click on Set button.
      4. Click on the Exit button.
      The Language configuration is done, adding files or folders are needed:
       1. Select the language from the dropbox list, and click on Get Lang button.
      2a. Right Click on the root folder, chose New folder to add categories.
      2b. or chose New/Edit file to open the builtin text editor
       3. Paste or Write a snippet-code, enter a filename and save it.
       
       (Repeat the 3. as needed)
       
      Usage:
      Select a language, then click on Get Lang button.
      Choose a file with the left mouse button.
      Check if the code was loaded in the Textarea at the bottom.
      Switch to your sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text.
      There is a timelimit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed.
       
      The Download includes:
      32 + 64bit exe, sourcecode, icon, read me text and 2 Instructional Helpfiles in Html and PDF format.
    • By Fernandin
      Let me get it straight...
      I've been having such a great experience with AutoIt, it helped me a lot at my work. And now, I gotta make some configurations in the BIOS of many computers at my work. So, I'd like to know,  is it possible to use AutoIt (or some programming language) to write an algorithm that when compiled and transefered to a pen drive, it's "plug and run"? 
    • By Skeletor
      Hi All,
      It has been bugging me for a while now. 
      Can you view the AutoIt code from within a compiled exe. Like how you can with most .Net exe's by using a certain program.
      If this is possible, how then can I secure my program (if this method exists).
       
    • By LoneWolf_2106
      Hi everybody,
      i want to optimize my search code, because i don't think that my solution is "acceptable" from development perspective, it might be optimized.
      I have a text file, i read it and i copy all the entries to an Array, then i have to start a search to see if a specific entry is present. I have about ten different strings to search.
      Func FileSearch($file_content_array, $search) $j=0 For $i = 0 To UBound($file_content_array) - 1 $search_result=StringInStr($file_content_array[$i],$search) If $search_result<>0 Then ReDim $searchResultArray[UBound($searchResultArray) + 1] $searchResultArray [$j] = $file_content_array[$i] $j+=1 EndIf Next Return $searchResultArray EndFunc My solution would be ok for a single search, but in case of multiple searches? would it be still good?
      I have thought to use a 2D Array, where the first column is the array-item and the second column is "yes" or "no". But what about the searches? Do i have to use 10 times the function?
      In case of questions: I have to scan a directory and check whether some files are present or not and then write into another file:"yes, it is present", "no, it is not present".
      Thanks in advance
×
×
  • Create New...