Skip to content
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

MSR_LSTAR syscall hook issue with parameters #6

Open
ingame1128 opened this issue Sep 21, 2016 · 8 comments
Open

MSR_LSTAR syscall hook issue with parameters #6

ingame1128 opened this issue Sep 21, 2016 · 8 comments
Labels

Comments

@ingame1128
Copy link

So I mentioned this already in private but when you try hooking for example ZwQueryVirtualMemory which has more than 4 parameters (after RCX, RDX, R8, R9) aka some on the stack like the 5th and 6th for example, those parameters will be invalid in the hook and therefore the original call of the syscall will usually fail and screw the whole operating system up.

Testing done on windows 8.1, compiled with Visual Studio 2013 using MSR_LSTAR hooking method.

@ingame1128
Copy link
Author

Alright so I managed to fix the issue. The problem was that the KiSystemCall64 emulator was missing some crucial code from KiSystemServiceCopyStart which will copy all the arguments from the stack. Furthermore the way this is done is obvious when looking at the code in ntoskrnl.exe or when debugging the current broken one step by step. Another thing to note is that the ArgTble[ssdt_index] should be the number of parameters passed to the stack and not the whole number of parameters of the function.

Thats that!

@DarthTon
Copy link
Owner

Maybe you can make a pull request then?

@DarthTon DarthTon added the bug label Sep 23, 2016
@ingame1128
Copy link
Author

I will see what I can do I am 2 lazy at the moment and am just messing with this.

@Maffelz
Copy link

Maffelz commented Oct 8, 2016

Kolo, what about stop copy and pasting for your iwebz cheat?

Edit: that's what you get ;)

@rohaaan
Copy link

rohaaan commented Apr 7, 2017

Hi,

Any further updates??

@rohaaan
Copy link

rohaaan commented Apr 7, 2017

Lets work it out and resolve the issue...

@rohaaan
Copy link

rohaaan commented Apr 7, 2017

where should the code of KiSystemServiceCopyStart be added in the KiSystemCall64_emulate function??

@RangeMachine
Copy link

RangeMachine commented Nov 14, 2017

@DarthTon, your jmp actually points to
https://hastebin.com/ezijuqunaz.css

To fix this you need instead jump to
https://hastebin.com/uhegubamiq.css
Screenshot
\x48\x89\x45\xB0\x48\x89\x4D\xB8\x48\x89\x55\xC0\x49

It will parse arguments currectly.

Also too pass arguements counter into function you can use that:
LONG argumentsCount = (LONG)(((PLONG)g_pSSDT->ServiceTableBase)[index]) & 0xF; InterlockedExchange8(&g_arguments[index], (CHAR)argumentsCount);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants