Skip to content

Conversation

rexyrexy
Copy link
Contributor

Tested for VMProtect 3.9.2 (latest)

Fix for #85

@mrexodia
Copy link
Owner

Do you have a sample that triggers the detection?

@rexyrexy
Copy link
Contributor Author

uint64_t result[] = { 0x0, 0x1122334455667788 };
uint64_t* result_addr = (uint64_t*)(((PBYTE)&result) + 1);
const auto status = NtQueryInformationProcess(NtCurrentProcess(), PROCESSINFOCLASS::ProcessDebugObjectHandle, result_addr, sizeof(uint64_t), nullptr);

// No Debugging: STATUS_DATATYPE_MISALIGNMENT - 8800000000000000
// With TitanHide: STATUS_PORT_NOT_SET - 0
printf("[ATTEMPT] - Status: %x - Result: %llx\n", status, *result_addr);

image

Sample:
TestMisalignment.zip

@mrexodia
Copy link
Owner

No I mean an actual VMProtected sample that shows this issue

@rexyrexy
Copy link
Contributor Author

If you able to provide me an email address, I can.

@mrexodia
Copy link
Owner

mrexodia () x64dbg.com

@rexyrexy
Copy link
Contributor Author

I sent.

@rexyrexy
Copy link
Contributor Author

Have you tested the sample?

@mrexodia
Copy link
Owner

mrexodia commented Dec 25, 2024 via email

@rexyrexy
Copy link
Contributor Author

I have updated commit, should be working now for 32/64 bit targets.

@mrexodia
Copy link
Owner

Wouldn’t this open another detection vector when you set the PHANDLE to page_end-4 (with the next page being inaccessible)?

@rexyrexy
Copy link
Contributor Author

Does the alignment parameter in ProbeForWrite have any impact on page boundary?

@mrexodia
Copy link
Owner

Ah my bad, I read the code incorrectly 🤦🏻‍♂️ does the original NtQueryProcessInformation also check with an alignment of 4?

@rexyrexy
Copy link
Contributor Author

rexyrexy commented Jan 29, 2025

I didn't debug ntoskrnl, but pseudocode for NtQueryInformationProcess seems like do
image

Also NtSetInformationDebugObject checks for alignment 4
image

@mrexodia
Copy link
Owner

Awesome, thanks for checking and for bearing with the delays 😅

I'll fix the github actions pipeline and release a new version later this week (hopefully).

@mrexodia mrexodia merged commit 4c7cb49 into mrexodia:master Jan 29, 2025
1 check failed
@rexyrexy rexyrexy deleted the patch-1 branch May 4, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants