how to get the right address to hook

09/19/2021 19:10 kotsh23#1
Hello guys

i'm new at c++ i check florine dev kit util.cpp
i found this

Code:
 replaceOffset(0x00682AFC, addr_from_this(&CIFItemComparison::AppendAdvancedInfo)); // set
replaceOffset(0x00682D6E, addr_from_this(&CIFItemComparison::AppendAdvancedInfo)); // accs
replaceOffset(0x00682FBE, addr_from_this(&CIFItemComparison::AppendAdvancedInfo)); // wep
replaceOffset(0x0068320E, addr_from_this(&CIFItemComparison::AppendAdvancedInfo)); // shield
i want the same thing for other items like avatars

how to get the address like 0x00682AFC
for avatars

i tried to debug and tried to hook this address 0x006825BB

but game crashing when i hover on avatar thank you
09/20/2021 09:10 JellyBitz#2
I barely knows ASM but I was able to find the cause about it because at my point of view, it was the places where that popup window could be shown, not because item type so there was my curiosity about it.

Then I start tracking up the calls to these functions.
I find out after comparing some registers that everything starts at 0x00686CC7, it is some sort switch/case if you look into the assembly. I end up placing hooks on these root cases and looked like this:

Util.cpp

CIFSlotWithHelp.h

CIFSlotWithHelp.cpp

Having this setup, we're able to filter the item type and add text at start, or at the end from popup window. Or even deeper, overwrite all to our preference.

Here is a quick example to know how to filter item types through the item type ID.
09/20/2021 10:38 pushedx#3
Quote:
Originally Posted by kotsh23 View Post
i want the same thing for other items like avatars

how to get the address like 0x00682AFC
for avatars

i tried to debug and tried to hook this address 0x006825BB

but game crashing when i hover on avatar thank you
Ok, your question in my thread makes sense now. I didn't see you had a thread asking about this.

Are you using this release: [Only registered and activated users can see links. Click Here To Register...]?

I can't find the code you posted in vanilla SRO_DevKit, but maybe I'm on the wrong branch. Anyways, I just checked into this real fast, and it looks like you're close, but just grabbed the wrong address.

First, if you look at the 4 addresses referenced:

Notice how the code looks. When you go to the address you posted, 0x006825BB, it does not look like those, so that's why it crashes (but you already know you have the wrong address).

To find the right address, first, you need to trace up one level to see what calls the 4 existing known functions. You have to scroll up quite a ways to find the start of the function, and then check what code references it. So for example, CTRL + G to 0x00682D6E (accessory). Scroll all the way to the top of the function (00682BA0). Then hit X on that line and choose the call reference that pops up.

In this case, it's pretty simple, it's a switch statement that calls a function based on the slot type.


Highlighted is where we land for the accessory, so if we check the logic (I have a few labels placed), you would then just breakpoint on the switch selector to figure out what value gets passed when you hover over an avatar slot, follow the function (which you did already), and then find the function that "visually" looks like the other 4 (this is the part you missed).

Scroll down more in the function you found to address 0x682735 and look at the code vs the other 4.

See how it visually looks the same? I'd venture a guess that'd be the address of the function you want to hook like the others, so give that a try. If it doesn't work, then you'll have to do some more digging, but just glancing at the code, I think this is the relevant address.
09/20/2021 12:42 kotsh23#4
Quote:
Originally Posted by JellyBitz View Post
I barely knows ASM but I was able to find the cause about it because at my point of view, it was the places where that popup window could be shown, not because item type so there was my curiosity about it.

Then I start tracking up the calls to these functions.
I find out after comparing some registers that everything starts at 0x00686CC7, it is some sort switch/case if you look into the assembly. I end up placing hooks on these root cases and looked like this:

Util.cpp

CIFSlotWithHelp.h

CIFSlotWithHelp.cpp

Having this setup, we're able to filter the item type and add text at start, or at the end from popup window. Or even deeper, overwrite all to our preference.

Here is a quick example to know how to filter item types through the item type ID.


Thank you boss
i tried with CIFSlotWithHelp but didnt work for me
but i used your code and your address with new class worked fine

thank you again
[Only registered and activated users can see links. Click Here To Register...]

Quote:
Originally Posted by pushedx View Post
Ok, your question in my thread makes sense now. I didn't see you had a thread asking about this.

Are you using this release: [Only registered and activated users can see links. Click Here To Register...]?

I can't find the code you posted in vanilla SRO_DevKit, but maybe I'm on the wrong branch. Anyways, I just checked into this real fast, and it looks like you're close, but just grabbed the wrong address.

First, if you look at the 4 addresses referenced:

Notice how the code looks. When you go to the address you posted, 0x006825BB, it does not look like those, so that's why it crashes (but you already know you have the wrong address).

To find the right address, first, you need to trace up one level to see what calls the 4 existing known functions. You have to scroll up quite a ways to find the start of the function, and then check what code references it. So for example, CTRL + G to 0x00682D6E (accessory). Scroll all the way to the top of the function (00682BA0). Then hit X on that line and choose the call reference that pops up.

In this case, it's pretty simple, it's a switch statement that calls a function based on the slot type.


Highlighted is where we land for the accessory, so if we check the logic (I have a few labels placed), you would then just breakpoint on the switch selector to figure out what value gets passed when you hover over an avatar slot, follow the function (which you did already), and then find the function that "visually" looks like the other 4 (this is the part you missed).

Scroll down more in the function you found to address 0x682735 and look at the code vs the other 4.

See how it visually looks the same? I'd venture a guess that'd be the address of the function you want to hook like the others, so give that a try. If it doesn't work, then you'll have to do some more digging, but just glancing at the code, I think this is the relevant address.

man you really great thank you none wanted to tell me how to debug all say i have no clue or no idea like mr #Laag :D
but you really a good person i hope you get nice life and good health