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

Commit

Permalink
Merge pull request #6 from unexpected-eof/hotfix/0.2
Browse files Browse the repository at this point in the history
section name UTF16 problem
  • Loading branch information
tuxuser committed Dec 21, 2015
2 parents ed766be + eb1b7ee commit 264cf75
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions OZMTool/ozmtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,16 @@ UINT8 OZMTool::Kext2Ffs(QString inputdir, QString outputdir)
return ERR_ERROR;
}

filepath = pathConcatenate(outputdir, currKext.baseName() + "Kext" + ".ffs");
// use std filenaming for kexts
filepath = pathConcatenate(outputdir, currKext.baseName() /*+ "Kext"*/ + ".ffs");
fileWrite(filepath, out);
if(ret) {
printf("ERROR: Saving '%s' failed!\n", qPrintable(filepath));
return ERR_ERROR;
}

filepath = pathConcatenate(outputdir, currKext.fileName() + ".ffs.compressed");
// use std filenaming for kexts
filepath = pathConcatenate(outputdir, currKext.baseName() /*.fileName()*/ + ".ffs.compressed");
fileWrite(filepath, compressedOut);
if(ret) {
printf("ERROR: Saving '%s' failed!\n", qPrintable(filepath));
Expand Down
12 changes: 9 additions & 3 deletions OZMTool/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ UINT8 convertKext(QString input, QString guid, QString basename, QByteArray & ou
if (ret) {
printf("Info: Unable to get version string...\n");
sectionName = basename;
}
else
} else {
sectionName.sprintf("%s.Rev-%s",qPrintable(basename), qPrintable(bundleVersion));
}

toConvertBinary.append(plistbuf);
toConvertBinary.append(nullterminator);
Expand Down Expand Up @@ -428,7 +428,13 @@ UINT8 freeformCreate(QByteArray binary, QString guid, QString sectionName, QByte
printf("ERROR: Failed to create PE32 Section!\n");
return ERR_ERROR;
}
ret = sectionCreate(QByteArray((const char*)sectionName.utf16()), EFI_SECTION_USER_INTERFACE, userSection);

// somehow this doesn't create the correct UTF string
// ret = sectionCreate(QByteArray((const char*)sectionName.utf16()), EFI_SECTION_USER_INTERFACE, userSection);
// use workaround
QByteArray ba;
ba.append( (const char*) sectionName.utf16(), sectionName.size() * 2 );
ret = sectionCreate(ba, EFI_SECTION_USER_INTERFACE, userSection);
if (ret) {
printf("ERROR: Failed to create User Interface Section!\n");
return ERR_ERROR;
Expand Down

0 comments on commit 264cf75

Please sign in to comment.