Skip to content

Instantly share code, notes, and snippets.

@smirn0v
smirn0v / gist:dbe14b2329c528acbe1e
Created November 4, 2015 13:24
loader_path fix
install_name_tool -change "@loader_path/../Frameworks/libetpan.framework/Versions/A/libetpan" "@loader_path/thirdparty/libetpan.framework/Versions/A/libetpan" a.out
Alexander-Smirnov-MBP:libetpan-smtp smirnov$ ./a.out
@smirn0v
smirn0v / gist:467fca27bb75452f9f08
Created August 18, 2015 13:25
have alpha channel
function methImpl_UIImage__isInvisibleAndGetIsTranslucent_ {
rbx = rdx;
rax = objc_getAssociatedObject(rdi, ___imageIsInvisibleKey);
r14 = rax;
rax = objc_getAssociatedObject(rdi, ___imageIsTranslucentKey);
r15 = rax;
if (r14 != 0x0) goto loc_0x40052;
goto loc_3fe1b;
loc_40052:
@smirn0v
smirn0v / gist:0b4fefcb5d2452f716b1
Last active February 12, 2018 15:54
Debugserver
$ cd /Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
# choose your platform
$ cd 7.1
# mount developer disk image
$ hdiutil attach DeveloperDiskImage.dmg
# copy debugserver
$ cp /Volumes/DeveloperDiskImage/usr/bin/debugserver ~/
$ cd ~/
# prepare entitlements
$ cat > entitlements.plist << 'EOF'
run 'debugserver' on iphone
setup imux
run lldb
(lldb) platform select remote-ios
(lldb) process connect connect://127.0.0.1:31338
@smirn0v
smirn0v / gist:e5d9ede3aec14d509da8
Created November 7, 2014 11:01
lldb info mach-regions
image dump sections
@smirn0v
smirn0v / gist:af8f103a9c8809d64b62
Created November 3, 2014 16:29
c include path
kamaraju kusumanchi <[email protected]> writes:
> Instead of using -L, I frequently use LD_LIBRARY_PATH to specify the
> location of the libraries.
> Is there a similar environment variable for specifying the location of
> the header files? Normally I use -I option for this, but I am looking
> for an equivalent environment variable.
C_INCLUDE_PATH is documented in the user manual:
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Environment-Variables.html .
@smirn0v
smirn0v / gist:8693fe0c6c57eeac5f9a
Created September 25, 2014 14:29
Check binary certificate
codesign -d -vvvv Payload/MRMail.app/
@smirn0v
smirn0v / gist:d2f70ee1e6092d4c9f01
Created September 8, 2014 16:58
Inject from Mike Ash
#include <stdio.h>
void inject_init(void) __attribute__((constructor));
void inject_init(void)
{
fprintf(stderr, "Here's your injected code!\n");
}
gcc -c injectlib.c
gcc -dynamiclib -current_version 1.0 injectlib.o -o injectlib.dylib
DYLD_INSERT_LIBRARIES=./injectlib.dylib date
@smirn0v
smirn0v / gist:cb7beb3051075d3c85ce
Created September 7, 2014 12:41
convert mac os x install app to dmg
gem install iesd
iesd -i /Applications/Install\ OS\ X\ Mavericks.app -o mavericks-iesd-ecc.dmg -t BaseSystem –remove-kexts AppleTyMCEDriver.kext
@smirn0v
smirn0v / gist:8d6ab2cec42e0fd82338
Created September 6, 2014 18:42
ISO from install esd
makehybrid -iso -hfs /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -o OSX-10.9.iso