3/28/2016

CorePy (Python Assembly language on EFI Shell)

Sample code name
https://github.com/EfiPy/EfiPy2/blob/main/Efi/Apps/CorepySample/asm.py

Description
For low level controlling by Python language in UEFI shell environment, EfiPy2 leverages another open source project CorePy.

Sample Code: output 0xAA to port 0x80
1. Download latest EfiPy from https://github.com/EfiPy/EfiPy2
2. Copy Disk/EFI folder to boot device, which does not includes bootable shell, yet.
3. Copy asm.py to EFI/Tools.
4. Boot into shell and change working folder to fsx:\EFI\tools
5. Run "Python.efi asm.py"

Source code
code.add(x86.mov(dx, 0x80))
code.add(x86.mov(ax, 0xaa))
code.add(x86.out(dx, ax))

proc.execute(code)


Result



No comments:

Post a Comment