Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/efivarfs.c b/src/efivarfs.c
index 1c2fe04..0cb05ff 100644
--- a/src/efivarfs.c
+++ b/src/efivarfs.c
@@ -234,6 +234,8 @@ efivarfs_set_variable(efi_guid_t guid, const char *name, uin
#if 1
memcpy(buf, &attributes, sizeof (attributes));
memcpy(buf + sizeof (attributes), data, data_size);
+ errno = ENOSPC;
+ return -1;
fenchurch:~/devel/github.com/efibootmgr$ sudo ./src/efibootmgr/efibootmgr -c -b 001B -d /dev/sda -l '\EFI\fedora\rhshim.efi' -L foo
Could not prepare boot variable: No space left on device
/**
Retrieves the magic value from the PE/COFF header.
@param Hdr The buffer in which to return the PE32, PE32+, or TE header.
@return EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC - Image is PE32
@return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC - Image is PE32+
**/
UINT16
00000000 4d 5a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |MZ..............|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 |................|
00000040 0e 1f ba 0e 00 b4 cd 09 21 b8 4c 01 54 68 65 20 |........!.L.The |
00000050 6f 6e 6c 79 20 77 69 6e 6e 69 6e 67 20 6d 6f 76 |only winning mov|
00000060 65 20 69 73 20 6e 6f 74 20 74 6f 20 70 6c 61 79 |e is not to play|
00000070 2e 0d 0d 0a 24 00 00 00 00 00 00 00 00 00 00 00 |....$...........|
00000080 50 45 00 00 64 86 02 00 00 00 00 00 00 00 00 00 |PE..d...........|
@vathpela
vathpela / .gitconfig
Last active August 29, 2015 14:06
github pull requests from the command line without adding remotes for everybody's private branches
# this works in repo/.git/config as well as just putting it in ~/.gitconfig
# and having it work magically for all repos
[remote "origin"]
fetch = +refs/pull/*/head:refs/pull/*

Keybase proof

I hereby claim:

  • I am vathpela on github.
  • I am vathpela (https://keybase.io/vathpela) on keybase.
  • I have a public key whose fingerprint is B00B 48BC 731A A884 0FED 9FB0 EED2 66B7 0F4F EF10

To claim this, I am signing this object:

@vathpela
vathpela / Makefile
Last active August 29, 2015 14:08
rc4
rc4 : rc4.c
gcc -funsigned-char -o $@ $^
typedef struct {
efi_guid_t SignatureOwner; // who owns this entry
uint8_t SignatureData[0]; // the data we want to
// fish out of this thing
} EFI_SIGNATURE_DATA;
typedef struct {
efi_guid_t SignatureType; // type of structure in
// EFI_SIGNATURE_DATA.SignatureData
uint32_t SignatureListSize; // Total size of the signature
fenchurch:~/Downloads$ ~/devel/github.com/dbxtool/src/dbxtool -d dbxupdate.bin -l
1: {microsoft} {sha256} 80b4d96931bf0d02fd91a61e19d14f1da452e66db2408ca8604d411f92659f0a
2: {microsoft} {sha256} f52f83a3fa9cfbd6920f722824dbe4034534d25b8507246b3b957dac6e1bce7a
3: {microsoft} {sha256} c5d9d8a186e2c82d09afaa2a6f7f2e73870d3e64f72c4e08ef67796a840f0fbd
4: {microsoft} {sha256} 363384d14d1f2e0b7815626484c459ad57a318ef4396266048d058c5a19bbf76
5: {microsoft} {sha256} 1aec84b84b6c65a51220a9be7181965230210d62d6d33c48999c6b295a2b0a06
6: {microsoft} {sha256} e6ca68e94146629af03f69c2f86e6bef62f930b37c6fbcc878b78df98c0334e5
7: {microsoft} {sha256} c3a99a460da464a057c3586d83cef5f4ae08b7103979ed8932742df0ed530c66
8: {microsoft} {sha256} 58fb941aef95a25943b3fb5f2510a0df3fe44c58c95e0ab80487297568ab9771
9: {microsoft} {sha256} 5391c3a2fb112102a6aa1edc25ae77e19f5d6f09cd09eeb2509922bfcd5992ea
fenchurch:~/Downloads$ efivar -L
{00000000-0000-0000-0000-000000000000} {zero} efi_guid_zero zeroed sentinal guid
{ff3e5307-9fd0-48c9-85f1-8ad56c701e01} {sha384} efi_guid_sha384 SHA-384
{826ca512-cf10-4ac9-b187-be01496631bd} {sha1} efi_guid_sha1 SHA-1
{a7717414-c616-4977-9420-844712a735bf} {rsa2048_sha256_cert} efi_guid_rsa2048_sha256_cert RSA 2048 with SHA-256 Certificate
{82988420-7467-4490-9059-feb448dd1963} {lenovo_me_config} efi_guid_lenovo_me_config Lenovo ME Configuration Menu
{c1c41626-504c-4092-aca9-41f936934328} {sha256} efi_guid_sha256 SHA-256
{126a762d-5758-4fca-8531-201a7f57f850} {lenovo_boot_menu} efi_guid_lenovo_boot_menu Lenovo Boot Menu
{0b6e5233-a65c-44c9-9407-d9ab83bfc8bd} {sha224} efi_guid_sha224 SHA-224
{67f8444f-8743-48f1-a328-1eaab8736080} {rsa2048_sha1} efi_guid_rsa2048_sha1 RSA 2048 with SHA-1