flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Problem with my BOOTx64.efi application [Solved]

Author
Thread Post new topic Reply to topic
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 04 Apr 2020, 18:40
Hello, i have problem. I have coded BOOTx64.efi application to test EFI Programming. I have formatted one of my USB to GPT partition schema, and fat32 format. I have made /BOOT/EFI directories and put my BOOTx64.efi program into this directories.

But when i choose my USB into VirtualBox, nothing append.

Is it not the good way ?

Code:
format pe64 dll efi
entry Main

section '.text' code executable readable

Main:
sub rsp,0x20
mov [Handle],rcx
mov [SystemTable],rdx
lea rdx,[Message]
mov rcx,[SystemTable]
add rcx,[EFISystemTable.ConOut]
call rcx
add rsp,0x20
mov eax,0x0
retn

include "EFIVariables/EFISystemTable.fasm"

section '.data' data readable writeable

Handle:      dq ?
SystemTable: dq ?
Message:     db "* Fulgurance: Test UEFI Ok",13,10,0

section '.reloc' fixups data discardable
    


(I have made custom library with official UEFI documentattion: https://uefi.org/specifications)


Last edited by Fulgurance on 08 Apr 2020, 22:55; edited 1 time in total
Post 04 Apr 2020, 18:40
View user's profile Send private message Reply with quote
Feryno



Joined: 23 Mar 2005
Posts: 514
Location: Czech republic, Slovak republic
Feryno 05 Apr 2020, 20:43
pls check with disassembler how is this line assembled into binary:
Code:
add rcx,[EFISystemTable.ConOut]    

it seems like something is added from some position in memory [...]
when correct it should assemble into something like add rcx,value where value is the offset of ConOut in EFISystemTable which is hexadecimal 40h so it should be add rcx,40h
Post 05 Apr 2020, 20:43
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 08 Apr 2020, 22:59
Can you remove this post please ?
Post 08 Apr 2020, 22:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 08 Apr 2020, 23:03
Fulgurance wrote:
Can you remove this post please ?
Why? It might help someone else in the future.
Post 08 Apr 2020, 23:03
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.