Extract information from external SOFTWARE registry file [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 28 days ago.
Improve this question
I have to extract some information from SOFTWARE registry file. Like the existing in "/windows/system32/config" but totally independent of current OS
Official Microsoft doc suggests some predefined keys (HKLM, HKCU, etc.) but it looks like there is no opportunity to choose external OS-independent files. RegConnectRegistry() is not the way either because I just have a single SOFTWARE file. Any ideas? I know it is possible because Nirsoft package has such functionality.

If I understand you correctly, by "independent of current OS", I think you do not mean it needs to be platform-independent. You just want to open a registry contained in a file that was manually copied from some other machine's "C:\Windows\System32\config\SOFTWARE" file, and use it similarly to how in RegEdit, you could select the HKLM hive and then from the File menu select "Load Hiveā€¦" and then select that file you have at hand. In other words, you want to connect not to the live registry on any particular machine, but just to a file.
In that case, I believe the Offline Registry Library is what you are looking for. Its OROpenHive function loads the specified file into memory for further use via its other functions.

Related

How to create an installer with InnoSetup running in only one computer to prevent unauthorized copy [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am using Innosetup to create an installer for my application (test.exe using Qt creator). I need that my application should be running on only one machine (unauthorized copies in other computer). I don't know how to make a function in Innosetup to identify if the address IP corresponds to the authorized machine or not. Else it should not run my application.
If you are looking for an solution for anti-copy the application, you can read the SID of the PC installed, store the SID in your application. Every time your application launches, the first step is to read the SID, then compare to the initial SID, if not match, exit your application.

C++ generated csv vs Open Office export [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've finished a little application in c++ that parses a table of ~15k records into a .csv file.
The problem I'm having is that a third-party application that's supposed to use this file as source (Magmi) won't recognize the fields from my generated csv. However, if I simply open the same file with Open Office Calc and export it again as a .csv, it works perfectly fine with no other changes whatsoever.
I initially thought this might be a windows CR/LF issue, so I recompiled the application on linux and checked with notepad++ to make sure there's no surplus CR in there, and there isn't. All the line endings are LF.
Can someone please give me a hint as to what am I missing?
Thanks
It turns out it was a permissions issue that was causing the problem. Since my dev. environment is set on a VM, I was copying the output file into the import folder (never really though to see if the permissions were the cause). The ownership remained with the original user the file originated from, causing it to work when it was exported from Open Office, but failing when I tried to use the original one.
Thanks all.

Simple webserver for c++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
My c++ server-app needs to have a port 80 open to output some json
(for other web-apps to see the status)
I saw a few web-server that i can spwan from a c++ class, but they seem rather complicated. I don't need any request/response, just a string that i time by time update and that is shown on port 80 then.
My server-app is running in a loop, so i guess this should be a thread that gets the string update every here and then. Please point me in the right direction is i am totally wrong in my planning/thinking.
The simplest solution would probably be to use a webserver to serve a static file and having your application to update the content when needed.
Just pay attention on the configuration of the server to inform the clients that the content should not be cached.
Another somewhat important part is to create a new file and move it to the destination (published) location once the file is complete (to avoid clients to download a partial file that could be invalid).
You could use some HTTP server library like libonion (or perhaps Wt or libmicrohttpd) within your C++ application.
Notice that libonion usually runs the web service in some other thread, so you need to take care of synchronization (e.g. using mutexes), and is also able to serve static content and static files.

convert partition to vhd windows API [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am trying to code a tool like disk2vhd. I'm using the VHD windows api:
Virtual Disk Functions
The Virtual Disk API In Windows 7
Demo various VHD API usage (CppVhdAPI)
I created a vhd file and created a partition in it, but I don't know how to convert a Windows partition to vhd like disk2vhd creates a vhd using CreateVirtualDisk().
I've tried to copy all items from that partition to my vhd but it does not work.
Please show me how to do that.
I think you should do the following:
Load hard disk's information,
load disk partition,
create a file vhd,
copy partition to vhd.

How to code a new Windows Shell? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How would I go about coding a new Windows Vista Shell?
Everything you need to do as shell has never been documented, so there are some issues with file change notifications etc. The basics are:
SystemParametersInfo(SPI_SETMINIMIZEDMETRICS,...MINIMIZEDMETRICS) with (undocumented?) flag 8
Register as the shell (SetShellWindow,SetProgmanWindow,ShellDDEInit,RegisterShellHook etc)
Hide welcome screen by setting a signal ("msgina: ShellReadyEvent" and "ShellDesktopSwitchEvent")
Start registry run key, start menu\startup and ShellServiceObjects
Set registry Explorer\SessionInfo
The good thing is, you are not the first to write a new shell, if you look around, you can find some obscure required info. Here is a list to get you started:
https://web.archive.org/web/2019/http://www.lsdev.org/doku.php
http://bb4win.cvs.sourceforge.net/bb4win/blackbox/Blackbox.cpp?revision=1.49&view=markup
http://xoblite.net/source/Blackbox.cpp.html
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/
http://www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/explorer/index.htm&tx=36
A good place to start would be investigating how to build a command line parser, something that can tokenize and interpret the inputs. There are tools that can help with this like ANTLR, or you might like to try building your own.
Once you've parsed the inputs you need to decide what actions to take - launching processes, piping between processes, redirecting output - and making those system calls.
If you're just after a more powerful shell rather than interested in building one, give PowerShell a try.