> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/wrappers-and-helpers/getcurrentprocessidfromoffset.md).

# GetCurrentProcessIdFromOffset

```
DWORD GetCurrentProcessIdFromOffset(VOID)
{
#if defined(_WIN64)
    return (UINT32)__readgsqword(0x40);
#elif define(_WIN32)
    return (UINT32)__readfsdword(0x20);
#endif
}

```
