Ticket #47: colors.patch

File colors.patch, 2.3 KB (added by gkruse, 6 years ago)
  • Sources/Controller/ScanController.m

     
    257257 
    258258- (id) tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *) aTableColumn row:(int) rowIndex { 
    259259    WaveNet *net = [_container netAtIndex:rowIndex]; 
    260      
     260    if ([[aTableColumn identifier] isEqualToString: @"wep"]) { 
     261        NSLog(@"WEP!! "); 
     262        switch([net crackProb]) { 
     263            case 0:  
     264                [[aTableColumn dataCellForRow: rowIndex] setTextColor:[NSColor redColor]];//hahaha 
     265                break; 
     266            case 1: 
     267                [[aTableColumn dataCellForRow: rowIndex] setTextColor:[NSColor yellowColor]];//possible 
     268                break; 
     269            case 2: 
     270                [[aTableColumn dataCellForRow: rowIndex] setTextColor:[NSColor greenColor]];//good chance 
     271                break; 
     272            case 3: 
     273                [[aTableColumn dataCellForRow: rowIndex] setTextColor:[NSColor blueColor]];//cracked 
     274                break; 
     275        } 
     276    } 
    261277        return [[net cache] objectForKey: [aTableColumn identifier]]; 
    262278} 
    263279 
  • Sources/Core/WaveNet.mm

     
    12401240    return _password != nil; 
    12411241} 
    12421242 
     1243- (int)crackProb { 
     1244    if (_isWep <= 1 || _password != nil) { 
     1245        NSLog(@"Blue!!"); 
     1246        return 3; 
     1247    } 
     1248    if ((_isWep == 2 || _isWep == 3) && [self uniqueIVs] > 8) { 
     1249        return 1; 
     1250    } 
     1251    if ((_isWep == 2 || _isWep == 3) && [self uniqueIVs] > 250000) { 
     1252        return 2; 
     1253    } 
     1254    if (_isWep == 4 && [self capturedEAPOLKeys] != 0 ) { 
     1255        return 2; 
     1256    } 
     1257     
     1258    return 0; 
     1259} 
     1260 
    12431261#pragma mark - 
    12441262 
    12451263- (NSDictionary*)cache { 
  • Sources/Core/WaveNet.h

     
    156156- (NSDictionary*)coordinates; 
    157157- (WaveWeakContainer **)ivData; 
    158158- (BOOL)passwordAvailable; 
     159- (int)crackProb; // 0=not possible, 1=possible but not likely, 2=you might have a chance  
    159160 
    160161- (NSDictionary*)cache; 
    161162