Guest User

Untitled

a guest
May 26th, 2014
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #import "substrate.h"
  2. #import <Security/Security.h>
  3.  
  4.  
  5. static OSStatus (*original_SSLWrite) (
  6. SSLContextRef context,
  7. const void *data,
  8. size_t dataLength,
  9. size_t *processed
  10. );
  11.  
  12.  
  13. OSStatus replaced_SSLWrite (
  14. SSLContextRef context,
  15. const void *data,
  16. size_t dataLength,
  17. size_t *processed
  18. ){
  19. NSString *datastring = [[NSString alloc] initWithBytes:data length:dataLength encoding:NSASCIIStringEncoding];
  20. NSLog(@"ssly! %@", datastring);
  21. return original_SSLWrite(context, data, dataLength, processed);
  22. }
  23.  
  24.  
  25. %ctor{
  26. %init();
  27. MSHookFunction(&SSLWrite, &replaced_SSLWrite, &original_SSLWrite);
  28. // Replace original function implementation with your replaced_ one.
  29. }
Advertisement
Add Comment
Please, Sign In to add comment