Right, lets go one step further.
lets find a Pattern!
Code:
.text:00423950 sub_423950 proc near ; DATA XREF: .data:008071ACo
.text:00423950
.text:00423950 arg_0 = dword ptr 8
.text:00423950
.text:00423950 55 push ebp
.text:00423951 8B EC mov ebp, esp
.text:00423953 A1 84 06 99 00 mov eax, dword_990684
.text:00423958 85 C0 test eax, eax
.text:0042395A 75 05 jnz short loc_423961
.text:0042395C B8 83 01 6B 00 mov eax, offset unk_6B0183
.text:00423961
.text:00423961 loc_423961: ; CODE XREF: sub_423950+Aj
.text:00423961 50 push eax
.text:00423962 8B 45 08 mov eax, [ebp+arg_0]
.text:00423965 50 push eax
.text:00423966 E8 15 21 C1 FF call sub_35A80
.text:0042396B 83 C4 08 add esp, 8
.text:0042396E B8 01 00 00 00 mov eax, 1
.text:00423973 5D pop ebp
.text:00423974 C3 retn
.text:00423974 sub_423950 endp
Suppose we have this (the GetMiniMapZoneText function) and we'd like to get the pattern.
Enable opcodes first ((Options/General/Number of opcode bytes = 10)) (I already did that).
Just stick all Opcodes in a string, seperated by "\x"
sooo...
that would get me to...
pattern :"\x55\x8B\x8C\xA1\x84\x06\x99\x00\x85\xC0\x75\x05\xB8\x83\x01\x6b\x00"
mask ( xxxxxxxxxxxxxxxxx )
now we want to change the .. "probbably changing values" to unknowns '?'
"probbably changing values" because they can be changed next patch
that would be :
Code:
\xA1 \x84 \x06 \x99 \x00 dword_990684 (yes, current minimapzonetext address)
and, but not sure about this as i'm still learning :P
Code:
\x75 \x05 short loc_423961
\xB8 \x83 \x01 \x6B \x00 offset unk_6B0183
that would make
pattern :"\x55\x8B\x8C\xA1\x84\x06\x99\x00\x85\xC0\x75\x05\xB8\x83\x01\x6b\x00"
mask ( xxxxxxxxxxxxxxxxx )
to
pattern : "\x55\x8B\x8C_____\x85\xC0_______"
mask (xxx?????xx???????)
now this address is probbably to small, but, lets say, if we'd use FindPattern()
we'll find a value...
if we'd look for "dword_990684 "
that would be [the FindPattern value + 3], why +3 ..
FindPatter returns the first byte location, but the dword starts 3 bytes from there:
(\x55\x8B\x8C) -> start \xA1\x84\x06\x99\x00 <- end (\x85\xC0\x75\x05\xB8\x83\x01\x6b\x00)
can anyone verify if this is the correct way to get patterns? :P
I'll verify if this works when i get home, can't do it at work as I don't have WoW here nor my code :P