notahacker8 / MacInject

A dylib (dynamic library) injector for MacOS.
6 stars 3 forks source link

kern error: (os/kern) failure #1

Open 1337kingOf opened 1 year ago

1337kingOf commented 1 year ago

on mac m1 trying to inject to any process this dylib

include

include

include

include <CoreFoundation/CoreFoundation.h>

include <CoreGraphics/CoreGraphics.h>

include <CoreServices/CoreServices.h>

include <ApplicationServices/ApplicationServices.h>

// Function to display a pop-up window void displayPopup() { // Create a CFStringRef containing your message CFStringRef message = CFStringCreateWithCString(NULL, "All ok", kCFStringEncodingUTF8);

// Create a dictionary for the user notification
CFMutableDictionaryRef dict = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionaryAddValue(dict, kCFUserNotificationAlertMessageKey, message);

// Create a user notification
SInt32 error;
CFUserNotificationRef userNotification = CFUserNotificationCreate(NULL, 0, kCFUserNotificationPlainAlertLevel, &error, dict);

// Display the notification
CFOptionFlags response;
CFUserNotificationReceiveResponse(userNotification, 0, &response);

// Clean up
CFRelease(message);
CFRelease(dict);
CFRelease(userNotification);

}

// Entry point when the library is loaded attribute((constructor)) void libraryLoad() { displayPopup(); }

and getting error

notahacker8 commented 1 year ago

Hi, is the target process running natively or running under Rosetta?

notahacker8 commented 1 year ago

I updated the code to show what line the error is on.

1337kingOf commented 1 year ago

how to understand , rosetta or no?

1337kingOf commented 1 year ago

and by the way do u know how to dump local items keychain, or decrypt it with no every time ask for every item password

notahacker8 commented 1 year ago

how to understand , rosetta or no?

The injector for arm64 doesn't work on intel applications running on apple silicon.

and by the way do u know how to dump local items keychain, or decrypt it with no every time ask for every item password

No, but for my project, I added the debugging tool entitlement in Xcode to allow for injection without entering a password every time.

Also, the injector will not work if you run in Xcode. You will have to build it first, then use it.

1337kingOf commented 1 year ago

how to check process arm or no ?

1337kingOf commented 1 year ago

yeah im injecting my arm app, arm library to arm arch, and not working

notahacker8 commented 1 year ago

how to check process arm or no ?

Activity monitor will show if an app is Intel or Apple

The most recent version of the code should show you what line the error is on now.

1337kingOf commented 1 year ago

give ur telegram