Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Check if process is UWP app?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ircdirk
How do I cheat?
Reputation: 0

Joined: 07 Apr 2009
Posts: 4

PostPosted: Tue Nov 09, 2021 5:57 am    Post subject: Check if process is UWP app? Reply with quote

Is it possible to check if selected process is UWP app trough Lua Scripting?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Tue Nov 09, 2021 9:12 pm    Post subject: Reply with quote

Windows offers a means of requesting a UWP package name via:
https://docs.microsoft.com/en-us/windows/win32/api/appmodel/nf-appmodel-getpackagefamilyname

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ircdirk
How do I cheat?
Reputation: 0

Joined: 07 Apr 2009
Posts: 4

PostPosted: Wed Nov 10, 2021 7:44 am    Post subject: Reply with quote

So im doing someting like this:

Code:
local proc = executeCodeLocalEx('OpenProcess', 0x1000, 0, 18320)
local _need=createMemoryStream()
_need.writeDword(0)
local _drivername=createMemoryStream()
_drivername.size=255*10
print(executeCodeLocalEx('GetPackageFamilyName', proc, _need.Memory, _drivername.Memory))
print(readStringLocal(_drivername.Memory,255*10))


But im gettin error 122 ERROR_INSUFFICIENT_BUFFER.

Could someone point me to what i'm doing wrong? Please.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed Nov 10, 2021 8:54 am    Post subject: Reply with quote

try _need.writeDword(255)

also, you can use getOpenedProcessHandle() to get the handle to the currently opened process

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ircdirk
How do I cheat?
Reputation: 0

Joined: 07 Apr 2009
Posts: 4

PostPosted: Wed Nov 10, 2021 11:46 am    Post subject: Reply with quote

Dark Byte wrote:
try _need.writeDword(255)

also, you can use getOpenedProcessHandle() to get the handle to the currently opened process


Thank u, that worked. But it only reads the first letter not the whole string Sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed Nov 10, 2021 12:25 pm    Post subject: Reply with quote

try setting the 3th parameter of readstringlocal to true so it's handled as widestring
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ircdirk
How do I cheat?
Reputation: 0

Joined: 07 Apr 2009
Posts: 4

PostPosted: Wed Nov 10, 2021 1:06 pm    Post subject: Reply with quote

Dark Byte wrote:
try setting the 3th parameter of readstringlocal to true so it's handled as widestring


Nope, setting it to true makes it empty string in return. In documentation of GetPackageFamilyName its PWSTR


My bad, u wrote third argument. All good. Thanks a lot, it works! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites