0% found this document useful (0 votes)
23 views11 pages

Ragnarok Mobile Encryption Tool

Técnica de cifragem e ocultação e extração

Uploaded by

porteironevoa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views11 pages

Ragnarok Mobile Encryption Tool

Técnica de cifragem e ocultação e extração

Uploaded by

porteironevoa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

{

"[Link]": true
}

// <autogenerated />
using System;
using [Link];
[assembly:
global::[Link](".NETFra
mework,Version=v4.5.2", FrameworkDisplayName = "")]

using [Link];
using [Link];

// General Information about an assembly is controlled through the


following
// set of attributes. Change these attribute values to modify the
information
// associated with an assembly.
[assembly: AssemblyTitle("Ragnarok Mobile Cipher")]
[assembly: AssemblyDescription("A tool to decrypt and encrypt
Ragnarok Mobile client files.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ragnarok Mobile Cipher")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not


visible
// to COM components. If you need to access a type in this
assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project


is exposed to COM
[assembly: Guid("f02f4e74-5baa-48c5-b978-c7959a8b8273")]

// Version information for an assembly consists of the following


four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and
Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("[Link]")]
[assembly: AssemblyFileVersion("[Link]")]

using System;
using [Link];
using [Link];
using [Link];

namespace RagnarokMobileCipher
{
public static class AESSecurity
{
private static byte[] saltBytes = new byte[]
{
88,
68,
75,
111,
110,
103,
109,
105,
110,
103,
115,
117,
122,
104,
105,
116,
97,
105,
99,
104,
97
};

private static byte[] pWDBytes = new byte[]


{
88,
68,
107,
109,
115,
117,
122,
104,
105,
122,
117,
105,
99,
104,
97
};

private static AesManaged _aesManaged;

public static AesManaged aesManaged


{
get
{
if (AESSecurity._aesManaged == null)
{
string @string =
[Link]([Link]([Link]
Bytes));
AESSecurity._aesManaged = new AesManaged();
Rfc2898DeriveBytes rfc2898DeriveBytes = new
Rfc2898DeriveBytes(@string,
[Link]([Link]));
AESSecurity._aesManaged.BlockSize =
AESSecurity._aesManaged.LegalBlockSizes[0].MaxSize;

AESSecurity._aesManaged.KeySize =
AESSecurity._aesManaged.LegalKeySizes[0].MaxSize;
AESSecurity._aesManaged.Key =
[Link](AESSecurity._aesManaged.KeySize / 8);
AESSecurity._aesManaged.IV =
[Link](AESSecurity._aesManaged.BlockSize / 8);
}

return AESSecurity._aesManaged;
}
}

public static byte[] EncryptKeyBytes(byte[] datas)


{
byte[] array = new byte[[Link]];
[Link](datas, 0, array, 0, [Link]);
for (int i = 0; i < [Link]; i++)
{
array[i] = (byte)(array[i] << 1);
}
return array;
}

public static byte[] DecryptString(string strSource, bool


header = true)
{
byte[] bytes = [Link](strSource);
return [Link](bytes, header);
}

public static byte[] DecryptBytes(byte[] encryptBytes, bool


header = true)
{
if (header && !
[Link](encryptBytes))
{
return null;
}
ICryptoTransform cryptoTransform =
[Link]();
byte[] result = null;
using (MemoryStream memoryStream = new
MemoryStream(encryptBytes))
{
if (header)
{
BinaryReader binaryReader =
[Link]<MemoryStream>(memoryStream
);
}
result =
[Link](encryptBytes,
Convert.ToInt32([Link]), [Link] -
Convert.ToInt32([Link]));
}
return result;
}

public static byte[] DecryptFile(string path)


{
byte[] result = null;
using (FileStream fileStream = new FileStream(path,
[Link]))
{
BinaryReader binaryReader =
[Link]<FileStream>(fileStream);
ICryptoTransform cryptoTransform =
[Link]();
using (CryptoStream cryptoStream = new
CryptoStream(fileStream, cryptoTransform, 0))
{
byte[] array = new byte[1048576];
using (MemoryStream memoryStream = new
MemoryStream(Convert.ToInt32([Link]) +
[Link]))
{
int num;
while ((num = [Link](array, 0,
[Link])) > 0)
{
[Link](array, 0, num);
}
result = [Link]();
}
}
[Link]();
}
return result;
}

public static byte[] EncryptString(string strSource, bool


header = true)
{
byte[] bytes = [Link](strSource);
return [Link](bytes, header);
}

public static byte[] EncryptBytes(byte[] data, bool header


= true)
{
if (header &&
[Link](data))
{
return null;
}
ICryptoTransform cryptoTransform =
[Link]();
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new
CryptoStream(memoryStream, cryptoTransform,
[Link]);
[Link](data, 0, [Link]);
[Link]();
byte[] array = (!header) ? [Link]() :
[Link](memoryStream);
[Link]();
return array;
}

public static byte[] DecryptBytes(byte[] datas)


{
return [Link](datas, true);
}
}
}

<?xml version="1.0" encoding="utf-8" ?>


<configuration>
<startup>
<supportedRuntime version="v4.0"
sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

using System;
using [Link];

namespace RagnarokMobileCipher
{
public class FileHeaderUtil
{
private const byte ENCRYPT_HEADER_FLAG = 2;

private const string ENCRYPT_HEADER = "ENCRYPT_HEADER";

public static bool CheckHeaderIsEncrypt(byte[] datas)


{
return datas != null &&
[Link](new MemoryStream(datas));
}
public static bool CheckHeaderIsEncrypt(MemoryStream ms)
{
bool result = false;
if (ms != null)
{
BinaryReader binaryReader = new BinaryReader(ms);
byte b = [Link]();
if (b == 2)
{
string text = [Link]();
if (text == ENCRYPT_HEADER)
{
result = true;
}
}
[Link]();
}
return result;
}

public static byte[] AddEncryptHeader(byte[] datas)


{
if (datas != null)
{
return [Link](new
MemoryStream(datas));
}
return null;
}

public static byte[] AddEncryptHeader(MemoryStream ms)


{
if (ms != null)
{
MemoryStream memoryStream = new MemoryStream();
BinaryWriter binaryWriter = new
BinaryWriter(memoryStream);
[Link](2);
[Link](ENCRYPT_HEADER);
[Link]();
byte[] array = [Link]();
byte[] array2 = [Link]();
byte[] array3 = new byte[[Link] +
[Link]];
[Link](array, 0, array3, 0,
[Link]);
[Link](array2, 0, array3, [Link],
[Link]);
[Link]();
return array3;
}
return null;
}

public static byte[] RemoveEncryptHeader(byte[] datas)


{
if (datas != null)
{
return [Link](new
MemoryStream(datas));
}
return null;
}

public static byte[] RemoveEncryptHeader(MemoryStream ms)


{
byte[] result = null;
if (ms != null)
{
BinaryReader binaryReader = new BinaryReader(ms);
byte b = [Link]();
if (b == 2)
{
string text = [Link]();
if (text == ENCRYPT_HEADER)
{
result =
[Link](Convert.ToInt32([Link] - [Link]));
}
}
}
return result;
}

public static BinaryReader RemoveEncryptHeaderStream<T>(T


s) where T : Stream
{
if (s != null)
{
BinaryReader binaryReader = new BinaryReader(s);
byte b = [Link]();
if (b == 2)
{
string text = [Link]();
if (text == ENCRYPT_HEADER)
{
return binaryReader;
}
}
[Link]();
}
return null;
}
}
}

using [Link];

namespace RagnarokMobileCipher
{
class Program
{
static void Main(string[] args)
{
string file = "framework.unity3d";
byte[] bytes = [Link](file);
[Link](file + ".output123", bytes);
}
}
}

<?xml version="1.0" encoding="utf-8"?>


<Project ToolsVersion="14.0" DefaultTargets="Build"
xmlns="[Link]
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\
[Link]" Condition="Exists('$
(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\
[Link]')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F02F4E74-5BAA-48C5-B978-
C7959A8B8273}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RagnarokMobileCipher</RootNamespace>
<AssemblyName>RagnarokMobileCipher</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="[Link]" />
<Reference Include="[Link]" />
<Reference Include="[Link]" />
<Reference Include="[Link]" />
<Reference Include="[Link]" />
<Reference Include="[Link]" />
<Reference Include="[Link]" />
</ItemGroup>
<ItemGroup>
<Compile Include="[Link]" />
<Compile Include="[Link]" />
<Compile Include="[Link]" />
<Compile Include="Properties\[Link]" />
</ItemGroup>
<ItemGroup>
<None Include="[Link]" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\[Link]" />
<!-- To modify your build process, add your task inside one of
the targets below and uncomment it.
Other similar extension points exist, see
[Link].
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

You might also like