Questions tagged [winapi]

Microsoft's application programming interfaces available in the Windows operating system.

Filter by
Sorted by
Tagged with
10
votes
1answer
2k views

Anti-debugging techniques - Preventing me from setting a memory and hardware breakpoint. How can I bypass that?

I'm debugging this process which has a lot of anti debugging techniques in it, and I faced something new which I don't know how to bypass yet. Changing the code dynamically causes exceptions to occur ...
9
votes
2answers
839 views

Detecting an emulator using the windows api

I've been given a program that emulates the Windows API. I'm attempting to find flaws in this emulator where it either: Always returns a constant value, regardless of the host system (Useful for ...
8
votes
3answers
6k views

Windows API reference for OllyDbg

There is an old help file containing Windows API I used few years ago with ollydebug, which can jump to the appropriate help page of function when double clicking on the function in the disassembly ...
7
votes
2answers
3k views

Can a Windows process check if it has been injected by another process?

There are many tutorials which show how to detect injected code into process memory. However, this generally requires using a debugger. Is it possible for a process to somehow detect if it has been ...
7
votes
1answer
2k views

How can I find the Thread Local Storage (TLS) of a Windows Process Thread?

The Thread Local Storage (TLS) contains static or global values for a thread. Those values can be very important to find reliable references to memory structures when the memory locations are not ...
6
votes
4answers
1k views

Program with no dependencies

while reading the answers to Can I statically link (not import) the Windows system DLLs? I came up with another question. So: Is there a way to write a program that has no dependencies (nothing is ...
6
votes
3answers
6k views

Does code injected into process memory always belong to a page with RWX access?

I've seen a few memory forensics tutorials, which start by looking for injected code in the "victim's" process memory. They always seem to find the injected code in pages which have RWX access (i.e. ...
5
votes
1answer
2k views

DLL Injection search for procedures/variables

I am learning DLL injection basics and different techniques to achieve it, like using CreateProcess and LoadLibrary for example, or simply replacing a .dll in folder where the application to inject ...
4
votes
2answers
1k views

CreateProcess - First thread routine - where is the memory allocated for the thread?

When calling CreateProcess internally it will call (obviously ZwCreateProcessEx and then) ZwCreateThread with a CreateSuspended set to True, then i assume final initialization is taking place. ...
4
votes
3answers
535 views

Is there a tool to see kernel space mapping of a Windows exe?

In Microsoft Windows, a 32bits process calc.exe has 0x0-0x80000000 (2GB) reserved as its user-space and the rest is kernel-space (2GB). So, a process has 2+2 = 4GB of virtual space. This ratio could ...
4
votes
1answer
5k views

IDA python, list all imported functions

I have the following IDA python script. It sets and removes breakpoints on all calls to library functions: import idc import idaapi import idautils def set_breakpoints(): ea = idc.ScreenEA() ...
3
votes
1answer
346 views

Finding AddressOfEntryPoint for a 64-bit process

Okay, so in the following code-snippet I am starting a notepad.exe process in a suspended state and trying to get the AddressOfEntryPoint of the process. Problem is I can't seem to find the actual ...
3
votes
1answer
169 views

GetWindowLongPtr with undocumented nIndex of -1

I'm trying to reverse functionality of scrollbars in comctrl32.dll and I keep witnessing them calling GetWindowLongPtr function with undocumented index -1 as such: Does anybody know what that ...
3
votes
1answer
149 views

Why does this function calls offset move when I restart windows

Every time I restart windows it breaks the patch I've made to an executable where I've called a function from the dll user32.dll. Currently the offset for the function call resides at 0x76E3CDB4, but ...
3
votes
3answers
998 views

How to debug ServiceMain function of a service?

I have a malware which is checking for keyboard type and locale information. After that, it creates a service with BinaryPathName as malware's exe address. After creating a service, malware starts it ...
3
votes
1answer
275 views

CreateTimerQueueTimer arguments differs from WinAPI

I was reading a man page about CreateTimerQueueTimer. BOOL CreateTimerQueueTimer( PHANDLE phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, PVOID ...
3
votes
2answers
2k views

How to debug a self-debugging process?

How do you swap debuggers in Windows? In my case, I have a process A which creates a copy of itself: CreateProcessA("XXX.exe", NULL, 0x0023f560, 0x0023f560, TRUE, **...
3
votes
1answer
859 views

How to debug slow Windows API calls?

My machine at work has recently been updated to Windows 10, from Windows 7, and it has become incredibly slow. The IT has installed a bunch of new tools for security and protection after the upgrade ...
3
votes
1answer
510 views

How to debug packet processing with overlapped socket on Windows

The problem is quite complex so i don't want to run into unneccessary details. I have a network application, that communicates with multiple clients at once via UDP. I haven't written it and there is ...
3
votes
0answers
258 views

int 2eh instead of syscall/sysenter [duplicate]

I have been looking into ntdll.dll on windows 10 x64 bit, and i noticed a check inside the ntdll like this: So after testing some bit, it tries to execute the system call via int 2eh. I have tried to ...
3
votes
0answers
546 views

Hooking the BootClassLoader [closed]

According to Wikipedia, there are 3 class loaders. The Boot Class-Loader which loads everything in RT.jar and /../jre/lib Then the extensions class loader and the system class loader. I'm only ...
2
votes
2answers
391 views

Why cl.exe change the extern function name used in my code?

So basically I my nasm syntax asm code, I use some extern functions like this: extern _printf extern __imp__Sleep@4 .... call _printf call [__imp__Sleep@4] Then I use nasm to assemble it into obj:...
2
votes
3answers
848 views

Why IDA Pro generate define-lack code like this?

Basically I us IDA Pro 6.1 on Windows 32 bit, dealing with binaries from SPEC 2006. I use IDA Pro to generate asm code from the binaries, and in the .data section, I see data define like this: ...
2
votes
1answer
151 views

Missing Symbols RtlGetFrame, RtlPushFrame, RtlPopFrame

I'd like to use some undocumented symbols that listed in ProcessHacker project. taken from Here: https://github.com/processhacker/processhacker/blob/master/phnt/include/ntpebteb.h#L241 https://...
2
votes
1answer
2k views

What is the difference between kernelBase.dll and Kernel32.dll

What is the difference between kernelBase.dll and Kernel32.dll in system32 folder ? Why both of them implement WideCharToMultiByte ?
2
votes
1answer
365 views

How to see ReadFile results with ProcMon

I running procmon to monitor my process, and see that my process uses ReadFile API. How can I see which data the process received when it uses ReadFile?
2
votes
1answer
729 views

Can a process disable UAC via WinAPI without prompting the user? [closed]

Is it possible for a running process to turn off User Account Control (UAC) via a Windows API call? If so, which API calls are needed? I found this interesting question/answer on stackoverflow, ...
2
votes
1answer
172 views

Extracting strings from binary files (.exe)

This question has been asked quite a lot especially on stackoverflow, but the solutions/replies are not clear or extensive. What I`m looking for is to build what Strings does from Sysinternals. My ...
2
votes
1answer
347 views

Missing kernel32.dll in import table

I have very basic application which is console app dispaying message box. In Visual Studio I change following options: - C/C++ -> SecurityCheck -> Disable Security Check (/GS-) - Linker -> ...
2
votes
1answer
1k views

finding a RC4 Encryption function in obfuscated assembly code with no symbols

RC4 encryption is quite basic and its Pseudo random generation algorithm is given at Wikipedia When Looking for a hashing algorithm like MD5 or SHAx it is pretty simple to look for the Hashing ...
2
votes
1answer
110 views

How to find sleep() in ollydbg or IDA or ghidra

I have a program which converts videos from a proprietary format into mp4. The conversion is very slow and CPU utilization is less than 1%. I'm able to speed up the conversion process via Cheat Engine'...
2
votes
1answer
283 views

Changes on threads and threading system, in new Windows OS

I looked up the source code of the functions like CreateProcess and CreateThreade from kernel32. For example, CreateThread@kernel32 leads into kernelbase.dll and ends with a call to NtCreateThreadEx. ...
2
votes
0answers
15 views

WinApi of UWΡ Shаdοws

I want to ask which WinApi methods being used to draw shadows under flyouts on UWΡ. What I know: This shаdοw disappearing when hiding flyout (via SW_HIDE), but it stays if we one hide it using ...
2
votes
0answers
78 views

How to disassemble win32 function RegSetValueExW?

I have opened up advapi32.dll in IDA and found out that RegSetValueExW is just a jump to RegSetValueExW_0. And RegSetValueExW_0 seems to be an extern. How do I actually disassemble RegSetValueExW_0?
2
votes
0answers
72 views

Inserting Win32 controls into MFC application [closed]

I was wondering if there's a way to insert native win32 controls(button, static, etc.) into a MFC application during runtime. I was abled to embed my dll but everytime I create a new control via ...
1
vote
1answer
144 views

GUI represention in assembly level and another question

In advance, I'd say I'm learning reverse engineering newly. Indeed, there are some questions to be asked. First of all I would ask : In assembly level of the applications which use GUI ,how things ...
1
vote
2answers
51 views

In the context of the Windows API, what extra information do the debugging symbols provide that the export table doesnt provide?

Take for example, 'kernel32.dll', the export table already provides the list of exported functions, then in what use case, would I need to download the debugging symbols for it from the MS symbol ...
1
vote
1answer
3k views

How to analyze a child process created by malware by process hollowing mechanism using immunity debugger?

When I analyzed this malware sample it was invoking api's related to creating additional processes. With the process explorer I saw the debugged process is creating a new process. Please suggest any ...
1
vote
1answer
68 views

Is there any way to watch a block of memory of the current process for change?

I'm looking for a way to get notified when some block of memory of the current process change. To be more specific, I want to track when some fields of a struct change. Let's say I have one instance ...
1
vote
2answers
672 views

Dumping Memory to Raw File

Is there a way to dump a section of process memory knowing the start and end address to raw bin file via a winapi function or some other method? I know that you can do this easily with a debugger, but ...
1
vote
3answers
1k views

Winapi ReadFile monitor

I'm trying to make a small proxy dll that will be able to print out all the files that a game tries to access from disk. I'm using a dinput8 wrapper dll as my proxy dll, from where I've managed to ...
1
vote
1answer
784 views

Why do i get into endless loop in winapi when i am debugging?

I am debugging some quiz program called "abex crackme 1" When I execute this program without debugging, it shows a simple message box, which reads "Make me think your HD is a CD-Rom" After I click ...
1
vote
2answers
805 views

How to compare no-case sensitive strings IDC

So I want to track when a certain file is loaded into an Win32 app. That's way I put a break-point on 'CreateFile' which compares the first parameter with the target file name, but the problem is that ...
1
vote
1answer
470 views

How to get the PID of the a thread's creator (not owner, not host)

The THREADENTRY32 structure contains a member called th32OwnerProcessID, which is described as: The identifier of the process that created the thread. I'm not sure if I understand how the ...
1
vote
1answer
875 views

x64dbg how to set conditional breakpoint on WinAPI function

I am trying to solve a GUI based crackme. https://crackmes.one/crackme/5c68758633c5d4776a837cc4 so that I learn security. I want to set a conditional Break point on user32.CallWindowProcA. Microsoft ...
1
vote
2answers
6k views

What is \Sessions\1\BaseNamedObjects\NamedBuffer?

I see those in a debugger (OllyDbg, handles subwindow), but I never meet an explanation on what those are. Here is the full content of it, and to be honest I want to know the meaning of all of this. ...
1
vote
2answers
319 views

Identifying DeviceIoControl argument

I am reversing an application that uses the serial interface (COM1 port) and am using API Monitor to trace through the API calls. I found a reference to CreateFileA("\\.\Commsb96", GENERIC_READ | ...
1
vote
2answers
233 views

MSDetour not detouring SHGetKnownFolderPath

Tried to hook SHGetKnownFolderPath from shell32, using the normal DetourFunctionWithTrampoline, and it could not. Investigating, it seen that the application use GetProcAddress to load the function, ...
1
vote
2answers
2k views

Command Injection in Windows ShellExecuteA()?

Imagine that we have the following pseudo-code in a Windows application: ShellExecuteA(0, "open", &File, &Parameters, &Directory, 1); And, imagine that you can gain control over the ...
1
vote
0answers
368 views

Calling undocumented kernel functions directly (xxxSendInput and xxxMouseEventDirect)

In the core my question is about how to reverse engineer undocumented functions. I want to call the function "xxxMouseEventDirect" (located in win32kfull.sys). I have already been able to collect some ...