	TrainerEngine PROTO :DWORD, :DWORD, :DWORD, :DWORD, :DWORD

.Data
	; ### Trainer Engine Variables Below ###
		WindHand dd ?		; Used For Window Handle
		pHandle dd ?		; Used For Window Process
		PID dd ?		; Used For Process ID
		dProtect dd 00		; Used For VirtualProtectEX
	; ### Trainer Engine Variables Above ###


	; ### Termination Variable Below ###
		Exit dd ?
	; ### Termination Variable Above ###

.Code

	TrainerEngine PROC Class:DWORD, Window:DWORD, Address:DWORD, Value:DWORD, Bytes:DWORD

		Invoke FindWindow, Class, Window
		.If eax != NULL
			MOV WindHand, EAX
			Invoke GetWindowThreadProcessId, WindHand, offset PID
			Invoke OpenProcess, PROCESS_ALL_ACCESS,NULL, PID
			MOV pHandle, EAX

			Invoke VirtualProtectEx, pHandle, Address, Bytes, PAGE_EXECUTE_READWRITE, Offset dProtect
			Invoke WriteProcessMemory, pHandle, Address, Value, Bytes, NULL

			Invoke CloseHandle, pHandle

			MOV EAX, 1
			RET
		.Endif

		MOV EAX, NULL
		RET

	TrainerEngine ENDP