Relative Content

Tag Archive for c++winapi

Can’t open a file using WinAPI

I’m trying to use the createFile and it says it can’t open it (Could not open file (error 2)). I tried to make the fileName the name of the file and the path to it. The file is just a text file with some words in it. I tried to “Verify File Access”, “Testing with a Simplified Path (LPCSTR fileName = "example.txt")”, “Check File Path Syntax (LPCSTR fileName = "C:\Users\YourUsername\Desktop\example.txt")”, “Confirm File Location”, “Confirm Working Directory”.

Can’t open a file using WinAPI

I’m trying to use the createFile and it says it can’t open it (Could not open file (error 2)). I tried to make the fileName the name of the file and the path to it. The file is just a text file with some words in it. I tried to “Verify File Access”, “Testing with a Simplified Path (LPCSTR fileName = "example.txt")”, “Check File Path Syntax (LPCSTR fileName = "C:\Users\YourUsername\Desktop\example.txt")”, “Confirm File Location”, “Confirm Working Directory”.

How to read memory of both x86 and x64 processes as a x86 program?

I have been using the ZwReadVirtualMemory() function to read the memory of different processes. However, I’ve encountered an issue: this function appears to only work if the target process is of the same architecture (i.e., x86 or x64) as the program making the call.

How to read the target of a shortcut file with all its arguments in c++

I attempted to implement the solution from this Stack Overflow answer. However, I am encountering an issue where it only resolves the path to the executable (exe), without including any arguments that may be present. Is there a way to obtain the full “raw” target, including both the executable path and its arguments, rather than just the executable path alone?

Determine if a given process was started from a shortcut

I am asking this question again despite this existing answer, because it is outdated. The RTL_USER_PROCESS_PARAMETERS structure no longer includes a WindowTitle field. I am wondering if a solution which doesn’t require code injection into the target process still exists.