Created
March 16, 2013 06:02
-
-
Save ericbroska/5175201 to your computer and use it in GitHub Desktop.
Fake Security dylib that makes Receigen suck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ericbroska | |
// Fake Security dylib that makes Receigen suck | |
// | |
// Usage: | |
// ---------------------- | |
// 1) compile this file: | |
// $ clang -dynamiclib -current_version 1.0.0 -compatibility_version 1.0.0 -Wl,-init,_m__n -framework Cocoa -framework Security -lcrypto -o .fakefakefakefakefakesecurity.dylib AntiReceigenSec.m | |
// | |
// 2) copy the generated «.fakefakefakefakefakesecurity.dylib» to, say, ./Target.app/Contents/Resources/ | |
// (yes, you can choose any other path inside a target application's bunlde); | |
// | |
// 3) open the app's executable, search and replace string | |
// /System/Library/Frameworks/Security.framework/Versions/A/Security | |
// with | |
// @executable_path/../Resources/.fakefakefakefakefakesecurity.dylib | |
// | |
// 4) codesign the app | |
// | |
// 5) profit goes here! | |
#import <Cocoa/Cocoa.h> | |
#include <Security/SecAsn1Types.h> | |
// A target app expects us to export these sybols | |
const SecAsn1Template kSecAsn1IA5StringTemplate[] = { 'C', 'N', 'C' }; | |
const SecAsn1Template kSecAsn1IntegerTemplate[] = { 'h', 'a', 's' }; | |
const SecAsn1Template kSecAsn1UTF8StringTemplate[] = { 'y', 'o', 'u' }; | |
int m__n(void) | |
{ | |
return NSApplicationMain(0, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment