Process

The interface exposes an API to query information about the current process. It provides cross-platform API and is extended on each platform with additional OS-specific helpers.
print(f"    PID:       {lief.runtime.Process.pid}")
print(f"    TID:       {lief.runtime.Process.tid}")
print(f"    Page size: {lief.runtime.Process.page_size:#06x}")
print(f"    Arch:      {lief.runtime.Process.arch}")
print(f"    Platform:  {lief.runtime.Process.platform}")
print(f"    TERM:      {lief.runtime.Process.get_env('TERM')}")

Linux

print(f"    glibc:     {lief.runtime.linux.Process.glibc_version}")

Windows

On Windows, the process interface is extended with which exposes the Process Environment Block (PEB) of the current process. The returned object provides access to some fields of the structure (whether the process is being debugged, the loader data, the process parameters, …):
if (peb := lief.runtime.windows.Process.peb) is not None:
    print(f"    PEB.BeingDebugged:          {peb.being_debugged}")
    print(f"    PEB.Ldr:                    {peb.ldr:#06x}")
    print(f"    PEB.ProcessParameters:      {peb.process_parameters:#06x}")
    print(f"    PEB.AtlThunkSListPtr:       {peb.atl_thunk_slist_ptr:#06x}")
    print(f"    PEB.AtlThunkSListPtr32:     {peb.atl_thunk_slist_ptr32:#06x}")
    print(f"    PEB.PostProcessInitRoutine: {peb.post_process_init_routine:#06x}")
    print(f"    PEB.SessionId:              {peb.session_id:#06x}")
if (peb := lief.runtime.windows.Process.peb) is not None:
    first = next(iter(peb.entries), None)
    if first is not None:
        print(f"    {first.base_dll_name} extended LDR_DATA_TABLE_ENTRY fields:")
        # Always available across the supported Windows versions:
        print(f"      Flags:             {first.flags:#06x}")
        print(f"      ObsoleteLoadCount: {first.obsolete_load_count}")
        print(f"      TlsIndex:          {first.tls_index:#06x}")
        print(f"      TimeDateStamp:     {first.time_date_stamp:#06x}")
        # Attributes that are available only from certain version:
        if (v := first.ddag_node) is not None:  # Windows 8+
            print(f"      DdagNode:          {v:#06x}")
        if (v := first.original_base) is not None:  # Windows 8+
            print(f"      OriginalBase:      {v:#06x}")
        if (v := first.load_reason) is not None:  # Windows 8+
            print(f"      LoadReason:        {v}")
        if (v := first.signing_level) is not None:  # Windows 10+
            print(f"      SigningLevel:      {v}")
        if (v := first.check_sum) is not None:  # Windows 10+
            print(f"      CheckSum:          {v:#06x}")
        if (v := first.hot_patch_state) is not None:  # Windows 11+
            print(f"      HotPatchState:     {v}")

OSX

print(f"    dyld:      {lief.runtime.osx.Process.dyld_version}")

Android

# Access a named property
sdk = lief.runtime.android.Process.get_system_property("ro.build.version.sdk")
if sdk is not None:
    print(f"    {sdk.name}: {sdk.value} (serial: {sdk.serial})")

# Iterate over all properties
for prop in lief.runtime.android.Process.properties:
    print(f"    {prop.name}: {prop.value} (serial: {prop.serial})")