-
Notifications
You must be signed in to change notification settings - Fork 76
Change RDI so that the loader function can be specified by name or ordinal #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is exactly what the rest of the RDI code had done for years when
testing for ordinals. I just ported it to this over to this function
because it was the one point it hadn't been implemented!
…On Sat, 20 Jun 2020, 07:59 Spencer McIntyre, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In inject/src/LoadLibraryR.c
<#9 (comment)>
:
>
+ // test if we are importing by name or by ordinal...
+ if (((DWORD)cpReflectiveLoaderName & 0xFFFF0000) == 0x00000000)
This sort of looks a little fragile, especially for 64-bit systems. Would
it be possible to make the interpretation of ordinal vs name more explicit?
If not at least comparing a QWORD value with 0xffffffffffff0000 on 64-bit
systems would help reduce the risk of a misinterpretation. I know it has to
be passed around so ByOrdinal and ByName suffixes would probably be a
pain to write, but what about using a struct?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHBYBKXA7LBXF3GBHTUHDRXPNSTANCNFSM4ND5GZHQ>
.
|
|
||
// test if we are importing by name or by ordinal... | ||
if ((((DWORD_PTR)cpReflectiveLoaderName) >> 16) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on Slack @smcintyre-r7 @bcook-r7 👍 Thanks!
I tested this with the corresponding metasploit-payloads PR. The payloads are loading and it looks like the functionality that this introduces is solid and working as intended. I'll have this merged momentarily before moving on to some more indepth testing on the payloads side of things. Thanks @OJ ! |
Thank you! |
With the goal of removing more and more recognisable stuff from the DLLs, I've modified the code to allow the user to specify the name or ordinal of the ReflectiveLoader.
This means that:
ReflectiveLoader
from the DLL images we produce, and load functions based on ordinalsClearly this breaks back compat, so it might need to be rolled into all the other things that we've done.
This relates to: