Code Monkey home page Code Monkey logo

ntuserinjectmouseinput-syscall's Introduction

NtUserInjectMouseInput-syscall

Not mine. Only for saving.

BYTE NtUserSendInput_Bytes[30];
BOOL MouseClass::LoadMouse()
{
	
	LoadLibrary(xorstr("user32.dll").c_str());
	HMODULE win32u = LoadLibrary(xorstr("win32u.dll").c_str());
	if (!win32u) return FALSE;
 
	// xor
	void* NtUserInjectMouseInput_Addr = (void*)GetProcAddress(win32u, xorstr("NtUserInjectMouseInput").c_str());
	if (!NtUserInjectMouseInput_Addr)	return FALSE;
 
	//*(void**)&NtUserInjectMouseInput = NtUserInjectMouseInputAddress; *For just using straight function*
	memcpy(NtUserSendInput_Bytes, NtUserInjectMouseInput_Addr, 30);
	return TRUE;
}
 
 
BOOLEAN WINAPI InjectMouseInputSpoof(mouse::InjectedInputMouseInfo* Struct, int Value)
{
	LPVOID NtUserInjectMouseInput_Spoof = VirtualAlloc(0, 0x1000, MEM_COMMIT, PAGE_EXECUTE_READWRITE); // allocate space for syscall
	if (!NtUserInjectMouseInput_Spoof) return FALSE;
	memcpy(NtUserInjectMouseInput_Spoof, NtUserSendInput_Bytes, 30); // copy syscall
	NTSTATUS Result = reinterpret_cast<NTSTATUS(NTAPI*)(mouse::InjectedInputMouseInfo*, int)>(NtUserInjectMouseInput_Spoof)(Struct, Value); // calling spoofed function
	SecureZeroMemory(NtUserInjectMouseInput_Spoof, 0x1000); // clean address
	VirtualFree(NtUserInjectMouseInput_Spoof, 0, MEM_RELEASE); // free it
	return (Result > 0); // return the status
}

https://www.unknowncheats.me/forum/anti-cheat-bypass/511819-move-mouse.html

ntuserinjectmouseinput-syscall's People

Contributors

gmh5225 avatar

Stargazers

 avatar Jujudo avatar Ezequiel Haley avatar nice_sprite avatar  avatar KK avatar

Watchers

 avatar  avatar KK avatar

Forkers

imkk666

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.