![]() |
|
|
#9 |
|
Архивный участник
Join Date: Jun 2005
Posts: 258
|
So another interesting problem to solve is checking the amount of ANY item in your inventory. There is a function called GetTotalCount but I don't think it's used for anything other than to check when you die and drop an item. The npc server has ownitemcount, but theres no way to call that from the dll.
So what about modifying GetAdenaAmount to check for an item specified by you, rather than just checking for adena? Here's where it does the check: 0048503D |. 8378 1C 39 |CMP DWORD PTR DS:[EAX+1C],39 First thing that came to mind was oh I'll just hook that line and change 39 to whatever item I want to check for .. Problem there is that it's only a byte and you may want to check for items that are larger than one byte. So we can't overwrite that address with a value thats larger than a byte. Ok, so what about hooking that address and then redirecting to a function written in the dll that will call another function elsewhere that does nothing more than use that same line except with a comparison of an integer rather than just a byte, then return. After that it could be re-written to what it was before the call. The OTHER interesting problem is if you were to overwrite the comparison to adena, what happens if another person is doing something in game that needs to check their adena and they do it at the same time you triggered it? Say I wanted to compare how many animal bones I had in inventory. Well theoretically it would overwrite 39 with the hex id of animal bone and then the other person would get an error saying he doesn't have enough adena because its checking for animal bones instead lol Anyway, just thinking out loud. |
|
|
|
|