#NEWLINE# def parse_cnc1_config( f ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# data [ 'cnccfg_ext_ip' ] = socket . inet_ntoa ( f . read ( 4 ) ) #NEWLINE# data [ 'cnccfg_nb_thdscan_local' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# data [ 'cnccfg_nb_thdscan_ext' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# third_field = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# data [ 'cnccfg_flag_scanner_sniffer' ] = bool ( ( third_field & 1 ) ) #NEWLINE# data [ 'cnccfg_flag_nolocalscan' ] = bool ( ( third_field & 2 ) ) #NEWLINE# data [ 'cnccfg_flag_noextscan' ] = bool ( ( third_field & 4 ) ) #NEWLINE# data [ 'cnccfg_flag_test10073' ] = bool ( ( third_field & 8 ) ) #NEWLINE# data [ 'cnccfg_flag_nattraversal' ] = bool ( ( third_field & 16 ) ) #NEWLINE# data [ 'cnccfg_flag_recontactcnc' ] = bool ( ( third_field & 32 ) ) #NEWLINE# data [ 'cnccfg_flag_hijackdns' ] = bool ( ( f & 64 ) ) #NEWLINE# data [ 'cnccfg_flag_thd_sniffer' ] = bool ( ( third_field & 128 ) ) #NEWLINE# data [ 'cnccfg_flag_killprocess' ] = bool ( ( third_field & 1024 ) ) #NEWLINE# data [ 'cnccfg_flag_share_peers' ] = bool ( ( third_field & 2048 ) ) #NEWLINE# data [ 'cnccfg_proxy_max_clients' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# data [ 'cnccfg_relaycnc_sleep' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# data [ 'cnccfg_reportcnc_ip' ] = socket . inet_ntoa ( f . read ( 4 ) ) #NEWLINE# data [ 'cnccfg_relaycnc_ip' ] = socket . inet_ntoa ( f . read ( 4 ) ) #NEWLINE# data [ 'cnccfg_relaycnc_timeout' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# data [ 'cnccfg_hijackdns1_ip' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# data [ 'cnccfg_hijackdns2_ip' ] = unpack ( 'I' , f . read ( 4 ) ) [ 0 ] #NEWLINE# return data