Sunday, March 27, 2016

CorePy (Python Assembly language on EFI Shell)

Sample code name
https://svn.code.sf.net/u/efipy/svn/Trunk/MemIo/asm.py

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

Sample Code: output 0xAA to port 0x80
1. Download latest EfiPy from https://sourceforge.net/projects/efipy/
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"

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

proc.execute(code)



No comments:

Post a Comment