Search found 12 matches
- Fri Aug 01, 2025 11:58 pm
- Forum: Windows
- Topic: [Solved]How to call WinApi function to change the owner of a registry key
- Replies: 2
- Views: 1349
Re: How to call WinApi function to change the owner of a registry key
Can you give some examples?
- Fri Aug 01, 2025 12:41 pm
- Forum: Windows
- Topic: [Solved]How to call WinApi function to change the owner of a registry key
- Replies: 2
- Views: 1349
[Solved]How to call WinApi function to change the owner of a registry key
How do I call the SetNamedSecurityInfo_ function to change the owner of a registry key to SYSTEM?
Solved
Example
EnableExplicit
#SE_REGISTRY_KEY = $4
#OWNER_SECURITY_INFORMATION = $1
Define SECURITY_NT_AUTHORITY.SID_IDENTIFIER_AUTHORITY, *pSid, tmp.i
SECURITY_NT_AUTHORITY\Value[5] = 5
If ...
Solved
Example
EnableExplicit
#SE_REGISTRY_KEY = $4
#OWNER_SECURITY_INFORMATION = $1
Define SECURITY_NT_AUTHORITY.SID_IDENTIFIER_AUTHORITY, *pSid, tmp.i
SECURITY_NT_AUTHORITY\Value[5] = 5
If ...
- Thu Jun 27, 2024 12:27 pm
- Forum: Windows
- Topic: Check whether a computer uses BIOS or UEFI
- Replies: 10
- Views: 6428
Re: Check whether a computer uses BIOS or UEFI
The GetFirmwareType function is only available in version NT6.2 and higher
- Thu Jun 27, 2024 10:20 am
- Forum: Windows
- Topic: Check whether a computer uses BIOS or UEFI
- Replies: 10
- Views: 6428
Re: Check whether a computer uses BIOS or UEFI
Not working.
my PC: Win10 Pro 64-bit, run on a MBR System Disk (this is Legacy Windows Environment).
(my MainBoard have support EFI Booting in BIOS Setup).
But, this code return #True.
Please fix code.
Try it
#SystemBootEnvironmentInformation = $5A
Structure _SYSTEM_BOOT_ENVIRONMENT ...
- Sun Feb 04, 2024 2:42 am
- Forum: Coding Questions
- Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
- Replies: 7
- Views: 977
Re: Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
The value of the "Count" variable seems to be the number of entries, not the memory size.
And some variable types are incorrect.
Run it as an administrator.
EnableExplicit
Structure BootOrder
BootOrderList.l[128]
EndStructure
Prototype.l ProtoNtQueryBootEntryOrder(*Ids, *Count)
Global ...
- Sat Feb 03, 2024 2:45 pm
- Forum: Coding Questions
- Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
- Replies: 7
- Views: 977
Re: Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
Windows 8.1 x64 And PureBasic 6.04 LTS x64
- Sat Feb 03, 2024 1:50 pm
- Forum: Coding Questions
- Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
- Replies: 7
- Views: 977
Re: Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
After correcting it to tmp.i, the result is still the same
- Sat Feb 03, 2024 1:03 pm
- Forum: Coding Questions
- Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
- Replies: 7
- Views: 977
[solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
EnableExplicit
Structure BootOrder
BootOrderList.l[128]
EndStructure
Prototype.l ProtoNtQueryBootEntryOrder(Ids.l, Count.l)
Global NtQueryBootEntryOrder.ProtoNtQueryBootEntryOrder
If OpenLibrary(0, "ntdll.dll")
NtQueryBootEntryOrder = GetFunction(0, "NtQueryBootEntryOrder")
EndIf
Procedure ...
Structure BootOrder
BootOrderList.l[128]
EndStructure
Prototype.l ProtoNtQueryBootEntryOrder(Ids.l, Count.l)
Global NtQueryBootEntryOrder.ProtoNtQueryBootEntryOrder
If OpenLibrary(0, "ntdll.dll")
NtQueryBootEntryOrder = GetFunction(0, "NtQueryBootEntryOrder")
EndIf
Procedure ...
- Sat Jan 06, 2024 1:06 pm
- Forum: Coding Questions
- Topic: [solved] How to get a string from an element of data type unicode in a structure
- Replies: 9
- Views: 1627
Re: How to get a string from an element of data type unicode in a structure
Is used as a normal string.
But don't know what the API call looks like. Please provide a description
Structure BootOrder Align #PB_Structure_AlignC
BootOrderList.s{128}
EndStructure
Define api_dummy.BootOrder
api_dummy\BootOrderList = "xyz"
r1.s = api_dummy\BootOrderList
Debug r1 ...
- Sat Jan 06, 2024 12:17 pm
- Forum: Coding Questions
- Topic: [solved] How to get a string from an element of data type unicode in a structure
- Replies: 9
- Views: 1627
Re: How to get a string from an element of data type unicode in a structure
Can you give a full example? Thanks,Fred wrote: Sat Jan 06, 2024 11:34 am For this case, you can also use fixed strings to use it directly:
Code: Select all
Structure BootOrder Align #PB_Structure_AlignC BootOrderList.s{128} EndStructure
- Sat Jan 06, 2024 11:14 am
- Forum: Coding Questions
- Topic: [solved] How to get a string from an element of data type unicode in a structure
- Replies: 9
- Views: 1627
Re: How to get a string from an element of data type unicode in a structure
Solved! Thanks for your help!infratec wrote: Sat Jan 06, 2024 10:32 am I would use:Code: Select all
PeekS(@EFILoadOption\Description[0])
- Sat Jan 06, 2024 7:05 am
- Forum: Coding Questions
- Topic: [solved] How to get a string from an element of data type unicode in a structure
- Replies: 9
- Views: 1627
[solved] How to get a string from an element of data type unicode in a structure
Hello everyone!
I've tried enumerating the UEFI startup entries with the following code:
EnableExplicit
Structure BootOrder Align #PB_Structure_AlignC
BootOrderList.w[128]
EndStructure
Structure _EFI_LOAD_OPTION Align #PB_Structure_AlignC
Attributes.l
FilePathListLength.w
Description.u[256 ...
I've tried enumerating the UEFI startup entries with the following code:
EnableExplicit
Structure BootOrder Align #PB_Structure_AlignC
BootOrderList.w[128]
EndStructure
Structure _EFI_LOAD_OPTION Align #PB_Structure_AlignC
Attributes.l
FilePathListLength.w
Description.u[256 ...