Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
x0l committed Feb 13, 2014
0 parents commit dd6f3d1
Show file tree
Hide file tree
Showing 16 changed files with 1,401 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# OS X
.DS_Store

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa

# CocoaPods
Pods

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# RSInjector

Rocksmith 2014 uses a DSA signature to verify the authenticity of songs.
This app is a runtime patch for Rocksmith 2014 OSX which allows playing
custom CDLC content.

See [http://forums.smithyanvil.com/](http://forums.smithyanvil.com/) for more info
Binary file added RS2014.icns
Binary file not shown.
251 changes: 251 additions & 0 deletions RSBypass/RSBypass.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
43D7132E1829382F0089274E /* RSBypass-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 43D71327182937A10089274E /* RSBypass-Prefix.pch */; };
43D7132F182938310089274E /* RSBypass.h in Headers */ = {isa = PBXBuildFile; fileRef = 43D71328182937A10089274E /* RSBypass.h */; };
43D713301829383C0089274E /* RSBypass.m in Sources */ = {isa = PBXBuildFile; fileRef = 43D71329182937A10089274E /* RSBypass.m */; };
FA88A0861680711D00915B81 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA88A0851680711D00915B81 /* Cocoa.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
43D71327182937A10089274E /* RSBypass-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "RSBypass-Prefix.pch"; path = "RSBypass/RSBypass-Prefix.pch"; sourceTree = SOURCE_ROOT; };
43D71328182937A10089274E /* RSBypass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RSBypass.h; path = RSBypass/RSBypass.h; sourceTree = SOURCE_ROOT; };
43D71329182937A10089274E /* RSBypass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RSBypass.m; path = RSBypass/RSBypass.m; sourceTree = SOURCE_ROOT; };
FA88A0821680711D00915B81 /* RSBypass.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = RSBypass.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
FA88A0851680711D00915B81 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
FA88A0881680711D00915B81 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
FA88A08A1680711D00915B81 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
FA88A07F1680711D00915B81 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FA88A0861680711D00915B81 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
FA88A0771680711D00915B81 = {
isa = PBXGroup;
children = (
FA88A08B1680711D00915B81 /* RSBypass */,
FA88A0841680711D00915B81 /* Frameworks */,
FA88A0831680711D00915B81 /* Products */,
);
sourceTree = "<group>";
};
FA88A0831680711D00915B81 /* Products */ = {
isa = PBXGroup;
children = (
FA88A0821680711D00915B81 /* RSBypass.dylib */,
);
name = Products;
sourceTree = "<group>";
};
FA88A0841680711D00915B81 /* Frameworks */ = {
isa = PBXGroup;
children = (
FA88A08A1680711D00915B81 /* Foundation.framework */,
FA88A0881680711D00915B81 /* AppKit.framework */,
FA88A0851680711D00915B81 /* Cocoa.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
FA88A08B1680711D00915B81 /* RSBypass */ = {
isa = PBXGroup;
children = (
43D71327182937A10089274E /* RSBypass-Prefix.pch */,
43D71328182937A10089274E /* RSBypass.h */,
43D71329182937A10089274E /* RSBypass.m */,
);
name = RSBypass;
path = CalculatorOverrides;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
FA88A0801680711D00915B81 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
43D7132F182938310089274E /* RSBypass.h in Headers */,
43D7132E1829382F0089274E /* RSBypass-Prefix.pch in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
FA88A0811680711D00915B81 /* RSBypass */ = {
isa = PBXNativeTarget;
buildConfigurationList = FA88A0931680711D00915B81 /* Build configuration list for PBXNativeTarget "RSBypass" */;
buildPhases = (
FA88A07E1680711D00915B81 /* Sources */,
FA88A07F1680711D00915B81 /* Frameworks */,
FA88A0801680711D00915B81 /* Headers */,
);
buildRules = (
);
dependencies = (
);
name = RSBypass;
productName = CalculatorOverrides;
productReference = FA88A0821680711D00915B81 /* RSBypass.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
FA88A0791680711D00915B81 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Alexandre Colucci";
};
buildConfigurationList = FA88A07C1680711D00915B81 /* Build configuration list for PBXProject "RSBypass" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = FA88A0771680711D00915B81;
productRefGroup = FA88A0831680711D00915B81 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
FA88A0811680711D00915B81 /* RSBypass */,
);
};
/* End PBXProject section */

/* Begin PBXSourcesBuildPhase section */
FA88A07E1680711D00915B81 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
43D713301829383C0089274E /* RSBypass.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
FA88A0911680711D00915B81 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx10.8;
VALID_ARCHS = i386;
};
name = Debug;
};
FA88A0921680711D00915B81 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx10.8;
VALID_ARCHS = i386;
};
name = Release;
};
FA88A0941680711D00915B81 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RSBypass/RSBypass-Prefix.pch";
PRODUCT_NAME = RSBypass;
SDKROOT = macosx10.8;
VALID_ARCHS = i386;
};
name = Debug;
};
FA88A0951680711D00915B81 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RSBypass/RSBypass-Prefix.pch";
PRODUCT_NAME = RSBypass;
SDKROOT = macosx10.8;
VALID_ARCHS = i386;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
FA88A07C1680711D00915B81 /* Build configuration list for PBXProject "RSBypass" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FA88A0911680711D00915B81 /* Debug */,
FA88A0921680711D00915B81 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FA88A0931680711D00915B81 /* Build configuration list for PBXNativeTarget "RSBypass" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FA88A0941680711D00915B81 /* Debug */,
FA88A0951680711D00915B81 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = FA88A0791680711D00915B81 /* Project object */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions RSBypass/RSBypass/RSBypass-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'CalculatorOverrides' target in the 'CalculatorOverrides' project
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
5 changes: 5 additions & 0 deletions RSBypass/RSBypass/RSBypass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>

@interface RSBypass : NSObject

@end
57 changes: 57 additions & 0 deletions RSBypass/RSBypass/RSBypass.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <sys/mman.h>
#include <mach/mach.h>

#import "RSBypass.h"

typedef uint32_t DWORD;
typedef int8_t BYTE;


// These numbers come from otool -lv
const DWORD segStart = 0x001000;
const size_t segLen = 0x0135b000;

// Could be made more general to bypass all signature checks
// including ini files...
// For the time being only patches the sig verif of sng files
const char* hint = "\x0f\x84\xc6\x0a\x00\x00";


bool bCompare(const BYTE* pData, const BYTE * bMask, const char* szMask) {
for (; *szMask; ++szMask, ++pData, ++bMask)
if (*szMask == 'x' && *pData != *bMask)
return 0;
return (*szMask) == 0;
}

void* FindPattern(DWORD dwAddress, size_t dwLen, BYTE* bMask, char* szMask) {
for (DWORD i = 0; i < dwLen; i++)
if (bCompare((BYTE*)(dwAddress + i), bMask, szMask))
return (void*)(dwAddress + i);
return NULL;
}


@implementation RSBypass
+(void)load
{
void* ptr = FindPattern(segStart, segLen,
(BYTE*)hint, "xxxxxx");
if (ptr) {

long page_size = sysconf(_SC_PAGESIZE);
void* page_start = (long)ptr & -page_size;

// NSLog(@"Removing memory protection");
mprotect(page_start, page_size, PROT_READ | PROT_WRITE | PROT_EXEC);

// NSLog(@"RSInjector: Bypassing signature check at %p", ptr);
memset(ptr, 0x90, 6);
msync(ptr, 6, MS_SYNC);

// Restoring memory protection
mprotect(page_start, page_size, PROT_READ | PROT_EXEC);

}
}
@end
Loading

0 comments on commit dd6f3d1

Please sign in to comment.