Member
[wotlkc][build:46902] NameCache offsets changed?
Hello, it's been a while.
My NameCache implementation broke down with the most recent build. It's been working 'fine' through builds 45506->46779.
My best guess is the offsets to `len`(count) and `arr`(table/index/ykwim) changed.
Symptoms include; `len` becomes ridiculously high, guid/address misses are way up and names are a garbled mess on the few hits I get. Eventually the loop runs out of bounds.
I've yet to reinstall IDA and fire it up against the latest build.
Code:
pub const PLAYER_NAME_CACHE: usize = 0x2D60B10; // see next line.
pub const ACTUAL_PLAYER_NAME_CACHE: usize = 0x2D28A10;
pub struct PlayerNameCache {
pub base: Address,
pub arr: Address,
pub len: u64,
len_addr: Address,
proc: Memory,
}
impl PlayerNameCache {
pub fn new(mut proc: Memory, gamebase: Address) -> Result<Self> {
let base = proc.read_addr64(gamebase + PLAYER_NAME_CACHE)?;
let arr = proc.read_addr64(gamebase + PLAYER_NAME_CACHE + 0x10)?;
let len_addr = gamebase + PLAYER_NAME_CACHE + 0x8;
let len: u64 = proc.read(len_addr)?;
Ok(NameCache {
base,
arr,
len,
len_addr,
proc,
})
}
pub fn tick(&mut self, m: HashMap<GUID,String>) -> Result<()> {
let len: u64 = self.proc.read(self.len_addr)?;
if len != self.len {
self.len = len
}
for n in 0..len {
let off = 0x8 * n;
let addr = self.proc.read_addr64(self.arr + off)?;
if addr.is_null() {
continue;
}
let guid: GUID = self.proc.read(addr + 0x8)?;
if guid.hi == 0 {
continue;
}
if !m.contains_key(&guid) {
let name = self.proc.read_char_array(addr + 0x19, 32)?;
m.insert(guid, name);
}
}
Ok(())
}
}
Edit: Fixed. Got IDA back in action and found PLAYER_NAME_CACHE to be at 0x2D28A10.
Just need to sort out my tick method to issue the `next=0x0` reads I think, to reduce missed addresses & guids.
Last edited by klumpen; 12-06-2022 at 03:36 PM.
These ads disappear when you log in.