kernel32

VirtualProtect and kernel32.dll - attempt to access invalid address

牧云@^-^@ 提交于 2021-01-27 02:40:26
问题 I'm analyzing various modules loaded by the process. Unfortunately I'm not able to create the kernel32.dll memory snapshot although the function works properly with other modules (e.g. ntddl.dll ). The problem is with the following code: /* Copy code from memory */ if (VirtualProtect((BYTE*)virtualAddress, sizeOfCode, PAGE_EXECUTE_READWRITE, &flags) == 0) { std::cout << "VirtualProtect failed!" << std::endl; std::cout << "Virtual address: " << virtualAddress << std::endl; std::cout << "Size

VirtualProtect and kernel32.dll - attempt to access invalid address

五迷三道 提交于 2021-01-27 02:38:30
问题 I'm analyzing various modules loaded by the process. Unfortunately I'm not able to create the kernel32.dll memory snapshot although the function works properly with other modules (e.g. ntddl.dll ). The problem is with the following code: /* Copy code from memory */ if (VirtualProtect((BYTE*)virtualAddress, sizeOfCode, PAGE_EXECUTE_READWRITE, &flags) == 0) { std::cout << "VirtualProtect failed!" << std::endl; std::cout << "Virtual address: " << virtualAddress << std::endl; std::cout << "Size

Windows Kernel32.BatteryLifePercent = 255

情到浓时终转凉″ 提交于 2020-08-05 04:10:17
问题 I'm trying to build a Java app that reads the status of a laptop battery and sends a notification to the user if it's low. In order to do this, I'm using jna with Kernel32 native library as explained in the first answer of this question: How to get the remaining battery life in a Windows system? Running the example, the program yields this output: ACLineStatus: Offline Battery Flag: High, more than 66 percent Battery Life: Unknown Battery Left: 0 seconds Battery Full: 10832 seconds The fields

Windows Kernel32.BatteryLifePercent = 255

心已入冬 提交于 2020-08-05 04:09:31
问题 I'm trying to build a Java app that reads the status of a laptop battery and sends a notification to the user if it's low. In order to do this, I'm using jna with Kernel32 native library as explained in the first answer of this question: How to get the remaining battery life in a Windows system? Running the example, the program yields this output: ACLineStatus: Offline Battery Flag: High, more than 66 percent Battery Life: Unknown Battery Left: 0 seconds Battery Full: 10832 seconds The fields

Rewrite code using extern `kernel32.dll` functions in pure C# to work with Mono [duplicate]

人走茶凉 提交于 2020-04-30 06:24:08
问题 This question already has answers here : OpenProcess/ReadProcessMemory/WriteProcessMemory/CloseHandle equivalent (2 answers) ELF read/write in other process memory (1 answer) Closed 3 days ago . TL;DR I want to implement functions from kernel32.dll in pure C# ( ReadProcessMemory and CloseHandle ) because kernel32.dll is Windows specific and I need to run them with Mono under GNU/Linux . I have the following C# code to read contents at a specific address of a given process; it relies on extern

Faulting application <app_name>, version <version number>,faulting module kernel32.dll

本秂侑毒 提交于 2020-02-06 05:22:59
问题 I have one windows application built using C# and .net framework 2.0 and its installed on Windows Server 2003. I have tested application on my machine and it works perfectly on my machine. Only difference between two machines is that, my machine has Windows Vista OS and machine on which error occured has Windows Server 2003 OS. When I start application, it works correctly for some time but then gives one error as Faulting application , version ,faulting module kernel32.dll,version 5.2.3790

can we rebase kernel32.dll ? such that load address is different for two processes

会有一股神秘感。 提交于 2020-01-24 15:11:06
问题 specifically i want to know if kernel32.dll load address can be different for two processes within the same session ? I want to use createremote thread so just wanted to know if kernel32 load address in remote process can be different from the injecting process in any scenario ? 回答1: Kernel32.dll has the same base address on all processes to allow exactly what you'd like to do. Read: Why are certain DLLs required to be at the same base address system-wide? 回答2: System DLLs are loaded at

can we rebase kernel32.dll ? such that load address is different for two processes

故事扮演 提交于 2020-01-24 15:10:48
问题 specifically i want to know if kernel32.dll load address can be different for two processes within the same session ? I want to use createremote thread so just wanted to know if kernel32 load address in remote process can be different from the injecting process in any scenario ? 回答1: Kernel32.dll has the same base address on all processes to allow exactly what you'd like to do. Read: Why are certain DLLs required to be at the same base address system-wide? 回答2: System DLLs are loaded at

Wrapper C# for kernel32.dll API

谁都会走 提交于 2020-01-01 10:00:52
问题 Any helper class anywhere which wrapps kernel32 APIs, with all functions-methods and structures? Or any wrapper generator? I want ALL methods of kernel32.dll in C# like this: [DllImport("kernel32.dll",EntryPoint="RtlMoveMemory")] public static extern void RtlMoveMemory(int des, int src, int count); [DllImport("kernel32.dll", EntryPoint = "OpenProcess")] public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId); [DllImport("kernel32", CharSet =

ASLR and Windows System DLLs for non-aware executables?

醉酒当歌 提交于 2019-12-30 05:22:09
问题 From a Microsoft article: Address Space Layout Randomization (ASLR) ASLR moves executable images into random locations when a system boots, making it harder for exploit code to operate predictably. For a component to support ASLR, all components that it loads must also support ASLR. For example, if A.exe consumes B.dll and C.dll, all three must support ASLR. By default, Windows Vista and later will randomize system DLLs and EXEs , but DLLs and EXEs created by ISVs must opt in to support ASLR