Code: Select all
(TagMetaOffset + ValueOffset) -/+ PrimaryMagic
Code: Select all
(TagMetaOffset + ValueOffset) -/+ PrimaryMagic
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
So I should goto the tags RawOffset + valueoffset?LuxuriousMeat wrote:The offset in the tag index is the address to it's tag data in memory. The "magic" values are used to find the offset in the file.grimdoomer wrote:I don't think I understand. Are you saying that I read the value in the map, and that is the memory address?
Code: Select all
public float ReadSingle(int Address)
{
byte[] buffer = new byte[4];
ReadProcessMemory(m_hProcess, new IntPtr((Address + map.SelectedTag.RawMetaOffset)), buffer, 4, out Out);
return BitConverter.ToSingle(buffer, 0);
}
// BOOL ReadProcessMemory(
// HANDLE hProcess, // handle to the process
// LPCVOID lpBaseAddress, // base of memory area
// LPVOID lpBuffer, // data buffer
// SIZE_T nSize, // number of bytes to read
// SIZE_T * lpNumberOfBytesRead // number of bytes read
// );
[DllImport("kernel32.dll")]
public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead);
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
So you basically made a "emulator" for halo 2 maps?kornman00 wrote:the value calculated for "magic" would be better termed as a "address mask" IMHO.
but yeah, back in 05 I think it was, I worked on a C++ codebase for dealing with halo 2 maps and other related data on the PC but by designing the implementation after how the game deals with content and memory so in the end I'm just loading the map into the base address and saving me hours of extra work writing fixup code and processor power running that code.
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.