SlideShare a Scribd company logo
1 of 33
Breaking the wall
     Taras Kalapun
DON’T PANIC
Google it :)
iccoss
Certificates switching
Certificates switching
                         H ello!
                          evice cert
                        d

            ed u sers
       allow
Certificates switching
                         H ello!
                          evice cert
                        d

            ed u sers
       allow
                               Login!
           pass for user cert


                    Hello!
                   user cert
we tried...
• NSURLConnection
• GTMHTTPFetcher
  - (BOOL)connection:(NSURLConnection *)connection
  canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
  - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:
  (NSURLAuthenticationChallenge *)challenge




• ASIHTTPRequest
  // Will send the certificate attached to the identity (SecIdentityRef)
  [request setClientCertificateIdentity:identity];



• Wireshark...
                            we failed!
Hacks that worked
• Using IP for first certificate
#include <netdb.h>
#include <arpa/inet.h>

+ (NSString *)hostIPFromHostName:(NSString *)hostName {
  struct hostent *host = gethostbyname([hostName UTF8String]);
  if (host == NULL) return nil;
  struct in_addr **list = (struct in_addr **)host->h_addr_list;
  NSString *addressString = [NSString stringWithUTF8String:inet_ntoa(*list[0])];
  return addressString;
}

- (NSURL *)URLByUsingIP {
   NSString *oldHost = [NSString stringWithFormat:@"%@://%@", [self scheme], [self host]];
   NSString *newHost = [NSString stringWithFormat:@"%@://%@", [self scheme], [NSURL
hostIPFromHostName:[self host]]];
   NSString *newUrl = [[self absoluteString] stringByReplacingOccurrencesOfString:oldHost
withString:newHost];
   return [NSURL URLWithString:newUrl];
}
• Adding “.” to the hostname )
  http://developer.apple.com/library/ios/#qa/qa1727/

NSString *oldHost = [NSString stringWithFormat:@"%@://%@", [self scheme], [self host]];
NSString *newHost = [NSString stringWithFormat:@"%@://%@.", [self scheme], [self host]];
NSString *newUrl = [[self absoluteString] stringByReplacingOccurrencesOfString:oldHost withString:newHost];
return [NSURL URLWithString:newUrl];
)in  Da                                                  dc         r)0
                             ta *                                                      gne d cha
                           Da                                                      nsi      e
                            :( NS                                            , (u nsign
                                                                         c3 (u
                       ata                                           0x
                ESD                                              ar) xe2,
                                                             ch )0
             dD
      5 An                                            ned char
MD                                                sig       d
                                             (un signe
                                         b, un
                                 0x7           (                                                                                                #include <Openssl/crypto.h>
   =                        ar) x22,
                          h )0                                                                                                                  #include <Openssl/evp.h>
 ]                   dc          r
               gne d cha
          nsi        e                                                                                                                          #include <Openssl/err.h>
     , (u nsign
 a8 (u                                                                                                                                          #include <Openssl/x509.h>
                                               t;
       ,                                   Sal
 x53                                  *)g
                              har
                         dc
                si gne
           ( un
    t=          );
sal (gSalt
      f
 zeo ;
      7                                   !");
=1                                   e8
                               db



                                               PBEWithMD5AndDES
                     sh  oul
       {
   8) ength
= tl
    al
@"s
 nil;                           tx;
                          erC
                    iph
               Xc                     ult
                                           s
      ER _CT                  f  res                                         g];
 PH                      e o lts;                                      trin                  s];
                   rag esu                                       F8S                     yte
              sto R                                          UT                    ta b                                   C,
        ted ar *m 0;                                  ord                    nDa                                   ES _CB
      a
  loc d ch                                         sw                   *)[i                                  ndD
                     n=                      pas                   ar
       e
  ign sults
                 Le                      =[                     ch                                      D5
                                                                                                            A
      Re                         o  rd                  ned                                      it hM
                            sw                      sig
 tm                   Pas                       (un h];                                    beW
                   *c                       =        t                               D_p
             har                     ata leng                                     (NI n);
       st c                  *m
                                   D ta                                      set       e
 con                  h ar [inDa                        ;              be_ saltL
                                                                     p t,
                 dc           =                     s()         S5_ al
          i gne taLen                         thm = PKC ns, s
    uns Da                                ori                   o
         t  m                        alg ithm terati
                                 ll_ or
      in                     _a          g            i                             ));                                                      ),
                      add R *al                                                Ctx                                                     w ord
                 ay_        O                                            her                                                        ass
         S  SLe _ALG                                               ( cip                                                        (cP
                 9                                             eof                                                          len
            X50                                            siz                                                         , str ))
                                                      0,                                                           ord      on
                                               C tx,                                                          s sw irecti
                                          her                                         );                  cPa      ,d
                                (&   cip                  )                   rC  tx)                 m, rCtx)                                                 pt
                                                    ULL                                           th
                           set                                          phe                   ori ciphe                                                     cry
                  me
                       m                      =N                    (ci                   alg       (                                                   nd
                                                                                                                                                           e
                                         m!                  n it(&                   -> er, &                                                       ro
                                   rith                 X_i                     thm et                                                        ina
                                                                                                                                                  to
                             lgo                    CT                     ori aram
                      if (
                           a                   ER_                   (alg p                                    1);               x);    ter
                                                                                                                                            m
                                           PH                   Init m->                                   tx,               rCt null
                        {            _CI                    her       th                              erC               phe       r
                               EVP                  _Cip lgori                                  ciph                &ci s 1 fo );
                                                                                                                  e( lu
                                               PBE           a                             g(&                siz     p         en
                                          VP_                                          din                ck_ ; // allocL
                                   if (
                                        E                                        pad                   lo      1
                                                                                                  X_b ze + alloc(
                                                                         _s et_               CT Si
                                                                    TX                   ER_ lock SSL_m
                                                               R_C                   PH
                                       {                PH
                                                             E                   _CI       + b PEN
                                                    _CI                   EVP taLen ar *)O                                                                          Len
                                                                                                                                                                        ))
                                              E  VP                    =
                                                                              Da         ch                                                                       n
                                                                 ize                                       ;                                                 s, i
Testing compatibility
   Server/Client


          JSON
                        iOS

JAVA
Continuous Integration
          +
     Unit Testing

• On commit, build Server
• Server generates JSON to text files
• Build Client, test with JSON files
#import <OCMock/OCMock.h>

- (void)setUp {
   self.dataController = [DataController sharedDataController];

    id mock = [OCMockObject partialMockForObject:self.dataController.dataAdapter];

    [[[mock stub] andCall:@selector(fakeLoadUsersWithCompletionHandler:)
            onObject:self] loadUsersWithCompletionHandler:[OCMArg any]];
}

- (void)testLoadUsers {
   [self.dataController loadUsers];
}

#pragma mark - DataControllerDelegate
- (void)dataController:(DataController *)adapter receivedUserList:(NSArray *)userList {
   STAssertTrue(([userList count] > 0), @"There should be some user logins");
   NSLog(@"receivedUserList: %@", userList);
}

#pragma mark - Fakes
- (void)fakeLoadUsersWithCompletionHandler:(void (^)(NSArray *items, NSError *error))handler {
   NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"getAllUsersOnDevice"
ofType:@"txt"];
   NSString *dataString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding
error:NULL];
   STAssertNotNil(dataString, @"There should be some user list dump");

    NSArray *users = [[dataString JSONValue] objectForKey:@"response"];
    STAssertTrue(([users count] > 0), @"There should be some users in dump");

    handler(users, NULL);
}
iTunes
mobileDeviceManager
iTunes
mobileDeviceManager
•   git://github.com/xslim/mobileDeviceManager.git

•   http://habrahabr.ru/blogs/macosxdev/113074/

1. Поиск приложения по его идентификатору (необходим
приложению для определения местоположения приложения
и его директорий).
2. Отображение списка всех установленных приложений.
3. Просмотр списка директорий.
4. Просмотр содержания директорий.
5. Копирование файлов с/на устройство.
6. Определение подключено/отключено устройство.
7. Просмотр папки Media и все вложенных в нее папок и
фалов, и некоторые другие.
qCar
Gauges
   &
 Skins
- (void)layoutSubviews {
   ...
   CGSize bgSize = CGSizeFromString([self.skin objectForKey:@"bgSize"]);

  // Calculate aspect for other images
  CGFloat aspect = bgSize.width / self.bounds.size.width;

  // Background
  imSize = bgSize;
  imRect.origin = CGPointZero;
  imRect.size = CGSizeMake(imSize.width / aspect, imSize.height / aspect);
  self.bg.frame = imRect;

  // Arrow
  imSize = CGSizeFromString([self.skin objectForKey:@"arrowSize"]);

  // Calculate arrow position
  CGPoint bgAxis = CGPointFromString([self.skin objectForKey:@"bgAxis"]);
  CGPoint arrowAxis = CGPointFromString([self.skin objectForKey:@"arrowAxis"]);
  imRect.origin = CGPointMake((bgAxis.x - arrowAxis.x)/aspect, (bgAxis.y - arrowAxis.y)/aspect);

  imRect.size = CGSizeMake(imSize.width / aspect, imSize.height / aspect);
  self.arrow.layer.anchorPoint = CGPointMake(arrowAxis.x/imSize.width, arrowAxis.y/imSize.height);

  self.arrow.frame = imRect;
- (void)setValue:(float)aValue
{

    GaugeView *v = (id)self.view;

    float k = (arrowAngleMax - arrowAngleMin) / (scaleMax - scaleMin);
    float offset = (0 - scaleMin) / (scaleMax - scaleMin) * (arrowAngleMax - arrowAngleMin);
    float deg = k * aValue + offset;


    [UIView animateWithDuration:0.2f
                  delay:0
                 options:UIViewAnimationOptionAllowUserInteraction
               animations:^{
                 v.arrow.transform = CGAffineTransformMakeRotation(DEGTORAD(deg));
               }
               completion:nil];
}
InfoSuit
Table realization
- (void)viewDidLoad
{

   CGRect tableRect = CGRectMake(0.0f, 0.0f, 800.0f, 320.0f);
   UITableView *table = [[UITableView alloc] initWithFrame:tableRect
style:UITableViewStylePlain];
   table.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
   table.delegate = self;
   table.dataSource = self;
   self.tableView = table;
   [table release];

    self.dataWidths = [self widthForData:self.data];

    CGRect svRect = CGRectMake(0.0f, 0.0f, 480.0f, 320.0f);
    UIScrollView *sv = [[UIScrollView alloc] initWithFrame:svRect];
    sv.backgroundColor = self.tableView.backgroundColor;
    //sv.bounces = NO;
    sv.contentSize = self.tableView.frame.size;
    [sv addSubview:self.tableView];

    [self.view addSubview:sv];
    [sv release];

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath
{
   static NSString *CellIdentifier = @"Cell";

  ComplexTableViewCell *cell = (id)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
      cell = [[[ComplexTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
      cell.dataWidth = self.dataWidths;
  }

    // Configure the cell...
    cell.data = [self.data objectAtIndex:indexPath.row];

    return cell;
}
- (void)drawRect:(CGRect)rect {

    if ([self.dataWidth count] < 1) return;


       CGContextRef ctx = UIGraphicsGetCurrentContext();

       // Use the same color and width as the default cell separator for now

       CGContextSetRGBStrokeColor(ctx, 0.5, 0.5, 0.5, 1.0);

       CGContextSetLineWidth(ctx, 0.25);

    CGRect sRect = CGRectMake(2.0f, 1.0f, 10.0f, self.bounds.size.height - 2.0f);

    UIFont *font = [UIFont systemFontOfSize:14.0f];

    int idx = 0;

    for (NSString *s in self.data) {

         CGFloat sWidth = [[self.dataWidth objectAtIndex:idx] floatValue];
         //CGSize sSize = [s sizeWithFont:font];
         sRect.size.width = sWidth;

         [s drawInRect:sRect withFont:font lineBreakMode:UILineBreakModeTailTruncation];

          CGFloat linePoint = sRect.origin.x - 2.0f;
          CGContextMoveToPoint(ctx, linePoint, 0);

       
   CGContextAddLineToPoint(ctx, linePoint, self.bounds.size.height);

         sRect.origin.x += (sWidth + 4.0f);
         idx++;
    }


       CGContextStrokePath(ctx);


       [super drawRect:rect];
}
Navigation bar coloring
swizzling
https://github.com/xslim/tools/tree/master/
 UINavigationBar


#include <objc/runtime.h>
#include <objc/message.h>

+ (void)load {
  Class class;
  Method method;

  Method drawRectCustomBackground = class_getInstanceMethod([UINavigationBar class],
@selector(drawRectCustomBackground:));
  Method drawRect = class_getInstanceMethod([UINavigationBar class], @selector(drawRect:));
  method_exchangeImplementations(drawRect, drawRectCustomBackground);
}
thx.

Taras Kalapun
t.kalapun@gmail.com
@xslim
http://public.iwork.com/document/?
d=Breaking_the_wall.key&a=p162685331

More Related Content

What's hot

Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Alexander Granin
 
Functional "Life": parallel cellular automata and comonads
Functional "Life": parallel cellular automata and comonadsFunctional "Life": parallel cellular automata and comonads
Functional "Life": parallel cellular automata and comonadsAlexander Granin
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in RustIngvar Stepanyan
 
そうだ、bf処理系作ろう!もちろんSQLで!
そうだ、bf処理系作ろう!もちろんSQLで!そうだ、bf処理系作ろう!もちろんSQLで!
そうだ、bf処理系作ろう!もちろんSQLで!bleis tift
 
Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013aleks-f
 
Коварный code type ITGM #9
Коварный code type ITGM #9Коварный code type ITGM #9
Коварный code type ITGM #9Andrey Zakharevich
 
Improved deterministic algorithms for decremental transitive closure and stro...
Improved deterministic algorithms for decremental transitive closure and stro...Improved deterministic algorithms for decremental transitive closure and stro...
Improved deterministic algorithms for decremental transitive closure and stro...katzelad1
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...DevGAMM Conference
 
Emo-Exploitation
Emo-ExploitationEmo-Exploitation
Emo-Exploitationw0nd
 
The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210Mahmoud Samir Fayed
 
Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Prof Ansari
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)Yuki Tamura
 
Aspect Mining for Large Systems
Aspect Mining for Large SystemsAspect Mining for Large Systems
Aspect Mining for Large SystemsThomas Zimmermann
 
Tai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinhTai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinhHồ Trường
 
June 2011 solution
June 2011 solutionJune 2011 solution
June 2011 solutionleroy walker
 
Потоки в перле изнутри
Потоки в перле изнутриПотоки в перле изнутри
Потоки в перле изнутриIlya Zelenchuk
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itSergey Platonov
 

What's hot (20)

Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++
 
Functional "Life": parallel cellular automata and comonads
Functional "Life": parallel cellular automata and comonadsFunctional "Life": parallel cellular automata and comonads
Functional "Life": parallel cellular automata and comonads
 
Lecture1 classes1
Lecture1 classes1Lecture1 classes1
Lecture1 classes1
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
 
そうだ、bf処理系作ろう!もちろんSQLで!
そうだ、bf処理系作ろう!もちろんSQLで!そうだ、bf処理系作ろう!もちろんSQLで!
そうだ、bf処理系作ろう!もちろんSQLで!
 
Jamming attack in wireless network
Jamming attack in wireless networkJamming attack in wireless network
Jamming attack in wireless network
 
Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013
 
Коварный code type ITGM #9
Коварный code type ITGM #9Коварный code type ITGM #9
Коварный code type ITGM #9
 
Improved deterministic algorithms for decremental transitive closure and stro...
Improved deterministic algorithms for decremental transitive closure and stro...Improved deterministic algorithms for decremental transitive closure and stro...
Improved deterministic algorithms for decremental transitive closure and stro...
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
 
Emo-Exploitation
Emo-ExploitationEmo-Exploitation
Emo-Exploitation
 
The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210
 
Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)
 
Aspect Mining for Large Systems
Aspect Mining for Large SystemsAspect Mining for Large Systems
Aspect Mining for Large Systems
 
Tai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinhTai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinh
 
June 2011 solution
June 2011 solutionJune 2011 solution
June 2011 solution
 
Потоки в перле изнутри
Потоки в перле изнутриПотоки в перле изнутри
Потоки в перле изнутри
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
 

Viewers also liked

Viewers also liked (7)

Sbornik zadach-po-fizike.-7-9-
Sbornik zadach-po-fizike.-7-9- Sbornik zadach-po-fizike.-7-9-
Sbornik zadach-po-fizike.-7-9-
 
Великая Отечественная война
Великая Отечественная войнаВеликая Отечественная война
Великая Отечественная война
 
през русское летоуац
през русское летоуацпрез русское летоуац
през русское летоуац
 
инф 9 демо 2015
инф 9 демо 2015инф 9 демо 2015
инф 9 демо 2015
 
File 20110220030016
File 20110220030016File 20110220030016
File 20110220030016
 
C новым Годом!
C новым Годом!C новым Годом!
C новым Годом!
 
презентация1
презентация1презентация1
презентация1
 

Similar to Breaking the wall

Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009Jan Wedekind
 
Decyphering Rails 3
Decyphering Rails 3Decyphering Rails 3
Decyphering Rails 3.toster
 
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1Preston Lee
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanriturajj
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
Basic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python ProgrammersBasic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python ProgrammersAppier
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Er Ritu Aggarwal
 
RSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESRSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESacijjournal
 
Extend R with Rcpp!!!
Extend R with Rcpp!!!Extend R with Rcpp!!!
Extend R with Rcpp!!!mickey24
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersJen Yee Hong
 
プログラム実行の話と
OSとメモリの挙動の話
プログラム実行の話と
OSとメモリの挙動の話プログラム実行の話と
OSとメモリの挙動の話
プログラム実行の話と
OSとメモリの挙動の話tatsunori ishikawa
 
wavelet decomposition process code in matlabSolution WAVE.pdf
wavelet decomposition process code in matlabSolution WAVE.pdfwavelet decomposition process code in matlabSolution WAVE.pdf
wavelet decomposition process code in matlabSolution WAVE.pdfbrijeshagarwa329898l
 

Similar to Breaking the wall (20)

Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009
 
Marat-Slides
Marat-SlidesMarat-Slides
Marat-Slides
 
3
33
3
 
Decyphering Rails 3
Decyphering Rails 3Decyphering Rails 3
Decyphering Rails 3
 
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshan
 
Permute
PermutePermute
Permute
 
C program
C programC program
C program
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
Basic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python ProgrammersBasic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python Programmers
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
Lab loop
Lab loopLab loop
Lab loop
 
RSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENESRSA SIGNATURE: BEHIND THE SCENES
RSA SIGNATURE: BEHIND THE SCENES
 
Extend R with Rcpp!!!
Extend R with Rcpp!!!Extend R with Rcpp!!!
Extend R with Rcpp!!!
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmers
 
D3.js workshop
D3.js workshopD3.js workshop
D3.js workshop
 
プログラム実行の話と
OSとメモリの挙動の話
プログラム実行の話と
OSとメモリの挙動の話プログラム実行の話と
OSとメモリの挙動の話
プログラム実行の話と
OSとメモリの挙動の話
 
C++11 - STL Additions
C++11 - STL AdditionsC++11 - STL Additions
C++11 - STL Additions
 
Permute
PermutePermute
Permute
 
wavelet decomposition process code in matlabSolution WAVE.pdf
wavelet decomposition process code in matlabSolution WAVE.pdfwavelet decomposition process code in matlabSolution WAVE.pdf
wavelet decomposition process code in matlabSolution WAVE.pdf
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Breaking the wall

  • 1. Breaking the wall Taras Kalapun
  • 6. Certificates switching H ello! evice cert d ed u sers allow
  • 7. Certificates switching H ello! evice cert d ed u sers allow Login! pass for user cert Hello! user cert
  • 8. we tried... • NSURLConnection • GTMHTTPFetcher - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge • ASIHTTPRequest // Will send the certificate attached to the identity (SecIdentityRef) [request setClientCertificateIdentity:identity]; • Wireshark... we failed!
  • 10. • Using IP for first certificate #include <netdb.h> #include <arpa/inet.h> + (NSString *)hostIPFromHostName:(NSString *)hostName { struct hostent *host = gethostbyname([hostName UTF8String]); if (host == NULL) return nil; struct in_addr **list = (struct in_addr **)host->h_addr_list; NSString *addressString = [NSString stringWithUTF8String:inet_ntoa(*list[0])]; return addressString; } - (NSURL *)URLByUsingIP { NSString *oldHost = [NSString stringWithFormat:@"%@://%@", [self scheme], [self host]]; NSString *newHost = [NSString stringWithFormat:@"%@://%@", [self scheme], [NSURL hostIPFromHostName:[self host]]]; NSString *newUrl = [[self absoluteString] stringByReplacingOccurrencesOfString:oldHost withString:newHost]; return [NSURL URLWithString:newUrl]; }
  • 11. • Adding “.” to the hostname ) http://developer.apple.com/library/ios/#qa/qa1727/ NSString *oldHost = [NSString stringWithFormat:@"%@://%@", [self scheme], [self host]]; NSString *newHost = [NSString stringWithFormat:@"%@://%@.", [self scheme], [self host]]; NSString *newUrl = [[self absoluteString] stringByReplacingOccurrencesOfString:oldHost withString:newHost]; return [NSURL URLWithString:newUrl];
  • 12. )in Da dc r)0 ta * gne d cha Da nsi e :( NS , (u nsign c3 (u ata 0x ESD ar) xe2, ch )0 dD 5 An ned char MD sig d (un signe b, un 0x7 ( #include <Openssl/crypto.h> = ar) x22, h )0 #include <Openssl/evp.h> ] dc r gne d cha nsi e #include <Openssl/err.h> , (u nsign a8 (u #include <Openssl/x509.h> t; , Sal x53 *)g har dc si gne ( un t= ); sal (gSalt f zeo ; 7 !"); =1 e8 db PBEWithMD5AndDES sh oul { 8) ength = tl al @"s nil; tx; erC iph Xc ult s ER _CT f res g]; PH e o lts; trin s]; rag esu F8S yte sto R UT ta b C, ted ar *m 0; ord nDa ES _CB a loc d ch sw *)[i ndD n= pas ar e ign sults Le =[ ch D5 A Re o rd ned it hM sw sig tm Pas (un h]; beW *c = t D_p har ata leng (NI n); st c *m D ta set e con h ar [inDa ; be_ saltL p t, dc = s() S5_ al i gne taLen thm = PKC ns, s uns Da ori o t m alg ithm terati ll_ or in _a g i )); ), add R *al Ctx w ord ay_ O her ass S SLe _ALG ( cip (cP 9 eof len X50 siz , str )) 0, ord on C tx, s sw irecti her ); cPa ,d (& cip ) rC tx) m, rCtx) pt ULL th set phe ori ciphe cry me m =N (ci alg ( nd e m! n it(& -> er, & ro rith X_i thm et ina to lgo CT ori aram if ( a ER_ (alg p 1); x); ter m PH Init m-> tx, rCt null { _CI her th erC phe r EVP _Cip lgori ciph &ci s 1 fo ); e( lu PBE a g(& siz p en VP_ din ck_ ; // allocL if ( E pad lo 1 X_b ze + alloc( _s et_ CT Si TX ER_ lock SSL_m R_C PH { PH E _CI + b PEN _CI EVP taLen ar *)O Len )) E VP = Da ch n ize ; s, i
  • 13. Testing compatibility Server/Client JSON iOS JAVA
  • 14. Continuous Integration + Unit Testing • On commit, build Server • Server generates JSON to text files • Build Client, test with JSON files
  • 15. #import <OCMock/OCMock.h> - (void)setUp { self.dataController = [DataController sharedDataController]; id mock = [OCMockObject partialMockForObject:self.dataController.dataAdapter]; [[[mock stub] andCall:@selector(fakeLoadUsersWithCompletionHandler:) onObject:self] loadUsersWithCompletionHandler:[OCMArg any]]; } - (void)testLoadUsers { [self.dataController loadUsers]; } #pragma mark - DataControllerDelegate - (void)dataController:(DataController *)adapter receivedUserList:(NSArray *)userList { STAssertTrue(([userList count] > 0), @"There should be some user logins"); NSLog(@"receivedUserList: %@", userList); } #pragma mark - Fakes - (void)fakeLoadUsersWithCompletionHandler:(void (^)(NSArray *items, NSError *error))handler { NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"getAllUsersOnDevice" ofType:@"txt"]; NSString *dataString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL]; STAssertNotNil(dataString, @"There should be some user list dump"); NSArray *users = [[dataString JSONValue] objectForKey:@"response"]; STAssertTrue(([users count] > 0), @"There should be some users in dump"); handler(users, NULL); }
  • 18. git://github.com/xslim/mobileDeviceManager.git • http://habrahabr.ru/blogs/macosxdev/113074/ 1. Поиск приложения по его идентификатору (необходим приложению для определения местоположения приложения и его директорий). 2. Отображение списка всех установленных приложений. 3. Просмотр списка директорий. 4. Просмотр содержания директорий. 5. Копирование файлов с/на устройство. 6. Определение подключено/отключено устройство. 7. Просмотр папки Media и все вложенных в нее папок и фалов, и некоторые другие.
  • 19. qCar
  • 20. Gauges & Skins
  • 21.
  • 22. - (void)layoutSubviews { ... CGSize bgSize = CGSizeFromString([self.skin objectForKey:@"bgSize"]); // Calculate aspect for other images CGFloat aspect = bgSize.width / self.bounds.size.width; // Background imSize = bgSize; imRect.origin = CGPointZero; imRect.size = CGSizeMake(imSize.width / aspect, imSize.height / aspect); self.bg.frame = imRect; // Arrow imSize = CGSizeFromString([self.skin objectForKey:@"arrowSize"]); // Calculate arrow position CGPoint bgAxis = CGPointFromString([self.skin objectForKey:@"bgAxis"]); CGPoint arrowAxis = CGPointFromString([self.skin objectForKey:@"arrowAxis"]); imRect.origin = CGPointMake((bgAxis.x - arrowAxis.x)/aspect, (bgAxis.y - arrowAxis.y)/aspect); imRect.size = CGSizeMake(imSize.width / aspect, imSize.height / aspect); self.arrow.layer.anchorPoint = CGPointMake(arrowAxis.x/imSize.width, arrowAxis.y/imSize.height); self.arrow.frame = imRect;
  • 23. - (void)setValue:(float)aValue { GaugeView *v = (id)self.view; float k = (arrowAngleMax - arrowAngleMin) / (scaleMax - scaleMin); float offset = (0 - scaleMin) / (scaleMax - scaleMin) * (arrowAngleMax - arrowAngleMin); float deg = k * aValue + offset; [UIView animateWithDuration:0.2f delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ v.arrow.transform = CGAffineTransformMakeRotation(DEGTORAD(deg)); } completion:nil]; }
  • 26. - (void)viewDidLoad { CGRect tableRect = CGRectMake(0.0f, 0.0f, 800.0f, 320.0f); UITableView *table = [[UITableView alloc] initWithFrame:tableRect style:UITableViewStylePlain]; table.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; table.delegate = self; table.dataSource = self; self.tableView = table; [table release]; self.dataWidths = [self widthForData:self.data]; CGRect svRect = CGRectMake(0.0f, 0.0f, 480.0f, 320.0f); UIScrollView *sv = [[UIScrollView alloc] initWithFrame:svRect]; sv.backgroundColor = self.tableView.backgroundColor; //sv.bounces = NO; sv.contentSize = self.tableView.frame.size; [sv addSubview:self.tableView]; [self.view addSubview:sv]; [sv release]; }
  • 27. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; ComplexTableViewCell *cell = (id)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[ComplexTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.dataWidth = self.dataWidths; } // Configure the cell... cell.data = [self.data objectAtIndex:indexPath.row]; return cell; }
  • 28. - (void)drawRect:(CGRect)rect { if ([self.dataWidth count] < 1) return; CGContextRef ctx = UIGraphicsGetCurrentContext(); // Use the same color and width as the default cell separator for now CGContextSetRGBStrokeColor(ctx, 0.5, 0.5, 0.5, 1.0); CGContextSetLineWidth(ctx, 0.25); CGRect sRect = CGRectMake(2.0f, 1.0f, 10.0f, self.bounds.size.height - 2.0f); UIFont *font = [UIFont systemFontOfSize:14.0f]; int idx = 0; for (NSString *s in self.data) { CGFloat sWidth = [[self.dataWidth objectAtIndex:idx] floatValue]; //CGSize sSize = [s sizeWithFont:font]; sRect.size.width = sWidth; [s drawInRect:sRect withFont:font lineBreakMode:UILineBreakModeTailTruncation]; CGFloat linePoint = sRect.origin.x - 2.0f; CGContextMoveToPoint(ctx, linePoint, 0); CGContextAddLineToPoint(ctx, linePoint, self.bounds.size.height); sRect.origin.x += (sWidth + 4.0f); idx++; } CGContextStrokePath(ctx); [super drawRect:rect]; }
  • 31. https://github.com/xslim/tools/tree/master/ UINavigationBar #include <objc/runtime.h> #include <objc/message.h> + (void)load { Class class; Method method; Method drawRectCustomBackground = class_getInstanceMethod([UINavigationBar class], @selector(drawRectCustomBackground:)); Method drawRect = class_getInstanceMethod([UINavigationBar class], @selector(drawRect:)); method_exchangeImplementations(drawRect, drawRectCustomBackground); }

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n