Skip to content

Commit b707621

Browse files
committed
Doc how to query hardware information in bootstrap
1 parent c384bcf commit b707621

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/reference/environments.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,15 @@ Check it, first copy this script to ``.pyarmor/hooks/pyarmor_runtime.py``::
303303
...
304304
RuntimeError: unauthorized use of script (1:10325)
305305

306+
If need query hardware information, the simple way is to import Pyarmor extension `pytransform3`. For example, in Windows, copy the corresponding `pytransform3.pyd` to target device, then get machine id by this way
307+
308+
.. code-block:: python
309+
310+
def bootstrap(user_data):
311+
from pytransform3 import get_hd_info
312+
# Refer to pyarmor/cli/get_hd_info.py
313+
print('Machine ID: %s' % get_hd_info(22).decode())
314+
306315
.. _target environments:
307316

308317
=====================

0 commit comments

Comments
 (0)