https://youtu.be/VBqYEaqCzxY

find encryption keys - not very good idea. Such things are better kept private.JohnHudeski wrote: ↑Tue May 14, 2019 11:07 amIs it possible to do a tutorial on how to find encryption keys
or how to find out how exe read un-common structures
Code: Select all
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Globalization;
namespace HJA_test
{
class BinaryReaderBE : BinaryReader
{
private byte[] a16 = new byte[2];
private byte[] a32 = new byte[4];
private byte[] a64 = new byte[8];
public BinaryReaderBE(System.IO.Stream stream) : base(stream) { }
public override float ReadSingle()
{
a32 = base.ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToSingle(a32, 0);
}
public override UInt16 ReadUInt16()
{
a16 = base.ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToUInt16(a16, 0);
}
public override Int16 ReadInt16()
{
a16 = base.ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToInt16(a16, 0);
}
public override Int32 ReadInt32()
{
a32 = base.ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToInt16(a32, 0);
}
public override UInt32 ReadUInt32()
{
a32 = base.ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToUInt32(a32, 0);
}
public override long ReadInt64()
{
a64 = base.ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToInt64(a64, 0);
}
}
class Program
{
static void Main(string[] args)
{
NumberFormatInfo nfi = new NumberFormatInfo();
nfi.NumberDecimalSeparator = ".";
float x = 0;
var sw = new StreamWriter(Path.GetFileNameWithoutExtension(args[0]) + ".obj");
sw.Write(x.ToString("0.######", nfi));
}
}
}
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
namespace TM2012
{
class BinaryReaderBE : BinaryReader
{
private byte[] a16 = new byte[2];
private byte[] a32 = new byte[4];
private byte[] a64 = new byte[8];
public BinaryReaderBE(System.IO.Stream stream) : base(stream) { }
public override float ReadSingle()
{
a32 = base.ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToSingle(a32, 0);
}
public override UInt16 ReadUInt16()
{
a16 = base.ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToUInt16(a16, 0);
}
public override Int16 ReadInt16()
{
a16 = base.ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToInt16(a16, 0);
}
public override Int32 ReadInt32()
{
a32 = base.ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToInt16(a32, 0);
}
public override UInt32 ReadUInt32()
{
a32 = base.ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToUInt32(a32, 0);
}
public override long ReadInt64()
{
a64 = base.ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToInt64(a64, 0);
}
}
class tm2012
{
static void Main(string[] args)
{
NumberFormatInfo nfi = new NumberFormatInfo();
nfi.NumberDecimalSeparator = ".";
int i;
float x, y, z;
var fs = new FileStream("C:\\ui.ngp", FileMode.Open, FileAccess.Read);
var br = new BinaryReaderBE(fs);
var sw = new StreamWriter("ui.obj");
fs.Seek(0x29ef30, SeekOrigin.Begin);
int nv = 0x12f8;
for (i = 0; i < nv; i++)
{
x = br.ReadInt16() / 4096f;
y = br.ReadInt16() / 4096f;
z = br.ReadInt16() / 4096f;
sw.Write("v " + x.ToString("0.######", nfi));
sw.Write(" " + y.ToString("0.######", nfi));
sw.Write(" " + z.ToString("0.######", nfi));
sw.WriteLine();
}
fs.Seek(0x298500, SeekOrigin.Begin);
int nf = 0x3513 / 3;
int f1, f2, f3;
for (i = 0; i < nf; i++)
{
f1 = br.ReadUInt16() + 1; f2 = br.ReadUInt16() + 1; f3 = br.ReadUInt16() + 1;
sw.WriteLine("f " + f1 + " " + f2 + " " + f3);
}
sw.Close();
}
}
}
Code: Select all
var br = new BinaryReaderBE(fs);
Code: Select all
var br = new BinaryReader(fs);