Jump to content
Returning Members: Password Reset Required ×

Recommended Posts

Posted (edited)

Simple find pattern:
 

uintptr_t findPattern(uintptr_t start, size_t length, const std::vector<int>& pattern)
{
	auto patternLength = pattern.size();
	auto data = reinterpret_cast<const uint8_t*>(start);
	for (size_t i = 0; i <= length - patternLength; ++i)
	{
		bool found = true;
		for (size_t j = 0; j < patternLength; ++j)
		{
			if (pattern[j] != -1 && pattern[j] != data[i + j])
			{
				found = false;
				break;
			}
		}

		if (found)
		{
			return start + i;
		}
	}
	return 0;
}

Then get the base:

auto d3d9Module = reinterpret_cast<uintptr_t>(GetModuleHandleA("d3d9.dll"));
std::vector<int> pattern = { 0xC7, 0x06, -1, -1, -1, -1, 0x89, 0x86, -1, -1, -1, -1, 0x89, 0x86 };
auto d3dBase = findPattern(d3d9Module, 0x128000, pattern);
auto d3dVMT = *reinterpret_cast<uintptr_t**>(d3dBase + 2);

And you can use it normally:

oDrawIndexedPrimitive = reinterpret_cast<tDrawIndexedPrimitive>(d3dVMT[82]);
oEndScene = reinterpret_cast<tEndScene>(d3dVMT[42]);
oReset = reinterpret_cast<tReset>(d3dVMT[16]);

Check out d3d9 indexes here: https://pastebin.com/raw/QbPhkCKh

Note: you'll need to grab d3d9 Device from EndScene

You can use this to properly render imgui🧉

 

- Check out how DrawIndexedPrimitive could be implemented: DIP-Hook

Edited by duki
DIP
  • 1 month later...
Posted
On 8/12/2025 at 4:14 PM, duki said:

Simple find pattern:  简单查找模式:
 

uintptr_t findPattern(uintptr_t start, size_t length, const std::vector<int>& pattern)
{
	auto patternLength = pattern.size();
	auto data = reinterpret_cast<const uint8_t*>(start);
	for (size_t i = 0; i <= length - patternLength; ++i)
	{
		bool found = true;
		for (size_t j = 0; j < patternLength; ++j)
		{
			if (pattern[j] != -1 && pattern[j] != data[i + j])
			{
				found = false;
				break;
			}
		}

		if (found)
		{
			return start + i;
		}
	}
	return 0;
}

Then get the base:
然后获取基础:

auto d3d9Module = reinterpret_cast<uintptr_t>(GetModuleHandleA("d3d9.dll"));
std::vector<int> pattern = { 0xC7, 0x06, -1, -1, -1, -1, 0x89, 0x86, -1, -1, -1, -1, 0x89, 0x86 };
auto d3dBase = findPattern(d3d9Module, 0x128000, pattern);
auto d3dVMT = *reinterpret_cast<uintptr_t**>(d3dBase + 2);

And you can use it normally:
你可以正常使用它:

oDrawIndexedPrimitive = reinterpret_cast<tDrawIndexedPrimitive>(d3dVMT[82]);
oEndScene = reinterpret_cast<tEndScene>(d3dVMT[42]);
oReset = reinterpret_cast<tReset>(d3dVMT[16]);

Check out d3d9 indexes here: https://pastebin.com/raw/QbPhkCKh
d3d9 索引请查看这里:https://pastebin.com/raw/QbPhkCKh

Note: you'll need to grab d3d9 Device from EndScene
注意:你需要从 EndScene 获取 d3d9 Device

You can use this to properly render imgui🧉
你可以用它来正确渲染 imgui。 🧉

 

- Check out how DrawIndexedPrimitive could be implemented: DIP-Hook
- 查看 DrawIndexedPrimitive 如何实现:DIP-Hook

hi,I tried to do the same thing in version 5517, but it doesn't seem to have much effect. Is it because the wild chicken's model ID is different?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...