Skip to main content
How are we doing? Please help us improve Stack Overflow. Take our short survey
Filter by
Sorted by
Tagged with
2 votes
2 answers
163 views

Normally, the function SetEnvironmentStringsW can be used to restore a block of environment variables that has been backed up via GetEnvironmentStringsW before. This is a convenient way to experiment ...
Wolf's user avatar
  • 10.3k
0 votes
0 answers
72 views

I have written a simple DLL injector in C++. Now, I want to unload the injected DLL using the unload function shown below. However, when I run the code, the FreeLibrary function returns 0 and the DLL ...
MahdiKarami's user avatar
0 votes
0 answers
117 views

I have the following code: [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SetDllDirectory(string lpPathName); string dllFolderPath= @"C:\temp\lib";...
Leon's user avatar
  • 491
0 votes
0 answers
56 views

My company has recently instituted some significant security upgrades that disallows the calling of Kernel32.dll using VBA. Without this I can't call Application.GetOpenFilename and set the network ...
n8.'s user avatar
  • 1,744
1 vote
1 answer
46 views

I want to write a test which would confirm that my string is successfully printed to console via JNA using WriteFile function. Specs: Windows 11 Home, Version 22H2 Java 22 JNA 5.14.0 Kernel32.java ...
Max Trunnikov's user avatar
1 vote
1 answer
254 views

This seems like it should print the thread ID of the first thread in the snapshot, but it always prints 0. What is wrong with it? The following assumes that process ID 1234 is a real, running process. ...
Utkonos's user avatar
  • 795
1 vote
1 answer
94 views

The following code is supposed to start a new process calc.exe in debug mode. However, it fails with the code 2 or ERROR_FILE_NOT_FOUND. However, this file calc.exe does exist on the system. What ...
Utkonos's user avatar
  • 795
0 votes
0 answers
179 views

I am developing a .NET WebApi Application which is intended to make calls to a Windows dll library. I use kernel32.dll's function LoadLibrary to load the dll. When I run the application on IIS or IIS ...
Sergei Poliakov's user avatar
-1 votes
1 answer
1k views

Getting following error LNK1104 cannot open file 'kernel32.lib', what path do i need to add, and where to add it in Visual Studio 2022. I looked at previous threads, most solutions are for older ...
Doc's user avatar
  • 11
2 votes
2 answers
816 views

How can you capture a DLL's stdout and/or stderr in Python on Windows? For example, this prints "hello" to stderr, but it should be possible to capture the "hello" as a string ...
1'''s user avatar
  • 27.2k
0 votes
1 answer
88 views

I tried to use CreateThread in kernel32 to start a DataCollectorEntry function in new thread but it did not execute any line on the function and the GetLastError return 0 that means everything is ...
Ahmed Jihad's user avatar
0 votes
1 answer
590 views

I'm attempting to work with LibreOffice using .NET Core, but I'm encountering an error that says 'bootstrap Handle is not initialized . using unoidl.com.sun.star.uno; m_xContext = uno.util.Bootstrap....
BilalMr's user avatar
  • 335
1 vote
1 answer
223 views

Have a task to call IsWindows10OrGreater function in asm x86 code. At first, I tried to include it from kernel32 lib, but than I found out that this library doesn't contain IsWindows10OrGreater ...
nzrsvt's user avatar
  • 11
0 votes
0 answers
625 views

I've been trying to get it to work for a while, but I just can't. And looking online there don't seem to be many USB oriented answers for communicating with a printer. The final objective is to ...
Robin's user avatar
  • 1
1 vote
1 answer
572 views

I have a small project that does not depend on the CRT or windows sdk. In order to link against kernel32.dll I created a minimal .def file with only the couple functions I need: LIBRARY kernel32.dll ...
lelgetrekt's user avatar
1 vote
0 answers
974 views

I've been experimenting with ways to obtain the Kernel32.dll base address in C shellcode and came up with the following method. It works on my machine running Windows 11 Pro, but I'm wondering how ...
vengy's user avatar
  • 2,467
0 votes
0 answers
169 views

I am trying to write a stream of data with minimal delay between buffer transfers in VBA. The data may be acquired with maximal 30~35 usec precision in VBA. But because of continuous data stream, I ...
Asdf's user avatar
  • 296
0 votes
0 answers
182 views

I'm running a program in C#, and I want to know the list of JobObjects that are assigned to the current process. Is there a way to do this? To be more specific about my use-case, I'm trying to find ...
Yahav's user avatar
  • 1
0 votes
1 answer
306 views

I'm trying to find the address of the API HeapAlloc in Windbg using the following syntax u Kernel32!HeapAllocStub but windbg cannot resolve that. I have reloded the symbols and the error persist, for ...
Marco Nappi's user avatar
0 votes
1 answer
191 views

I am creating a WPF app where I have to make device to sleep and awake at particular time. I tried to used SetWaitableTimer to do the same but due some mistakes my device is going into sleep but not ...
Nation's user avatar
  • 21
0 votes
0 answers
706 views

I have the following powershell code to dump the process memory from a given process. In this case, cmd.exe. It opens the given process with PROCESS_ALL_ACCESS and uses VirtualQueryEx to list all the ...
meep's user avatar
  • 344
0 votes
1 answer
89 views

i use GetNativeSystemInfo from windows api but when i use structure like microsoft i can not get parameter correctly at the first i use this structure: struct _SYSTEM_INFO { union DUMMYUNIONNAME { ...
ali ansyy's user avatar
1 vote
1 answer
372 views

I have some legacy unmanaged code (unsafe, intptr) which uses VirtualAlloc method from kernel32.dll many times in order to allocate unmanaged intptrs. This code is in a project which was upgraded from ...
Hadar's user avatar
  • 11
0 votes
1 answer
159 views

I'm working through a reverse engineering exercise using olly. 00402D71 |. 6A 00 PUSH 0 ; /hTemplateFile = NULL 00402D73 |. 68 80000000 PUSH 80 ...
user3280964's user avatar
0 votes
1 answer
989 views

We are developing a ASP.NET web application in which we need to access a shared drive and search for a directory, if it is present or not. But while accessing using the PATH the application is showing ...
ipsita mishra's user avatar
0 votes
1 answer
1k views

I was trying to use debugView in Electron for some reason When I use OutputDebugStringW everything I send to output become random char, on the other hand it seems correct when sending output using ...
lizard's user avatar
  • 35
1 vote
0 answers
2k views

I know there are similar questions and tools (1)(2)(3) and many more. Each of these resources in the web states that you need to use Windows NT API and with this it should be easy to change the ...
Steve Wolligandt's user avatar
0 votes
1 answer
234 views

All of the SI fields are 0 after the call to GetSystemInfo in the code below, that's the issue I am trying to solve here. This is about the same code as several examples which can be found with a ...
CTZStef's user avatar
  • 1,715
2 votes
0 answers
1k views

We have .net framework based application which connects with backend using REST API. When we run this application using Wine on Ubuntu 20.04 it works perfectly well. Our requirement is that we need to ...
Shalz's user avatar
  • 29
8 votes
2 answers
4k views

In my file transfer application (WinSCP), I use SetThreadExecutionState(ES_SYSTEM_REQUIRED) to prevent the system from going into sleep mode while a file transfer is in progress. But this does not ...
Martin Prikryl's user avatar
2 votes
1 answer
8k views

I'm running a dotnet webapp in my local (windows machine) and it works just fine. When I deploy the same application to an AKS container and try running it, it fails with System....
user1455116's user avatar
  • 2,184
0 votes
1 answer
131 views

This is a simplification of a problem I encounter. There are 2 process: one that loops over ReplaceFile [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern ...
Zvi Azran's user avatar
  • 141
2 votes
0 answers
623 views

I'm using an external DLL which is written in C++. It's a cURL Wrapper. I do not have access the code, just DLL. //Import kernel32 DLL static class NativeMethods { [DllImport("kernel32.dll&...
Mre Sie's user avatar
  • 31
5 votes
1 answer
3k views

Sorry for the noob question,folks. My new version of Vectorworks CAD 2022 won't run on my Win 7 x64 due to a missing procedure entry point. My laptop is too old to upgrade to Win 10 and I was hoping ...
C_Pietro's user avatar
1 vote
1 answer
3k views

I'm attempting to use low level Windows API's (specifically FindFirstFileW / fileapi.h) in a UWP app for the first time. I have proof of concept code running successfully in a .Net console app, and ...
Adrian K's user avatar
  • 10.4k
0 votes
1 answer
263 views

I'm trying to build a CMake-based C project in VSCodium. When I open the folder, CMake configuration fails, with the error being, apparently: -- snip -- LINK : fatal error LNK1181: cannot open input ...
einpoklum's user avatar
  • 137k
0 votes
1 answer
146 views

I'm having some trouble reading from an arbitrary memory address using Chez Scheme's FFI and the kernel32/user32.dll's ReadProcessMemory function. I got the process handle and everything fine, but I'm ...
ArooBaito's user avatar
0 votes
1 answer
224 views

I'm in the process of upgrading some code from 32 to 64 bit VBA. It uses the InterlockedIncrement function: Private Declare PtrSafe Function InterlockedIncrement Lib "kernel32" (ByRef Addend ...
Greedo's user avatar
  • 5,625
0 votes
0 answers
5k views

I have an angular application for which I have written an URL rewrite on the web.config file. I am publishing my application on IIS 7 (Windows Server 2008). To manage and enable URL Rewrite I want to ...
SageMode27's user avatar
0 votes
0 answers
113 views

I read card SD like file. I use this method: public static int ReadUSBDisk(ref byte[] buffer, int sector, string fileName) { ushort count = 10; bool retValue; int ...
Silny ToJa's user avatar
  • 2,271
0 votes
0 answers
46 views

Question 1: Why declare it as a function and not a sub? When calling a windows API function in Excel VBA such as Private Declare Function getTickCount Lib "kernel32" _ Alias "...
jonadv's user avatar
  • 502
0 votes
1 answer
255 views

I'm want to Create App that just use ntdll and use security check for it. but when I remove kernel32.lib or uncheck "inherit from parent or project defaults" I get link errors when I build ...
aliMahdavi's user avatar
2 votes
3 answers
5k views

I have assembled my assembly program using the following command: nasm -f win64 -o test.obj test.asm test.asm contains a few functions that call Win32 functions like GetStdHandle, HeapAlloc, etc ...
Ark's user avatar
  • 133
0 votes
0 answers
301 views

I'm trying to convert this function from this repository, programmed with the AutoHotKey language. But I ended up stuck in one question: In C# what would the NumPut and VarSetCapacity functions ...
Wagner Rodrigues's user avatar
0 votes
1 answer
201 views

I am working on a UWP app (C#, Visual Studio 2019) and I want to find out the total, free for user and free space of C:. In order to do this, I want to call GetDiskFreeSpaceExA (about ...
unicorn33's user avatar
1 vote
1 answer
317 views

Just trying to mess around and learn about python ctypes according to the official documentation at https://docs.python.org/3.8/library/ctypes.html Everything works just fine until: ValueError is ...
RemiBall's user avatar
1 vote
1 answer
493 views

I'm trying to add my program to registry and this is my code... def regc(): reg = windll.kernel32 print(reg) hkey = 'HKEY_CURRENT_USER' lsubkey = 'Software\Microsoft\Windows\CurrentVersion\Run' ...
Jakpor Nobert's user avatar
0 votes
1 answer
130 views

The title may not be the most descriptive at first: I have a program that utilizes a call to "Wow64EnableWow64FsRedirection" function which is required when the software runs on a Windows 7 ...
Seth Bolduc's user avatar
0 votes
1 answer
124 views

I am trying to port a VB6 application to VB.NET. This is a console application that reads data from STDIN, modifies the data and writes it to STDOUT. Google is my friend, so I have spend days now on ...
Rens Duijsens's user avatar
0 votes
1 answer
564 views

Given this piece of code: Private Declare Auto Function GetPrivateProfileSection Lib "kernel32" _ (ByVal lpAppName As String, _ ByVal lpszReturnBuffer As Byte(), _ ...
Amessihel's user avatar
  • 6,636

1
2 3 4 5
7