Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

Commit

Permalink
Shift base relocation virtualAddress if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxuser committed Jul 22, 2014
1 parent ffb0735 commit 90d820d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion OZMTool/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,16 +562,24 @@ UINT8 injectDSDTintoAmiboardInfo(QByteArray ami, QByteArray dsdtbuf, QByteArray

baseRelocAddr += EFI_IMAGE_SIZEOF_BASE_RELOCATION + (physEntries * EFI_IMAGE_SIZEOF_RELOC_ENTRY);
dataLeft -= (physEntries * EFI_IMAGE_SIZEOF_RELOC_ENTRY) + EFI_IMAGE_SIZEOF_BASE_RELOCATION;
index++;


printf(" - Relocation Table %X:\n", index);
index++;

if(BASE_RELOCATION->VirtualAddress < (UINT32)offset) {
printf("\tNothing to do here - VirtualAddress < DSDTOffset (%X < %X)\n",
BASE_RELOCATION->VirtualAddress, offset);
continue;
}

//Testing first relocation entry should be good..
UINT32 shiftBy = ((UINT32)RELOCATION_ENTRIES[0].offset + alignDiffDSDT) & 0xF000;

printf(" - VirtualAddress: %X --> %X\n",
BASE_RELOCATION->VirtualAddress,
BASE_RELOCATION->VirtualAddress += shiftBy);

for(int j=0; j<logicalEntries; j++) {
printf(" - Relocation: %X\n", j);
printf("\tOffset: %X --> %X\n",
Expand Down

0 comments on commit 90d820d

Please sign in to comment.