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

Commit

Permalink
Clarify a check + Add ToDo-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxuser committed Jul 21, 2014
1 parent d60f3f3 commit 8ded294
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions OZMTool/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define ALIGN16(Value) (((Value)+15) & ~15)
#define ALIGN32(Value) (((Value)+31) & ~31)

#define MAX_DSDT 0x3FFFF

const static QString ozmDefaultsFilename = "OzmosisDefaults.plist";
static const QString DSDTFilename = "DSDT.aml";
const static QString kextGUID = "DADE100%1-1B31-4FE4-8557-26FCEFC78275";
Expand Down
7 changes: 5 additions & 2 deletions OZMTool/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ UINT8 injectDSDTintoAmiboardInfo(QByteArray amiboardbuf, QByteArray dsdtbuf, QBy

printf(" * Patching addresses in code\n");

UINT32 noIdeaWhyOverheadNeeded = 0x80; // <--- WHAT IT SAYS ?!?
UINT32 noIdeaWhyOverheadNeeded = 0x80; // <--- ToDo: FIXME
const static UINT32 MAX_INSTRUCTIONS = 1000;
_DInst decomposed[MAX_INSTRUCTIONS];
_DecodedInst disassembled[MAX_INSTRUCTIONS];
Expand Down Expand Up @@ -741,7 +741,7 @@ UINT8 injectDSDTintoAmiboardInfo(QByteArray amiboardbuf, QByteArray dsdtbuf, QBy

for (int i = 0; i < decodedInstructionsCount; i++) {

if((decomposed[i].disp < 0x900)||decomposed[i].disp > (0x3FFFF & 0xFF000))
if((decomposed[i].disp < (UINT64)offset)||decomposed[i].disp > (MAX_DSDT & 0xFF000))
continue;

printf("%s%s%s --> 0x%llx\r\n",
Expand All @@ -751,13 +751,16 @@ UINT8 injectDSDTintoAmiboardInfo(QByteArray amiboardbuf, QByteArray dsdtbuf, QBy
decomposed[i].disp += alignment);
}

/* ToDo: Assemble patched code */

printf("\n\nOriginal AmiBoardInfo Sz: %X\n", amiboardbuf.size());
printf("DSDT is located @ %X\n", offset);
printf("Old DSDT Sz: %X\n", oldDSDTsize);
printf("New DSDT Sz: %X\n", newDSDTsize);
printf("Diff DSDT (old/new): %X - aligned: %X\n",diffDSDT, alignment);

/* ToDo: Clean up the following mess ? Maybe.. */
/* ToDo: Stuff new RELOCATION Section + patched .DATA Section in outputfile */

/* Copy unmodified DOSHeader, modded NTHeader & modded SectionHeader */
out.append(amiboardbuf.constData(), HeaderDOS->e_lfanew);
Expand Down

0 comments on commit 8ded294

Please sign in to comment.