Unknown check sum in IteamAll.lod
#1

Hi all Wink

 

Sorry for my bad english) Im new to this forum.

 

Interested in this question. Does anyone versed in the structure of itemall from the new client?

 

Particularly interested in the last 4 bytes, based on the considerations, I realized that this is the sum but how to calculate it for me is a mystery. My guess is it CRC32. Share your guesses, I will be very grateful ^_^

#2
Buy checksum algorithm in itemall. My skype satana7272

#3
I have the same problem. Anyone can help with an algorithm?

#4
Which Episode ?

#5

Ep3
I'm interested in last 8 bytes:

static F1 D8 FF FF (what are these bytes?)

and checksum 37 0C A5 7A (how to calculate it?)

File if you need it:

2

#6

I found how to calculate checksum (thanks rrbkmz)

Still don't know about this:

static F1 D8 FF FF (what are these bytes?)

#7


Ep3

I'm interested in last 8 bytes:

static F1 D8 FF FF (what are these bytes?)

and checksum 37 0C A5 7A (how to calculate it?)

File if you need it:

2

 

Use the HateMe editor, nothing else is needed.

#8

I'm writing my own editors =)

That's why I asked this question

Hope, this bytes (C1 D8 FF FF) aren't so important Big Grin

Here's a bit of code, if someone needs: (author [member=filix_93] )

 

 

namespace Checksum
{
using System;
using System.Diagnostics;
using System.IO;

public static class DoWork
{
public static int CalculateSum(string filepath, int size)
{
int num = 0;
BinaryReader reader = new BinaryReader(File.Open(filepath, FileMode.Open));
try
{
for (int i = 0; i < size; i += 20)
{
reader.BaseStream.Seek((long) i, SeekOrigin.Begin);
num += reader.ReadInt32();
}
reader.Close();
}
catch (Exception exception)
{
Debug.WriteLine(exception);
throw exception;
}
finally
{
if (reader != null)
{
reader.Dispose();
}
}
return num;
}

public static bool CheckSumExist(string filepath)
{
return (GetCurrentSum(filepath) == CalculateSum(filepath, GetFileSize(filepath)));
}

public static bool EncodeFile(string filepath)
{
try
{
BinaryWriter writer;
int num;
Exception exception;
if (!CheckSumExist(filepath))
{
num = CalculateSum(filepath, GetFileSize(filepath));
writer = new BinaryWriter(File.OpenWrite(filepath));
try
{
writer.BaseStream.Seek(0L, SeekOrigin.End);
writer.Write(num);
writer.Close();
}
catch (Exception exception1)
{
exception = exception1;
Debug.WriteLine(exception);
throw exception;
}
finally
{
if (writer != null)
{
writer.Dispose();
}
}
return true;
}
num = CalculateSum(filepath, GetFileSize(filepath));
writer = new BinaryWriter(File.OpenWrite(filepath));
try
{
writer.BaseStream.Seek(-4L, SeekOrigin.End);
writer.Write(num);
writer.Close();
}
catch (Exception exception2)
{
exception = exception2;
Debug.WriteLine(exception);
throw exception;
}
finally
{
if (writer != null)
{
writer.Dispose();
}
}
return true;
}
catch
{
return false;
}
}

public static int GetCurrentSum(string filepath)
{
int num = 0;
BinaryReader reader = new BinaryReader(File.Open(filepath, FileMode.Open));
try
{
reader.BaseStream.Seek(-4L, SeekOrigin.End);
num = reader.ReadInt32();
reader.Close();
}
catch (Exception exception)
{
Debug.WriteLine(exception);
throw exception;
}
finally
{
if (reader != null)
{
reader.Dispose();
}
}
return num;
}

public static int GetFileSize(string filepath)
{
return Convert.ToInt32(new FileInfo(filepath).Length);
}
}
}

 

 

Solved.

#9
The original code is in the client source that you can find on this forum. 
The in Secure\FileSecure.cpp



Forum Jump:


Users browsing this thread: 1 Guest(s)