From d1ae3f2ba64f76094d38cc1d9f06ecab68292c30 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Wed, 27 Mar 2019 20:39:56 +0300 Subject: [PATCH] TestsUser: Fix broken logic in Prelinked.c --- TestsUser/Prelinked/Prelinked.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/TestsUser/Prelinked/Prelinked.c b/TestsUser/Prelinked/Prelinked.c index 9b91b437..767cbb59 100644 --- a/TestsUser/Prelinked/Prelinked.c +++ b/TestsUser/Prelinked/Prelinked.c @@ -473,12 +473,16 @@ int main(int argc, char** argv) { CHAR8 *TestPlist = LiluKextInfoPlistData; UINT32 TestPlistSize = LiluKextInfoPlistDataSize; + int c = 0; + while (argc > 2) { if (argc > 2) { TestData = readFile(argv[2], &TestDataSize); if (TestData == NULL) { printf("Read data fail\n"); return -1; + } else { + printf("Read data success\n"); } } @@ -487,15 +491,20 @@ int main(int argc, char** argv) { if (TestPlist == NULL) { printf("Read plist fail\n"); return -1; + } else { + printf("Read plist success\n"); } } + char KextPath[64]; + snprintf(KextPath, sizeof(KextPath), "/Library/Extensions/Kex%d.kext", c); + Status = PrelinkedInjectKext ( &Context, - "/Library/Extensions/Lilu.kext", + KextPath TestPlist, TestPlistSize, - "Contents/MacOS/Lilu", + "Contents/MacOS/Kext", TestData, TestDataSize ); @@ -503,6 +512,8 @@ int main(int argc, char** argv) { DEBUG ((DEBUG_WARN, "%s injected - %r\n", argc > 2 ? "Passed.kext" : "Lilu.kext", Status)); argc -= 2; + argv += 2; + c++; } #ifndef TEST_SLE