smallworld-re 1.0.3__py3-none-any.whl → 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. smallworld/analyses/__init__.py +8 -0
  2. smallworld/analyses/analysis.py +8 -67
  3. smallworld/analyses/code_coverage.py +1 -2
  4. smallworld/analyses/colorizer.py +301 -534
  5. smallworld/analyses/colorizer_def_use.py +217 -0
  6. smallworld/analyses/colorizer_summary.py +173 -83
  7. smallworld/analyses/field_detection/field_analysis.py +7 -8
  8. smallworld/analyses/field_detection/hints.py +1 -1
  9. smallworld/analyses/field_detection/malloc.py +2 -2
  10. smallworld/analyses/trace_execution.py +160 -0
  11. smallworld/analyses/trace_execution_types.py +42 -0
  12. smallworld/analyses/unstable/angr/divergence.py +1 -2
  13. smallworld/analyses/unstable/angr/model.py +5 -6
  14. smallworld/analyses/unstable/angr_nwbt.py +3 -4
  15. smallworld/analyses/unstable/code_coverage.py +2 -3
  16. smallworld/analyses/unstable/code_reachable.py +2 -3
  17. smallworld/analyses/unstable/control_flow_tracer.py +2 -3
  18. smallworld/analyses/unstable/pointer_finder.py +2 -3
  19. smallworld/analyses/unstable/utils/tui.py +71 -0
  20. smallworld/emulators/__init__.py +3 -1
  21. smallworld/emulators/angr/angr.py +30 -9
  22. smallworld/emulators/angr/machdefs/__init__.py +2 -0
  23. smallworld/emulators/angr/machdefs/aarch64.py +1 -1
  24. smallworld/emulators/angr/machdefs/amd64.py +0 -4
  25. smallworld/emulators/angr/machdefs/arm.py +0 -2
  26. smallworld/emulators/angr/machdefs/i386.py +0 -2
  27. smallworld/emulators/angr/machdefs/loongarch.py +340 -0
  28. smallworld/emulators/angr/machdefs/machdef.py +1 -8
  29. smallworld/emulators/angr/machdefs/mips.py +0 -2
  30. smallworld/emulators/angr/machdefs/mips64.py +0 -2
  31. smallworld/emulators/angr/machdefs/ppc.py +1 -2
  32. smallworld/emulators/angr/machdefs/riscv.py +8 -10
  33. smallworld/emulators/angr/machdefs/xtensa.py +7 -4
  34. smallworld/emulators/emulator.py +22 -0
  35. smallworld/emulators/ghidra/__init__.py +37 -0
  36. smallworld/emulators/ghidra/ghidra.py +513 -0
  37. smallworld/emulators/ghidra/machdefs/__init__.py +31 -0
  38. smallworld/emulators/ghidra/machdefs/aarch64.py +289 -0
  39. smallworld/emulators/ghidra/machdefs/amd64.py +185 -0
  40. smallworld/emulators/ghidra/machdefs/arm.py +370 -0
  41. smallworld/emulators/ghidra/machdefs/i386.py +109 -0
  42. smallworld/emulators/ghidra/machdefs/loongarch.py +162 -0
  43. smallworld/emulators/ghidra/machdefs/machdef.py +81 -0
  44. smallworld/emulators/ghidra/machdefs/mips.py +163 -0
  45. smallworld/emulators/ghidra/machdefs/mips64.py +186 -0
  46. smallworld/emulators/ghidra/machdefs/ppc.py +98 -0
  47. smallworld/emulators/ghidra/machdefs/riscv.py +208 -0
  48. smallworld/emulators/ghidra/machdefs/xtensa.py +21 -0
  49. smallworld/emulators/ghidra/typing.py +28 -0
  50. smallworld/emulators/hookable.py +18 -4
  51. smallworld/emulators/panda/machdefs/__init__.py +2 -2
  52. smallworld/emulators/panda/machdefs/aarch64.py +186 -11
  53. smallworld/emulators/panda/machdefs/amd64.py +103 -11
  54. smallworld/emulators/panda/machdefs/arm.py +216 -20
  55. smallworld/emulators/panda/machdefs/i386.py +30 -7
  56. smallworld/emulators/panda/machdefs/machdef.py +9 -16
  57. smallworld/emulators/panda/machdefs/mips.py +49 -5
  58. smallworld/emulators/panda/machdefs/mips64.py +57 -5
  59. smallworld/emulators/panda/machdefs/ppc.py +38 -13
  60. smallworld/emulators/panda/panda.py +146 -44
  61. smallworld/emulators/unicorn/__init__.py +2 -0
  62. smallworld/emulators/unicorn/machdefs/aarch64.py +253 -264
  63. smallworld/emulators/unicorn/machdefs/amd64.py +254 -259
  64. smallworld/emulators/unicorn/machdefs/arm.py +200 -212
  65. smallworld/emulators/unicorn/machdefs/i386.py +84 -90
  66. smallworld/emulators/unicorn/machdefs/machdef.py +2 -23
  67. smallworld/emulators/unicorn/machdefs/mips.py +127 -135
  68. smallworld/emulators/unicorn/unicorn.py +52 -13
  69. smallworld/helpers.py +4 -19
  70. smallworld/hinting/hinting.py +22 -192
  71. smallworld/hinting/hints.py +50 -18
  72. smallworld/instructions/bsid.py +8 -8
  73. smallworld/logging.py +4 -2
  74. smallworld/platforms/__init__.py +12 -0
  75. smallworld/platforms/defs/__init__.py +36 -0
  76. smallworld/platforms/defs/aarch64.py +450 -0
  77. smallworld/platforms/defs/amd64.py +463 -0
  78. smallworld/platforms/defs/arm.py +519 -0
  79. smallworld/platforms/defs/i386.py +258 -0
  80. smallworld/platforms/defs/loongarch.py +270 -0
  81. smallworld/platforms/defs/mips.py +321 -0
  82. smallworld/platforms/defs/mips64.py +313 -0
  83. smallworld/platforms/defs/platformdef.py +97 -0
  84. smallworld/platforms/defs/powerpc.py +259 -0
  85. smallworld/platforms/defs/riscv.py +257 -0
  86. smallworld/platforms/defs/xtensa.py +96 -0
  87. smallworld/{platforms.py → platforms/platforms.py} +3 -0
  88. smallworld/state/cpus/__init__.py +2 -0
  89. smallworld/state/cpus/aarch64.py +0 -9
  90. smallworld/state/cpus/amd64.py +6 -28
  91. smallworld/state/cpus/arm.py +0 -11
  92. smallworld/state/cpus/cpu.py +0 -11
  93. smallworld/state/cpus/i386.py +0 -7
  94. smallworld/state/cpus/loongarch.py +299 -0
  95. smallworld/state/cpus/mips.py +4 -47
  96. smallworld/state/cpus/mips64.py +18 -58
  97. smallworld/state/cpus/powerpc.py +2 -9
  98. smallworld/state/cpus/riscv.py +1 -11
  99. smallworld/state/cpus/xtensa.py +0 -5
  100. smallworld/state/memory/code.py +38 -2
  101. smallworld/state/memory/elf/__init__.py +5 -1
  102. smallworld/state/memory/elf/coredump/__init__.py +3 -0
  103. smallworld/state/memory/elf/coredump/coredump.py +46 -0
  104. smallworld/state/memory/elf/coredump/prstatus/__init__.py +27 -0
  105. smallworld/state/memory/elf/coredump/prstatus/aarch64.py +46 -0
  106. smallworld/state/memory/elf/coredump/prstatus/amd64.py +40 -0
  107. smallworld/state/memory/elf/coredump/prstatus/arm.py +53 -0
  108. smallworld/state/memory/elf/coredump/prstatus/i386.py +30 -0
  109. smallworld/state/memory/elf/coredump/prstatus/mips.py +55 -0
  110. smallworld/state/memory/elf/coredump/prstatus/mips64.py +57 -0
  111. smallworld/state/memory/elf/coredump/prstatus/ppc.py +82 -0
  112. smallworld/state/memory/elf/coredump/prstatus/prstatus.py +129 -0
  113. smallworld/state/memory/elf/elf.py +211 -57
  114. smallworld/state/memory/elf/register_state.py +36 -0
  115. smallworld/state/memory/elf/rela/__init__.py +2 -0
  116. smallworld/state/memory/elf/rela/aarch64.py +3 -1
  117. smallworld/state/memory/elf/rela/amd64.py +4 -2
  118. smallworld/state/memory/elf/rela/arm.py +4 -2
  119. smallworld/state/memory/elf/rela/i386.py +4 -2
  120. smallworld/state/memory/elf/rela/loongarch.py +32 -0
  121. smallworld/state/memory/elf/rela/mips.py +39 -18
  122. smallworld/state/memory/elf/rela/ppc.py +31 -14
  123. smallworld/state/memory/elf/structs.py +3 -0
  124. smallworld/state/memory/heap.py +2 -2
  125. smallworld/state/memory/memory.py +18 -0
  126. smallworld/state/memory/pe/__init__.py +3 -0
  127. smallworld/state/memory/pe/pe.py +361 -0
  128. smallworld/state/memory/pe/structs.py +60 -0
  129. smallworld/state/memory/stack/__init__.py +2 -0
  130. smallworld/state/memory/stack/loongarch.py +26 -0
  131. smallworld/state/models/__init__.py +29 -2
  132. smallworld/state/models/aarch64/__init__.py +1 -0
  133. smallworld/state/models/aarch64/systemv/__init__.py +6 -0
  134. smallworld/state/models/aarch64/systemv/c99/__init__.py +12 -0
  135. smallworld/state/models/aarch64/systemv/c99/signal.py +16 -0
  136. smallworld/state/models/aarch64/systemv/c99/stdio.py +265 -0
  137. smallworld/state/models/aarch64/systemv/c99/stdlib.py +169 -0
  138. smallworld/state/models/aarch64/systemv/c99/string.py +139 -0
  139. smallworld/state/models/aarch64/systemv/c99/time.py +61 -0
  140. smallworld/state/models/aarch64/systemv/posix/__init__.py +6 -0
  141. smallworld/state/models/aarch64/systemv/posix/libgen.py +16 -0
  142. smallworld/state/models/aarch64/systemv/posix/signal.py +157 -0
  143. smallworld/state/models/aarch64/systemv/systemv.py +80 -0
  144. smallworld/state/models/amd64/__init__.py +1 -0
  145. smallworld/state/models/amd64/systemv/__init__.py +6 -0
  146. smallworld/state/models/amd64/systemv/c99/__init__.py +12 -0
  147. smallworld/state/models/amd64/systemv/c99/signal.py +16 -0
  148. smallworld/state/models/amd64/systemv/c99/stdio.py +265 -0
  149. smallworld/state/models/amd64/systemv/c99/stdlib.py +169 -0
  150. smallworld/state/models/amd64/systemv/c99/string.py +139 -0
  151. smallworld/state/models/amd64/systemv/c99/time.py +61 -0
  152. smallworld/state/models/amd64/systemv/posix/__init__.py +6 -0
  153. smallworld/state/models/amd64/systemv/posix/libgen.py +16 -0
  154. smallworld/state/models/amd64/systemv/posix/signal.py +157 -0
  155. smallworld/state/models/amd64/systemv/systemv.py +78 -0
  156. smallworld/state/models/armel/__init__.py +1 -0
  157. smallworld/state/models/armel/systemv/__init__.py +6 -0
  158. smallworld/state/models/armel/systemv/c99/__init__.py +12 -0
  159. smallworld/state/models/armel/systemv/c99/signal.py +16 -0
  160. smallworld/state/models/armel/systemv/c99/stdio.py +265 -0
  161. smallworld/state/models/armel/systemv/c99/stdlib.py +169 -0
  162. smallworld/state/models/armel/systemv/c99/string.py +139 -0
  163. smallworld/state/models/armel/systemv/c99/time.py +61 -0
  164. smallworld/state/models/armel/systemv/posix/__init__.py +6 -0
  165. smallworld/state/models/armel/systemv/posix/libgen.py +16 -0
  166. smallworld/state/models/armel/systemv/posix/signal.py +157 -0
  167. smallworld/state/models/armel/systemv/systemv.py +82 -0
  168. smallworld/state/models/armhf/__init__.py +1 -0
  169. smallworld/state/models/armhf/systemv/__init__.py +6 -0
  170. smallworld/state/models/armhf/systemv/c99/__init__.py +12 -0
  171. smallworld/state/models/armhf/systemv/c99/signal.py +16 -0
  172. smallworld/state/models/armhf/systemv/c99/stdio.py +265 -0
  173. smallworld/state/models/armhf/systemv/c99/stdlib.py +169 -0
  174. smallworld/state/models/armhf/systemv/c99/string.py +139 -0
  175. smallworld/state/models/armhf/systemv/c99/time.py +61 -0
  176. smallworld/state/models/armhf/systemv/posix/__init__.py +6 -0
  177. smallworld/state/models/armhf/systemv/posix/libgen.py +16 -0
  178. smallworld/state/models/armhf/systemv/posix/signal.py +157 -0
  179. smallworld/state/models/armhf/systemv/systemv.py +77 -0
  180. smallworld/state/models/c99/__init__.py +12 -0
  181. smallworld/state/models/c99/fmt_print.py +915 -0
  182. smallworld/state/models/c99/fmt_scan.py +864 -0
  183. smallworld/state/models/c99/math.py +362 -0
  184. smallworld/state/models/c99/signal.py +71 -0
  185. smallworld/state/models/c99/stdio.py +1305 -0
  186. smallworld/state/models/c99/stdlib.py +595 -0
  187. smallworld/state/models/c99/string.py +674 -0
  188. smallworld/state/models/c99/time.py +340 -0
  189. smallworld/state/models/c99/utils.py +89 -0
  190. smallworld/state/models/cstd.py +759 -0
  191. smallworld/state/models/errno.py +581 -0
  192. smallworld/state/models/filedesc.py +515 -0
  193. smallworld/state/models/i386/__init__.py +1 -0
  194. smallworld/state/models/i386/systemv/__init__.py +6 -0
  195. smallworld/state/models/i386/systemv/c99/__init__.py +12 -0
  196. smallworld/state/models/i386/systemv/c99/signal.py +16 -0
  197. smallworld/state/models/i386/systemv/c99/stdio.py +265 -0
  198. smallworld/state/models/i386/systemv/c99/stdlib.py +169 -0
  199. smallworld/state/models/i386/systemv/c99/string.py +139 -0
  200. smallworld/state/models/i386/systemv/c99/time.py +61 -0
  201. smallworld/state/models/i386/systemv/posix/__init__.py +6 -0
  202. smallworld/state/models/i386/systemv/posix/libgen.py +16 -0
  203. smallworld/state/models/i386/systemv/posix/signal.py +157 -0
  204. smallworld/state/models/i386/systemv/systemv.py +71 -0
  205. smallworld/state/models/loongarch64/__init__.py +1 -0
  206. smallworld/state/models/loongarch64/systemv/__init__.py +6 -0
  207. smallworld/state/models/loongarch64/systemv/c99/__init__.py +12 -0
  208. smallworld/state/models/loongarch64/systemv/c99/signal.py +16 -0
  209. smallworld/state/models/loongarch64/systemv/c99/stdio.py +265 -0
  210. smallworld/state/models/loongarch64/systemv/c99/stdlib.py +169 -0
  211. smallworld/state/models/loongarch64/systemv/c99/string.py +139 -0
  212. smallworld/state/models/loongarch64/systemv/c99/time.py +61 -0
  213. smallworld/state/models/loongarch64/systemv/posix/__init__.py +6 -0
  214. smallworld/state/models/loongarch64/systemv/posix/libgen.py +16 -0
  215. smallworld/state/models/loongarch64/systemv/posix/signal.py +157 -0
  216. smallworld/state/models/loongarch64/systemv/systemv.py +83 -0
  217. smallworld/state/models/mips/__init__.py +1 -0
  218. smallworld/state/models/mips/systemv/__init__.py +6 -0
  219. smallworld/state/models/mips/systemv/c99/__init__.py +12 -0
  220. smallworld/state/models/mips/systemv/c99/signal.py +16 -0
  221. smallworld/state/models/mips/systemv/c99/stdio.py +265 -0
  222. smallworld/state/models/mips/systemv/c99/stdlib.py +169 -0
  223. smallworld/state/models/mips/systemv/c99/string.py +139 -0
  224. smallworld/state/models/mips/systemv/c99/time.py +61 -0
  225. smallworld/state/models/mips/systemv/posix/__init__.py +6 -0
  226. smallworld/state/models/mips/systemv/posix/libgen.py +16 -0
  227. smallworld/state/models/mips/systemv/posix/signal.py +157 -0
  228. smallworld/state/models/mips/systemv/systemv.py +78 -0
  229. smallworld/state/models/mips64/__init__.py +1 -0
  230. smallworld/state/models/mips64/systemv/__init__.py +6 -0
  231. smallworld/state/models/mips64/systemv/c99/__init__.py +12 -0
  232. smallworld/state/models/mips64/systemv/c99/signal.py +16 -0
  233. smallworld/state/models/mips64/systemv/c99/stdio.py +265 -0
  234. smallworld/state/models/mips64/systemv/c99/stdlib.py +169 -0
  235. smallworld/state/models/mips64/systemv/c99/string.py +139 -0
  236. smallworld/state/models/mips64/systemv/c99/time.py +61 -0
  237. smallworld/state/models/mips64/systemv/posix/__init__.py +6 -0
  238. smallworld/state/models/mips64/systemv/posix/libgen.py +16 -0
  239. smallworld/state/models/mips64/systemv/posix/signal.py +157 -0
  240. smallworld/state/models/mips64/systemv/systemv.py +98 -0
  241. smallworld/state/models/mips64el/__init__.py +1 -0
  242. smallworld/state/models/mips64el/systemv/__init__.py +6 -0
  243. smallworld/state/models/mips64el/systemv/c99/__init__.py +12 -0
  244. smallworld/state/models/mips64el/systemv/c99/signal.py +16 -0
  245. smallworld/state/models/mips64el/systemv/c99/stdio.py +265 -0
  246. smallworld/state/models/mips64el/systemv/c99/stdlib.py +169 -0
  247. smallworld/state/models/mips64el/systemv/c99/string.py +139 -0
  248. smallworld/state/models/mips64el/systemv/c99/time.py +61 -0
  249. smallworld/state/models/mips64el/systemv/posix/__init__.py +6 -0
  250. smallworld/state/models/mips64el/systemv/posix/libgen.py +16 -0
  251. smallworld/state/models/mips64el/systemv/posix/signal.py +157 -0
  252. smallworld/state/models/mips64el/systemv/systemv.py +96 -0
  253. smallworld/state/models/mipsel/__init__.py +1 -0
  254. smallworld/state/models/mipsel/systemv/__init__.py +6 -0
  255. smallworld/state/models/mipsel/systemv/c99/__init__.py +12 -0
  256. smallworld/state/models/mipsel/systemv/c99/signal.py +16 -0
  257. smallworld/state/models/mipsel/systemv/c99/stdio.py +265 -0
  258. smallworld/state/models/mipsel/systemv/c99/stdlib.py +169 -0
  259. smallworld/state/models/mipsel/systemv/c99/string.py +139 -0
  260. smallworld/state/models/mipsel/systemv/c99/time.py +61 -0
  261. smallworld/state/models/mipsel/systemv/posix/__init__.py +6 -0
  262. smallworld/state/models/mipsel/systemv/posix/libgen.py +16 -0
  263. smallworld/state/models/mipsel/systemv/posix/signal.py +157 -0
  264. smallworld/state/models/mipsel/systemv/systemv.py +78 -0
  265. smallworld/state/models/model.py +27 -2
  266. smallworld/state/models/posix/__init__.py +6 -0
  267. smallworld/state/models/posix/libgen.py +123 -0
  268. smallworld/state/models/posix/signal.py +690 -0
  269. smallworld/state/models/powerpc/__init__.py +1 -0
  270. smallworld/state/models/powerpc/systemv/__init__.py +6 -0
  271. smallworld/state/models/powerpc/systemv/c99/__init__.py +12 -0
  272. smallworld/state/models/powerpc/systemv/c99/signal.py +16 -0
  273. smallworld/state/models/powerpc/systemv/c99/stdio.py +265 -0
  274. smallworld/state/models/powerpc/systemv/c99/stdlib.py +169 -0
  275. smallworld/state/models/powerpc/systemv/c99/string.py +139 -0
  276. smallworld/state/models/powerpc/systemv/c99/time.py +61 -0
  277. smallworld/state/models/powerpc/systemv/posix/__init__.py +6 -0
  278. smallworld/state/models/powerpc/systemv/posix/libgen.py +16 -0
  279. smallworld/state/models/powerpc/systemv/posix/signal.py +157 -0
  280. smallworld/state/models/powerpc/systemv/systemv.py +93 -0
  281. smallworld/state/models/riscv64/__init__.py +1 -0
  282. smallworld/state/models/riscv64/systemv/__init__.py +6 -0
  283. smallworld/state/models/riscv64/systemv/c99/__init__.py +12 -0
  284. smallworld/state/models/riscv64/systemv/c99/signal.py +16 -0
  285. smallworld/state/models/riscv64/systemv/c99/stdio.py +265 -0
  286. smallworld/state/models/riscv64/systemv/c99/stdlib.py +169 -0
  287. smallworld/state/models/riscv64/systemv/c99/string.py +139 -0
  288. smallworld/state/models/riscv64/systemv/c99/time.py +61 -0
  289. smallworld/state/models/riscv64/systemv/posix/__init__.py +6 -0
  290. smallworld/state/models/riscv64/systemv/posix/libgen.py +16 -0
  291. smallworld/state/models/riscv64/systemv/posix/signal.py +157 -0
  292. smallworld/state/models/riscv64/systemv/systemv.py +85 -0
  293. smallworld/state/state.py +65 -24
  294. smallworld/state/unstable/elf.py +16 -31
  295. smallworld/utils.py +6 -1
  296. {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/METADATA +74 -42
  297. smallworld_re-2.0.0.dist-info/RECORD +374 -0
  298. {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/WHEEL +1 -1
  299. smallworld/state/models/x86/__init__.py +0 -2
  300. smallworld/state/models/x86/microsoftcdecl.py +0 -35
  301. smallworld/state/models/x86/systemv.py +0 -240
  302. smallworld_re-1.0.3.dist-info/RECORD +0 -166
  303. /smallworld/state/models/{posix.py → _posix.py} +0 -0
  304. {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/entry_points.txt +0 -0
  305. {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/licenses/LICENSE.txt +0 -0
  306. {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,690 @@
1
+ import typing
2
+
3
+ from .... import emulators
4
+ from ....platforms import Architecture
5
+ from ..c99.signal import Signal
6
+ from ..cstd import ArgumentType, CStdModel
7
+
8
+ # NOTE: signal() and raise() are defined in C99
9
+
10
+ # NOTE: pid_t is defined as int in all supported ABIs.
11
+ # NOTE: pthread_t is defined as unsigned long in all supported ABIs.
12
+
13
+ # NOTE: glibc and POSIX actively disagree about sigmask_t
14
+ # POSIX headers define sigmask_t as a 128-byte type.
15
+ # glibc only uses the first eight bytes;
16
+ # it doesn't touch the trailing 120 bytes.
17
+
18
+
19
+ class BsdSignal(Signal):
20
+ # NOTE: This is signal() with slightly different semantics.
21
+ #
22
+ # The C99 specification made some rather unilateral decisions
23
+ # regarding what should happen when a signal handler fires.
24
+ #
25
+ # The BSD community disagreed with the System V community,
26
+ # and made their own unilateral decisions
27
+ # which are enshrined in the API for this function.
28
+ #
29
+ # The System V community fired back with the non-standard
30
+ # sysv_signal() function.
31
+ #
32
+ # POSIX fixed this by introducing sigaction(),
33
+ # which lets you control all of these decisions for yourself.
34
+ #
35
+ # This is why there are warnings everywhere saying
36
+ # "don't use signal() except with pre-defined handlers".
37
+ name = "bsd_signal"
38
+
39
+ # typedef void (*sighandler_t)(int);
40
+ # sighandler_t bsd_signal(int sig, sighandler_t func);
41
+
42
+
43
+ class Kill(CStdModel):
44
+ name = "kill"
45
+
46
+ # int kill(pid_t pid, int sig);
47
+ argument_types = [ArgumentType.INT, ArgumentType.INT]
48
+ return_type = ArgumentType.INT
49
+
50
+ # Most of our emulators can't model signals.
51
+ # I'm not sure it's possible to model raising one.
52
+ imprecise = True
53
+
54
+ def model(self, emulator: emulators.Emulator) -> None:
55
+ super().model(emulator)
56
+
57
+ # Not really modeled; just return success
58
+ self.set_return_value(emulator, 0)
59
+
60
+
61
+ class Killpg(CStdModel):
62
+ name = "killpg"
63
+
64
+ # int killpg(int pgid, int sig);
65
+ argument_types = [ArgumentType.INT, ArgumentType.INT]
66
+ return_type = ArgumentType.INT
67
+
68
+ # Most of our emulators can't model signals.
69
+ # I'm not sure it's possible to model raising one.
70
+ imprecise = True
71
+
72
+ def model(self, emulator: emulators.Emulator) -> None:
73
+ super().model(emulator)
74
+
75
+ # Not really modeled; just return success
76
+ self.set_return_value(emulator, 0)
77
+
78
+
79
+ class PthreadKill(CStdModel):
80
+ name = "pthread_kill"
81
+
82
+ # int pthread_kill(pthread_t thread, int sig);
83
+ argument_types = [ArgumentType.ULONG, ArgumentType.INT]
84
+ return_type = ArgumentType.INT
85
+
86
+ # Most of our emulators can't model signals.
87
+ # I'm not sure it's possible to model raising one.
88
+ # We currently have no plans to model multithreading.
89
+ imprecise = True
90
+
91
+ def model(self, emulator: emulators.Emulator) -> None:
92
+ super().model(emulator)
93
+
94
+ # Not really modeled; just return success
95
+ self.set_return_value(emulator, 0)
96
+
97
+
98
+ class PthreadSigmask(CStdModel):
99
+ name = "pthread_sigmask"
100
+
101
+ # int pthread_sigmask(int how, sigset_t *set, sigset_t *oldset);
102
+ argument_types = [ArgumentType.INT, ArgumentType.POINTER, ArgumentType.POINTER]
103
+ return_type = ArgumentType.INT
104
+
105
+ # We currently have no plans to model multithreading.
106
+ # This model assumes a single thread,
107
+ # since I have no concept of a current TID.
108
+ imprecise = True
109
+
110
+ # NOTE: This assumes a null initial signal mask.
111
+
112
+ # TODO: This won't interoperate with sigprocmask()
113
+ # You're not supposed to interoperate the two,
114
+ # so I'm okay with this for now.
115
+
116
+ def __init__(self, address: int):
117
+ super().__init__(address)
118
+ self.sigmask = b"\0" * 128
119
+
120
+ def model(self, emulator: emulators.Emulator) -> None:
121
+ super().model(emulator)
122
+
123
+ how = self.get_arg1(emulator)
124
+ newset = self.get_arg2(emulator)
125
+ oldset = self.get_arg3(emulator)
126
+
127
+ assert isinstance(how, int)
128
+ assert isinstance(newset, int)
129
+ assert isinstance(oldset, int)
130
+
131
+ # sigset_t is a 1024-bit bit vector.
132
+ # It's split up differently in different ABIs, but that's what it amounts to.
133
+
134
+ # TODO: This syscall actually handles out-of-bounds addresses
135
+ # Do we want to model this, or leave the error to let harness authors know?
136
+
137
+ if oldset != 0:
138
+ # If oldset is set, save the sigmask to it.
139
+ emulator.write_memory(oldset, self.sigmask)
140
+
141
+ if newset != 0:
142
+ # Read the new vector out of memory.
143
+ # If this thing has alignment issues, I will make ugly noises.
144
+ newvec = emulator.read_memory(newset, 128)
145
+
146
+ # OF COURSE MIPS IS DIFFERENT!
147
+ is_mips = (
148
+ 1
149
+ if self.platform.architecture
150
+ in (Architecture.MIPS32, Architecture.MIPS64)
151
+ else 0
152
+ )
153
+
154
+ if how == 0 + is_mips:
155
+ # Case: how == SIG_BLOCK: Set sigmask to newvec | sigmask
156
+ self.sigmask = bytes(
157
+ map(lambda x: self.sigmask[x] | newvec[x], range(0, 128))
158
+ )
159
+ elif how == 1 + is_mips:
160
+ # Case: how == SIG_UNBLOCK: Set sigmask to ~newvec | sigmask
161
+
162
+ self.sigmask = bytes(
163
+ map(lambda x: self.sigmask[x] & ~newvec[x], range(0, 128))
164
+ )
165
+ elif how == 2 + is_mips:
166
+ # Case: how == SIG_SETMASK: Set sigmask to newvec
167
+ self.sigmask = newvec
168
+ else:
169
+ # Case: default: Return failure
170
+ print(f"Unknown how {how}")
171
+ self.set_return_value(emulator, -1)
172
+ return
173
+
174
+ self.set_return_value(emulator, 0)
175
+
176
+
177
+ class Sigaction(CStdModel):
178
+ name = "sigaction"
179
+
180
+ # typedef void (*sighandler_t)(int);
181
+ # int sigaction(int sig, const struct sigaction *act, const struct sigaction *oldact);
182
+ argument_types = [ArgumentType.INT, ArgumentType.POINTER, ArgumentType.POINTER]
183
+ return_type = ArgumentType.INT
184
+
185
+ # FIXME: This doesn't interoperate with signal()
186
+ # Programs generally shouldn't use signal(), but they can use it to clear a handler.
187
+
188
+ # Most of our emulators can't model signals
189
+ imprecise = True
190
+
191
+ def __init__(self, address: int):
192
+ super().__init__(address)
193
+ # Track any registered handlers.
194
+ # Sometimes programs care about this.
195
+ self.handlers: typing.Dict[int, int] = dict()
196
+ self.flags: typing.Dict[int, int] = dict()
197
+ self.masks: typing.Dict[int, bytes] = dict()
198
+
199
+ def model(self, emulator: emulators.Emulator) -> None:
200
+ super().model(emulator)
201
+
202
+ sig = self.get_arg1(emulator)
203
+ act = self.get_arg2(emulator)
204
+ oldact = self.get_arg3(emulator)
205
+
206
+ assert isinstance(sig, int)
207
+ assert isinstance(act, int)
208
+ assert isinstance(oldact, int)
209
+
210
+ # Figure out field alignments in the sigaction struct.
211
+ # Of course MIPS has to be different.
212
+ if self.platform.architecture == Architecture.MIPS32:
213
+ handler_off = 0x4
214
+ mask_off = 0x8
215
+ flags_off = 0x0
216
+ elif self.platform.architecture == Architecture.MIPS64:
217
+ handler_off = 0x8
218
+ mask_off = 0x10
219
+ flags_off = 0x0
220
+ elif ArgumentType.LONG in self._four_byte_types:
221
+ handler_off = 0x0
222
+ mask_off = 0x4
223
+ flags_off = 0x84
224
+ else:
225
+ handler_off = 0x0
226
+ mask_off = 0x8
227
+ flags_off = 0x88
228
+
229
+ # Get the old handler details out of this model
230
+ oldhandler = self.handlers.get(sig, 0)
231
+ oldmask = self.masks.get(sig, b"\0" * 128)
232
+ oldflags = self.flags.get(sig, 0)
233
+
234
+ if act != 0:
235
+ # If act is non-null, set the handler to its current contents
236
+ newhandler = self.read_integer(
237
+ act + handler_off, ArgumentType.POINTER, emulator
238
+ )
239
+ newmask = emulator.read_memory(act + mask_off, 128)
240
+ newflags = self.read_integer(act + flags_off, ArgumentType.UINT, emulator)
241
+
242
+ self.handlers[sig] = newhandler
243
+ self.masks[sig] = newmask
244
+ self.flags[sig] = newflags
245
+
246
+ if oldact != 0:
247
+ # If oldact is non-null, populate it with the old handler info
248
+ self.write_integer(
249
+ oldact + handler_off, oldhandler, ArgumentType.POINTER, emulator
250
+ )
251
+ emulator.write_memory(oldact + mask_off, oldmask)
252
+ self.write_integer(
253
+ oldact + flags_off, oldflags, ArgumentType.UINT, emulator
254
+ )
255
+
256
+ self.set_return_value(emulator, 0)
257
+
258
+
259
+ class Sigaddset(CStdModel):
260
+ name = "sigaddset"
261
+
262
+ # int sigaddset(sigset_t *set, int sig);
263
+ argument_types = [ArgumentType.POINTER, ArgumentType.INT]
264
+ return_type = ArgumentType.INT
265
+
266
+ def model(self, emulator: emulators.Emulator) -> None:
267
+ super().model(emulator)
268
+
269
+ ptr = self.get_arg1(emulator)
270
+ idx = self.get_arg2(emulator)
271
+
272
+ assert isinstance(ptr, int)
273
+ assert isinstance(idx, int)
274
+
275
+ # NOTE: This uses glibc's model of how this works.
276
+ # This only supports 64 signals for most platforms,
277
+ # 128 for MIPS.
278
+ max_idx = 64
279
+ if self.platform.architecture in (Architecture.MIPS32, Architecture.MIPS64):
280
+ max_idx = 128
281
+
282
+ # Signal numbers are one-indexed
283
+ idx -= 1
284
+
285
+ if idx < 0 or idx >= max_idx:
286
+ # Bad signal number
287
+ self.set_return_value(emulator, -1)
288
+ return
289
+
290
+ if ArgumentType.LONG in self._four_byte_types:
291
+ bitoff = idx % 32
292
+ wordoff = idx // 32
293
+ wordsize = 4
294
+ else:
295
+ bitoff = idx % 64
296
+ wordoff = idx // 64
297
+ wordsize = 8
298
+
299
+ # Read the specific word storing our bit.
300
+ # The array is LSW-first, but the words are in native byte order.
301
+ # Technically they're longs, but it's easier to handle them as ulongs.
302
+ word = self.read_integer(
303
+ ptr + (wordoff * wordsize), ArgumentType.ULONG, emulator
304
+ )
305
+ word |= 1 << bitoff
306
+ self.write_integer(
307
+ ptr + (wordoff * wordsize), word, ArgumentType.ULONG, emulator
308
+ )
309
+
310
+ self.set_return_value(emulator, 0)
311
+
312
+
313
+ class Sigaltstack(CStdModel):
314
+ name = "sigaltstack"
315
+
316
+ # int sigaltstack(const stack_t *stack, stack_t *oldstack);
317
+ argument_types = [ArgumentType.POINTER, ArgumentType.POINTER]
318
+ return_type = ArgumentType.INT
319
+
320
+ # All none of the modeled signals will use the alternate stack.
321
+ imprecise = True
322
+
323
+ def model(self, emulator: emulators.Emulator) -> None:
324
+ super().model(emulator)
325
+
326
+ # Not really modeled; just return success
327
+ self.set_return_value(emulator, 0)
328
+
329
+
330
+ class Sigdelset(CStdModel):
331
+ name = "sigdelset"
332
+
333
+ # int sigdelset(sigset_t *set, int sig);
334
+ argument_types = [ArgumentType.POINTER, ArgumentType.INT]
335
+ return_type = ArgumentType.INT
336
+
337
+ def model(self, emulator: emulators.Emulator) -> None:
338
+ super().model(emulator)
339
+
340
+ ptr = self.get_arg1(emulator)
341
+ idx = self.get_arg2(emulator)
342
+
343
+ assert isinstance(ptr, int)
344
+ assert isinstance(idx, int)
345
+
346
+ # NOTE: This uses glibc's model of how this works.
347
+ # This only supports 64 signals for most platforms,
348
+ # 128 for MIPS.
349
+ max_idx = 64
350
+ if self.platform.architecture in (Architecture.MIPS32, Architecture.MIPS64):
351
+ max_idx = 128
352
+
353
+ # Signal numbers are one-indexed
354
+ idx -= 1
355
+
356
+ if idx < 0 or idx >= max_idx:
357
+ # Bad signal number
358
+ self.set_return_value(emulator, -1)
359
+ return
360
+
361
+ if ArgumentType.LONG in self._four_byte_types:
362
+ bitoff = idx % 32
363
+ wordoff = idx // 32
364
+ wordsize = 4
365
+ else:
366
+ bitoff = idx % 64
367
+ wordoff = idx // 64
368
+ wordsize = 8
369
+
370
+ # Read the specific word storing our bit.
371
+ # The array is LSW-first, but the words are in native byte order.
372
+ # Technically they're longs, but it's easier to handle them as ulongs.
373
+ word = self.read_integer(
374
+ ptr + (wordoff * wordsize), ArgumentType.ULONG, emulator
375
+ )
376
+ word &= ~(1 << bitoff)
377
+ self.write_integer(
378
+ ptr + (wordoff * wordsize), word, ArgumentType.ULONG, emulator
379
+ )
380
+
381
+ self.set_return_value(emulator, 0)
382
+
383
+
384
+ class Sigemptyset(CStdModel):
385
+ name = "sigemptyset"
386
+
387
+ # int sigemptyset(sigset_t *set);
388
+ argument_types = [ArgumentType.POINTER]
389
+ return_type = ArgumentType.INT
390
+
391
+ def model(self, emulator: emulators.Emulator) -> None:
392
+ super().model(emulator)
393
+
394
+ ptr = self.get_arg1(emulator)
395
+
396
+ assert isinstance(ptr, int)
397
+
398
+ # NOTE: This follows the GNU standard.
399
+ # GNU only uses the first few bytes of a sigset_t.
400
+ emulator.write_memory(ptr, b"\0" * 8)
401
+
402
+ # Of course MIPS is different
403
+ if self.platform.architecture in (Architecture.MIPS32, Architecture.MIPS64):
404
+ emulator.write_memory(ptr + 8, b"\0" * 8)
405
+
406
+ self.set_return_value(emulator, 0)
407
+
408
+
409
+ class Sigfillset(CStdModel):
410
+ name = "sigfillset"
411
+
412
+ # int sigfillset(sigset_t *set);
413
+ argument_types = [ArgumentType.POINTER]
414
+ return_type = ArgumentType.INT
415
+
416
+ def model(self, emulator: emulators.Emulator) -> None:
417
+ super().model(emulator)
418
+
419
+ ptr = self.get_arg1(emulator)
420
+
421
+ assert isinstance(ptr, int)
422
+
423
+ # NOTE: This follows the GNU standard.
424
+ # GNU only uses the first few bytes of a sigset_t.
425
+ # It also excludes two real-time signals.
426
+
427
+ if ArgumentType.LONG in self._four_byte_types:
428
+ # I'd love to use ulonglong, but the word ordering isn't endian-dependent.
429
+ self.write_integer(ptr, 0x7FFFFFFF, ArgumentType.ULONG, emulator)
430
+ self.write_integer(ptr + 4, 0xFFFFFFFE, ArgumentType.ULONG, emulator)
431
+ else:
432
+ self.write_integer(ptr, 0xFFFFFFFE7FFFFFFF, ArgumentType.ULONG, emulator)
433
+
434
+ # Of course MIPS is different.
435
+ if self.platform.architecture in (Architecture.MIPS32, Architecture.MIPS64):
436
+ # All bits are set, so it doesn't matter how I write this.
437
+ self.write_integer(
438
+ ptr + 8, 0xFFFFFFFFFFFFFFFF, ArgumentType.ULONGLONG, emulator
439
+ )
440
+
441
+ self.set_return_value(emulator, 0)
442
+
443
+
444
+ class Sighold(CStdModel):
445
+ name = "sighold"
446
+
447
+ # int sighold(int sig);
448
+ argument_types = [ArgumentType.INT]
449
+ return_type = ArgumentType.INT
450
+
451
+ # This is part of a historical System V signal handler.
452
+ # Unlike sigaction and sigprocmask,
453
+ # it's not easy to localize across functions.
454
+ imprecise = True
455
+
456
+ def model(self, emulator: emulators.Emulator) -> None:
457
+ super().model(emulator)
458
+
459
+ # Not really modeled; just return success
460
+ self.set_return_value(emulator, 0)
461
+
462
+
463
+ class Sigignore(CStdModel):
464
+ name = "sigignore"
465
+
466
+ # int sigignore(int sig);
467
+ argument_types = [ArgumentType.INT]
468
+ return_type = ArgumentType.INT
469
+
470
+ # This is part of a historical System V signal handler.
471
+ # Unlike sigaction and sigprocmask,
472
+ # it's not easy to localize across functions.
473
+ imprecise = True
474
+
475
+ def model(self, emulator: emulators.Emulator) -> None:
476
+ super().model(emulator)
477
+
478
+ # Not really modeled; just return success
479
+ self.set_return_value(emulator, 0)
480
+
481
+
482
+ class Siginterrupt(CStdModel):
483
+ name = "siginterrupt"
484
+
485
+ # int siginterrupt(int sig, int flag);
486
+ argument_types = [ArgumentType.INT, ArgumentType.INT]
487
+ return_type = ArgumentType.INT
488
+
489
+ # This is part of a historical System V signal handler.
490
+ # Unlike sigaction and sigprocmask,
491
+ # it's not easy to localize across functions.
492
+ imprecise = True
493
+
494
+ def model(self, emulator: emulators.Emulator) -> None:
495
+ super().model(emulator)
496
+
497
+ # Not really modeled; just return success
498
+ self.set_return_value(emulator, 0)
499
+
500
+
501
+ class Sigismember(CStdModel):
502
+ name = "sigismember"
503
+
504
+ # int sigismember(sigset_t *set, int sig);
505
+ argument_types = [ArgumentType.POINTER, ArgumentType.INT]
506
+ return_type = ArgumentType.INT
507
+
508
+ def model(self, emulator: emulators.Emulator) -> None:
509
+ super().model(emulator)
510
+
511
+
512
+ class Sigpause(CStdModel):
513
+ name = "sigpause"
514
+
515
+ # int sigpause(int arg);
516
+ argument_types = [ArgumentType.POINTER, ArgumentType.INT]
517
+ return_type = ArgumentType.INT
518
+
519
+ def model(self, emulator: emulators.Emulator) -> None:
520
+ super().model(emulator)
521
+
522
+ # This one's fun. If it never gets signaled, it never returns.
523
+ raise NotImplementedError(f"No idea how to correctly model {self.name}")
524
+
525
+
526
+ class Sigpending(Sigemptyset):
527
+ name = "sigpending"
528
+
529
+ # int sigpending(sigset_t *set);
530
+
531
+ # We don't support signals.
532
+ # If you need pending signals, this will be a problem
533
+ imprecise = True
534
+
535
+ # Since we don't support signals, no signals will ever be pending.
536
+ # This is semantically equivalent to sigemptyset()
537
+
538
+
539
+ class Sigprocmask(PthreadSigmask):
540
+ name = "sigprocmask"
541
+
542
+ # int sigprocmask(int, const sigset_t *set, sigset_t *oldset);
543
+
544
+ # Without threads, this is identical to PthreadSigmask
545
+
546
+
547
+ class Sigqueue(CStdModel):
548
+ name = "sigqueue"
549
+
550
+ # int sigqueue(pid_t pid, int sig, const union sigval);
551
+ argument_types = [ArgumentType.INT, ArgumentType.INT, ArgumentType.POINTER]
552
+ return_type = ArgumentType.INT
553
+
554
+ # This doesn't actually send a signal
555
+ imprecise = True
556
+
557
+ def model(self, emulator: emulators.Emulator) -> None:
558
+ super().model(emulator)
559
+
560
+ # Not really modeled; just return success
561
+ self.set_return_value(emulator, 0)
562
+
563
+
564
+ class Sigrelse(CStdModel):
565
+ name = "sigrelse"
566
+
567
+ # int sigrelse(int sig);
568
+ argument_types = [ArgumentType.INT]
569
+ return_type = ArgumentType.INT
570
+
571
+ # This is part of a historical System V signal handler.
572
+ # Unlike sigaction and sigprocmask,
573
+ # it's not easy to localize across functions.
574
+ imprecise = True
575
+
576
+ def model(self, emulator: emulators.Emulator) -> None:
577
+ super().model(emulator)
578
+
579
+ # Not really modeled; just return success
580
+ self.set_return_value(emulator, 0)
581
+
582
+
583
+ class Sigset(CStdModel):
584
+ name = "sigset"
585
+
586
+ # typedef void (*sighandler_t)(int);
587
+ # sighandler_t sigset(int, sighandler_t handler);
588
+ argument_types = [ArgumentType.INT, ArgumentType.POINTER]
589
+ return_type = ArgumentType.INT
590
+
591
+ # This is part of a historical System V signal handler.
592
+ # Unlike sigaction and sigprocmask,
593
+ # it's not easy to localize across functions.
594
+ imprecise = True
595
+
596
+ def model(self, emulator: emulators.Emulator) -> None:
597
+ super().model(emulator)
598
+
599
+ # Not really modeled; just return success
600
+ self.set_return_value(emulator, 0)
601
+
602
+
603
+ class Sigsuspend(CStdModel):
604
+ name = "sigsuspend"
605
+
606
+ # int sigsuspend(sigset_t *set);
607
+ argument_types = [ArgumentType.POINTER]
608
+ return_type = ArgumentType.INT
609
+
610
+ def model(self, emulator: emulators.Emulator) -> None:
611
+ super().model(emulator)
612
+
613
+ # This one's fun. If it never gets signaled, it never returns.
614
+ raise NotImplementedError(f"No idea how to correctly model {self.name}")
615
+
616
+
617
+ class Sigtimedwait(CStdModel):
618
+ name = "sigtimedwait"
619
+
620
+ # int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timespec);
621
+ argument_types = [ArgumentType.POINTER, ArgumentType.POINTER, ArgumentType.POINTER]
622
+ return_type = ArgumentType.INT
623
+
624
+ # This model assumes it always times out,
625
+ # even if no timeout was specified
626
+ imprecise = True
627
+
628
+ def model(self, emulator: emulators.Emulator) -> None:
629
+ super().model(emulator)
630
+
631
+ # Not really modeled; just return.
632
+ # TODO: This API relies on errno
633
+ self.set_return_value(emulator, -1)
634
+
635
+
636
+ class Sigwait(CStdModel):
637
+ name = "sigwait"
638
+
639
+ # int sigwait(const sigset_t *set, int *sig);
640
+ argument_types = [ArgumentType.POINTER, ArgumentType.POINTER]
641
+ return_type = ArgumentType.INT
642
+
643
+ def model(self, emulator: emulators.Emulator) -> None:
644
+ super().model(emulator)
645
+
646
+ # This one's fun. If it never gets signaled, it never returns.
647
+ raise NotImplementedError(f"No idea how to correctly model {self.name}")
648
+
649
+
650
+ class Sigwaitinfo(CStdModel):
651
+ name = "sigwaitinfo"
652
+
653
+ # int sigwaitinfo(const sigset_t *set, siginfo_t *sig);
654
+ argument_types = [ArgumentType.POINTER, ArgumentType.POINTER]
655
+ return_type = ArgumentType.INT
656
+
657
+ def model(self, emulator: emulators.Emulator) -> None:
658
+ super().model(emulator)
659
+
660
+ # This one's fun. If it never gets signaled, it never returns.
661
+ raise NotImplementedError(f"No idea how to correctly model {self.name}")
662
+
663
+
664
+ __all__ = [
665
+ "BsdSignal",
666
+ "Kill",
667
+ "Killpg",
668
+ "PthreadKill",
669
+ "PthreadSigmask",
670
+ "Sigaction",
671
+ "Sigaddset",
672
+ "Sigaltstack",
673
+ "Sigdelset",
674
+ "Sigemptyset",
675
+ "Sigfillset",
676
+ "Sighold",
677
+ "Sigignore",
678
+ "Siginterrupt",
679
+ "Sigismember",
680
+ "Sigpause",
681
+ "Sigpending",
682
+ "Sigprocmask",
683
+ "Sigqueue",
684
+ "Sigrelse",
685
+ "Sigset",
686
+ "Sigsuspend",
687
+ "Sigtimedwait",
688
+ "Sigwait",
689
+ "Sigwaitinfo",
690
+ ]
@@ -0,0 +1 @@
1
+ from .systemv import __all__ as __sysv__ # noqa: F401
@@ -0,0 +1,6 @@
1
+ from .c99 import * # noqa: F401,F403
2
+ from .c99 import __all__ as __c99__
3
+ from .posix import * # noqa: F401,F403
4
+ from .posix import __all__ as __posix__
5
+
6
+ __all__ = __c99__ + __posix__
@@ -0,0 +1,12 @@
1
+ from .signal import * # noqa F401,F403
2
+ from .signal import __all__ as __signal__
3
+ from .stdio import * # noqa F401,F403
4
+ from .stdio import __all__ as __stdio__
5
+ from .stdlib import * # noqa F401,F403
6
+ from .stdlib import __all__ as __stdlib__
7
+ from .string import * # noqa F401,F403
8
+ from .string import __all__ as __string__
9
+ from .time import * # noqa F401,F403
10
+ from .time import __all__ as __time__
11
+
12
+ __all__ = __signal__ + __stdlib__ + __string__ + __stdio__ + __time__