Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Atlantica Online
You last visited: Today at 20:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Python] NDT files decryptor

Discussion on [Python] NDT files decryptor within the Atlantica Online forum part of the MMORPGs category.

Reply
 
Old 08/10/2013, 21:29   #76
 
neuronet's Avatar
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,521
Received Thanks: 1,305
All battle logic is server side
neuronet is offline  
Old 09/20/2013, 01:23   #77
 
elite*gold: 0
Join Date: Sep 2013
Posts: 1
Received Thanks: 0
Quote:
Originally Posted by neuronet View Post
All battle logic is server side
Not really Neuro, last week on ESPAO ppl managed to get all +10 equips even mounts, decos and outfits with cheat engine, and not only the looks also the stats, but they made a maint on this monday with a 7 days rollback and now it doesnt work. Hell...they even changed weaps stats and got 15kk might ON FL. I think it might worth the time to investigate this xD ill upload a video showing that

lordos85 is offline  
Old 09/20/2013, 02:05   #78
 
elite*gold: 0
Join Date: Jun 2012
Posts: 58
Received Thanks: 9
anyone manage to figure out how to make this work on Int?
raabbat is offline  
Old 09/26/2013, 14:19   #79
 
elite*gold: 0
Join Date: Sep 2013
Posts: 7
Received Thanks: 1
Decryptor/encryptor in C#

Here is the NDT decryptor/encryptor code in C#, enjoy.
How to use:
1) compile using Visual C# into a binary
2) make it a default program to open NDT files
3) click on NDT file to extract.

P.S. Sorry, I don't trust binary files, so I'm not going to post one here for the others.

Code:
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;

namespace UnpackNdt
{
    class Program
    {
        [StructLayout(LayoutKind.Sequential, Pack=1)]
        public struct NdtFileHeader
        {
            public UInt32 MagicBytes;
            public UInt32 Version;
            public UInt32 FileSize;
            public byte Key;
            public byte Undefined1;
            public byte Undefined2;
            public byte Undefined3;
            public UInt32 Undefined4;
            public UInt32 Undefined5;
        }

        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                return;
            }

            string inputFilePath = args[0];

            if (Path.GetExtension(inputFilePath).ToLowerInvariant() == ".ndt")
            {
                string outputFilePath = Path.Combine(Path.GetDirectoryName(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".txt");
                byte[] input = File.ReadAllBytes(inputFilePath);
                byte[] output = Decrypt(input);
                File.WriteAllBytes(outputFilePath, output);
            }
            else
            {
                string outputFilePath = Path.Combine(Path.GetDirectoryName(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".ndt2");
                byte[] input = File.ReadAllBytes(inputFilePath);
                byte[] output = Encrypt(input, 77);
                File.WriteAllBytes(outputFilePath, output);
            }
        }

        static byte[] Decrypt(byte[] input)
        {
            int inputLength = input.Length;
            int outputLength = inputLength - 24;
            byte[] output = new byte[outputLength];
            
            // extract header
            byte[] headerArray = new byte[24];
            Array.Copy(input, headerArray, 24);
            NdtFileHeader header;
            FromArray(headerArray, out header);

            if (header.Version == 0x00010001)
            {
                // decode the data using the Key from the header
                for (int i = 0; i < outputLength; i++)
                {
                    byte c = input[i + 24];
                    c -= header.Key;
                    if (i + 1 != outputLength)
                    {
                        byte next = input[i + 1 + 24];
                        c ^= next;
                    }
                    output[i] = c;
                }
            }
            else if (header.Version == 0x00030001)
            {
                int[] shufflingMap = new int[] { 1, 3, 2, 3, 1, 5, 4, 2, 1, 4, 2, 8, 4, 2, 6, 8, 2, 6, 4 };
                int shufflingMapLength = shufflingMap.Length;
                int numberOfDwords = outputLength / 4;
                Array.Copy(input, 24, output, 0, outputLength);

                for (int i = numberOfDwords - 1; i >= 0; i--)
                {
                    // calculate which Dword to swap with
                    int shuffleBy = shufflingMap[i % shufflingMapLength];
                    int j = (i + shuffleBy) % numberOfDwords;

                    UInt32 iDword = GetUInt32(output, i * 4, 4);
                    UInt32 jDword = GetUInt32(output, j * 4, 4);
                    SetUInt32(jDword, output, i * 4, 4);
                    SetUInt32(iDword, output, j * 4, 4);
                }

                UInt32 adjustedKey = header.Key - (UInt32)0x57D3CEFF;
                UInt32 sum = 0;
                UInt32 carryOver = 0;
                for (int i = 0; i < numberOfDwords; i++)
                {
                    UInt32 iDword = GetUInt32(output, i * 4, 4);
                    UInt32 decodedValue = adjustedKey + iDword + sum + carryOver;
                    SetUInt32(decodedValue, output, i * 4, 4);
                    sum += header.Key;
                    carryOver = iDword;
                }
            }

            return output;
        }

        static UInt32 GetUInt32(byte[] array, int index, int length)
        {
            UInt32 result = 0;
            for (int i = length; i > 0; i--)
            {
                result = result << 8;
                result += array[index + i - 1];
            }
            return result;
        }

        static void SetUInt32(UInt32 value, byte[] array, int index, int length)
        {
            for (int i = 0; i < length; i++)
            {
                array[index + i] = (byte)(value % 256);
                value = value / 256;
            }
        }

        static byte[] Encrypt(byte[] input, byte key)
        {
            int inputLength = input.Length;
            int outputLength = inputLength + 24;
            byte[] output = new byte[outputLength];

            // output header header
            NdtFileHeader header = new NdtFileHeader();
            header.MagicBytes = 0x0052434e; // NCR
            header.Version = 0x00010001;    // v. 1.0.1
            header.FileSize = (uint) outputLength;
            header.Key = key;
            byte[] headerArray = new byte[24];
            ToArray(header, headerArray);
            Array.Copy(headerArray, output, 24);

            // encode the data using the Key
            for (int i = inputLength - 1; i >= 0; i--)
            {
                byte c = input[i];
                if (i != inputLength - 1)
                {
                    byte next = output[i + 1 + 24];
                    c ^= next;
                }
                c += header.Key;
                output[i + 24] = c;
            }

            return output;
        }

        private static void FromArray<T>(byte[] input, out T output)
        {
            // Pin the managed memory while, copy it out the data, then unpin it
            GCHandle handle = GCHandle.Alloc(input, GCHandleType.Pinned);
            output = (T) Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));
            handle.Free();
        }

        private static void ToArray<T>(T input, byte[] output)
        {
            // Pin the managed memory while, copy it out the data, then unpin it
            GCHandle handle = GCHandle.Alloc(output, GCHandleType.Pinned);
            Marshal.StructureToPtr(input, handle.AddrOfPinnedObject(), false);
            handle.Free();
        }
    }
}
test, please ignore is offline  
Thanks
1 User
Old 01/26/2023, 18:28   #80
 
elite*gold: 50
Join Date: Nov 2008
Posts: 46
Received Thanks: 18
encrypt v3 ndt

here is code from previous post but updated to be able to encrypt back to v3:
Do not remember why I needed this, but post it here just in case if I will be back playing AO
[]Dark is offline  
Thanks
2 Users
Old 01/27/2023, 05:15   #81
 
elite*gold: 0
Join Date: Aug 2013
Posts: 323
Received Thanks: 92
Just a reminder, that you need to save the .txt file as UTF-16 LE encoding in order for the raw text file to be recognized by the game when renaming it to .ndt
ANR2K is offline  
Old 02/04/2023, 20:41   #82
 
elite*gold: 0
Join Date: Feb 2023
Posts: 1
Received Thanks: 0
wht the function for this code?
SHUNZU is offline  
Reply


Similar Threads Similar Threads
[Req/Help] .dat decryptor for Conquer 1.0?
11/10/2009 - CO2 Weapon, Armor, Effects & Interface edits - 0 Replies
Hey sorry for having to make a new post (also, toss up between here or the programing section seeing as it's both but w/e). I'm messing around a bit with the 1.0 source and trying to fix a few things on it and add some new features. One of the problems I'm having though is that none of the posted .dat decryptors work for 1.0. Main thing I'm trying to decrypt right now is the ItemType so I can replace the item list in the source, as it is right now it will let you create 2.0 items which...
< request> <Dat decryptor>
02/02/2009 - Conquer Online 2 - 2 Replies
Can someone give me a dat decryptor for item type couse i deleted mine by mistake.... Thx in advance;)
Decryptor Encryptor
04/21/2008 - General Coding - 2 Replies
I have yet to find out if any other games .dat file may be decrypted. I need to find what games are compatiable with this program. http://www.elitepvpers.com/forum/co2-exploits-hack s-tools/44730-easy-monster-dat-encrypter-decrypter .html If you are getting a readable decrypted.txt file for that certain game's .dat please post here the game that it is compatiable with. Thank you
l2 ini decryptor
10/30/2004 - Lineage 2 - 1 Replies
hey does anyone one know were i can find the l2 ini decryptor?



All times are GMT +1. The time now is 20:52.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.