gpt4 book ai didi

write long hex to registry c#(将长十六进制写入注册表c#)

转载 作者:bug小助手 更新时间:2023-10-26 20:19:55 25 4
gpt4 key购买 nike



i want to write long hex to registry:

我要将长十六进制写入注册表:


[HKEY_CURRENT_USER\System\GameConfigStore]
"Win32_AutoGameModeDefaultProfile"=hex:02,00,01,00,00,00,c4,20,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00
"Win32_GameModeRelatedProcesses"=hex:01,00,01,00,01,00,67,00,61,00,6d,00,65,00,\
70,00,61,00,6e,00,65,00,6c,00,2e,00,65,00,78,00,65,00,00,00,c9,00,4e,95,67,\
77,b0,eb,1e,03,d8,f1,1e,03,1e,00,00,00,b0,eb,1e,03,1e,00,00,00,0f,00,00,00,\
2c,ea,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00

i know how to write hex but not long:

我知道如何写十六进制,但时间不长:


Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile", "NetworkThrottlingIndex", 0xFFFFFFFF, RegistryValueKind.QWord);

how to write above long hex to registry in c#.

如何写以上长十六进制注册表在c#.


how to write above long hex to registry in c#.

如何在C#中将长十六进制以上的内容写入注册表。


更多回答

Try a byte[] array maybe??

也许可以试试byte[]数组??

In your case, you want to write a QWord (64-bit integer) value. You can convert your hexadecimal value to a ulong and then use Registry.SetValue

在本例中,您希望编写一个QWord(64位整数)值。您可以将十六进制值转换为ulong,然后使用Registry.SetValue

can you give an example

你能举个例子吗?

Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\.......", "SomeValue", yourByteArray, RegistryValueKind.Binary);

Registry.SetValue(@“HKEY_MACHINE\SOFTWARE\.......“,“SomeValue”,yourByteArray,RegistryValueKind.Binary);

thanks for example , but i mean how to convert that long hex to byte[]?

例如,谢谢,但我的意思是如何将那个长十六进制转换为byte[]?

优秀答案推荐

the long hex text already in hex i donot need to convert it , i need to prefix each number with 0x like this

已经是十六进制的长十六进制文本我不需要转换它,我需要像这样给每个数字加上0x前缀


byte[] b = { 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc4, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

then write to registry as binary

然后以二进制形式写入注册表


Registry.SetValue(@"HKEY_CURRENT_USER\System\GameConfigStore", "Win32_AutoGameModeDefaultProfile", b, RegistryValueKind.Binary);

this was worked for me

这对我很管用


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com