U.N.C.L.E. Posted September 4, 2004 Share Posted September 4, 2004 I have a small binary file. Using the contents of this file I need to create a registry key in binary format. Regedit won't allow paste when creating a new REG_BINARY key. Any other way to do it? Link to comment Share on other sites More sharing options...
0 iShakeel Posted September 4, 2004 Share Posted September 4, 2004 Export any binary key to see how .reg files look likes with binary data. then try to create one with your data. Or better yet program it . Link to comment Share on other sites More sharing options...
0 U.N.C.L.E. Posted September 4, 2004 Author Share Posted September 4, 2004 (edited) I already tried that. It's obviously in hex format. Was trying to save some programming effort. Specifically this reg_binary value is for a digital certificate private key. Maybe there is a utility that can import a private key into a certificate store (a.k.a. a registry key)? BTW: I have pvkimport.exe but. The private key I need to import is from the personal certificate store. Which in Windows XP is stored in the file system and not the registry. Edited September 4, 2004 by U.N.C.L.E. Link to comment Share on other sites More sharing options...
0 bithub Posted September 4, 2004 Share Posted September 4, 2004 Here is how you would do it with C/C++ HKEY hkey; LONG ret; unsigned char binaryData[] = something; ret = RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\myapp\\", 0, KEY_ALL_ACCESS, &hkey); if(ret != ERROR_SUCCESS) return false; ret = RegSetValueEx(hkey,"someKeyName",0,REG_BINARY,binaryData,sizeof(binaryData)); if(ret != ERROR_SUCCESS) return false; return true; Link to comment Share on other sites More sharing options...
Question
U.N.C.L.E.
I have a small binary file. Using the contents of this file I need to create a registry key in binary format.
Regedit won't allow paste when creating a new REG_BINARY key. Any other way to do it?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts