-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathplatform_utils.py
More file actions
25 lines (21 loc) · 701 Bytes
/
Copy pathplatform_utils.py
File metadata and controls
25 lines (21 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# This file is part of libdebug Python library (https://github.com/libdebug/libdebug).
# Copyright (c) 2024-2025 Roberto Alessandro Bertolini. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
def get_platform_gp_register_size(arch: str) -> int:
"""Get the ptr size of the platform.
Args:
arch (str): The architecture of the platform.
Returns:
int: The ptr size in bytes.
"""
match arch:
case "amd64":
return 8
case "aarch64":
return 8
case "i386":
return 4
case _:
raise ValueError(f"Architecture {arch} not supported.")