{"name": "rpl_join_instance", "code": "__int64 __fastcall rpl_join_instance ( _QWORD * @@a1@@ , __int64 @@a2@@ ) { __int64 @@result@@ ; __int64 @@v3@@ ; __int64 ( __fastcall * * @@v4@@ ) ( ) ; __int64 @@v5@@ ; __int64 @@v6@@ ; __int64 @@v7@@ ; @@result@@ = ( __int64 ) rpl_alloc_dag ( * ( _BYTE * ) ( @@a2@@ + Number ) ) ; @@v7@@ = @@result@@ ; if ( @@result@@ ) { @@v6@@ = * ( _QWORD * ) ( @@result@@ + Number ) ; @@v5@@ = rpl_add_parent ( @@result@@ , @@a2@@ , @@a1@@ ) ; if ( @@v5@@ ) { * ( _BYTE * ) ( @@v5@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; @@v4@@ = rpl_find_of ( * ( _WORD * ) ( @@a2@@ + Number ) ) ; if ( @@v4@@ ) { if ( ( * ( _BYTE * ) ( @@a2@@ + Number ) & Number ) != Number ) check_prefix ( Number L , ( unsigned __int8 * ) ( @@a2@@ + Number ) ) ; * ( _BYTE * ) ( @@v7@@ + Number ) = Number ; * ( _BYTE * ) ( @@v7@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v7@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v7@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _QWORD * ) ( @@v6@@ + Number ) = @@v4@@ ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _QWORD * ) ( @@v6@@ + Number ) = @@v7@@ ; * ( _BYTE * ) ( @@v6@@ + Number ) = Number ; * ( _WORD * ) ( @@v6@@ + Number ) = * ( _WORD * ) ( @@a2@@ + Number ) ; * ( _WORD * ) ( @@v6@@ + Number ) = * ( _WORD * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@v6@@ + Number ) + * ( _BYTE * ) ( @@v6@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _WORD * ) ( @@v6@@ + Number ) = * ( _WORD * ) ( @@a2@@ + Number ) ; @@v3@@ = * ( _QWORD * ) ( @@a2@@ + Number ) ; * ( _QWORD * ) @@v7@@ = * ( _QWORD * ) @@a2@@ ; * ( _QWORD * ) ( @@v7@@ + Number ) = @@v3@@ ; memcpy ( ( void * ) ( @@v7@@ + Number ) , ( const void * ) ( @@a2@@ + Number ) , Number ) ; * ( _QWORD * ) ( @@v7@@ + Number ) = @@v5@@ ; ( * ( void ( __fastcall * * ) ( __int64 ) ) ( * ( _QWORD * ) ( @@v6@@ + Number ) + Number L ) ) ( @@v6@@ ) ; * ( _WORD * ) ( @@v7@@ + Number ) = ( * ( __int64 ( __fastcall * * ) ( __int64 , _QWORD ) ) ( * ( _QWORD * ) ( @@v6@@ + Number ) + Number L ) ) ( @@v5@@ , Number L ) ; * ( _WORD * ) ( @@v7@@ + Number ) = * ( _WORD * ) ( @@v7@@ + Number ) ; if ( ! default_instance ) default_instance = @@v6@@ ; rpl_reset_dio_timer ( @@v6@@ ) ; rpl_set_default_route ( @@v6@@ , @@a1@@ ) ; @@result@@ = * ( unsigned __int8 * ) ( @@v6@@ + Number ) ; if ( ( _BYTE ) @@result@@ ) @@result@@ = rpl_schedule_dao ( @@v6@@ ) ; } else { rpl_remove_parent ( @@v7@@ , @@v5@@ ) ; @@result@@ = @@v6@@ ; * ( _BYTE * ) ( @@v6@@ + Number ) = Number ; } } else { @@result@@ = @@v6@@ ; * ( _BYTE * ) ( @@v6@@ + Number ) = Number ; } } return @@result@@ ; }", "source": [{"n": "v3", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r16"}, {"n": "a1", "t": {"T": 3, "t": "_QWORD"}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r64"}, {"n": "result", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r8"}, {"n": "v6", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s16"}, {"n": "v5", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s24"}, {"n": "v4", "t": {"T": 9, "n": "__int64 (__fastcall **)()"}, "location": "s32"}, {"n": "v7", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s8"}]}
{"name": "check_prefix", "code": "void __fastcall check_prefix ( unsigned __int8 * @@a1@@ , unsigned __int8 * @@a2@@ ) { _QWORD @@v2@@ [ Number ] ; __int64 @@v3@@ ; if ( ! @@a1@@ || ! @@a2@@ || @@a1@@ [ Number ] != @@a2@@ [ Number ] || memcmp ( @@a1@@ , @@a2@@ , @@a2@@ [ Number ] >> Number ) || @@a1@@ [ Number ] != @@a2@@ [ Number ] ) { if ( @@a1@@ ) { set_ip_from_prefix ( @@v2@@ , @@a1@@ ) ; @@v3@@ = uip_ds6_addr_lookup ( @@v2@@ ) ; if ( @@v3@@ ) uip_ds6_addr_rm ( @@v3@@ ) ; } if ( @@a2@@ ) { set_ip_from_prefix ( @@v2@@ , @@a2@@ ) ; if ( ! uip_ds6_addr_lookup ( @@v2@@ ) ) uip_ds6_addr_add ( @@v2@@ , Number L , Number ) ; } } }", "source": [{"n": "a1", "t": {"T": 3, "t": "unsigned __int8"}, "location": "r56"}, {"n": "a2", "t": {"T": 3, "t": "unsigned __int8"}, "location": "r64"}, {"n": "v2", "t": {"T": 2, "n": 3, "s": 8, "t": "_QWORD"}, "location": "s32"}, {"n": "v3", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s8"}]} {"name": "rpl_set_default_route", "code": "__int64 __fastcall rpl_set_default_route ( __int64 @@a1@@ , _QWORD * @@a2@@ ) { if ( * ( _QWORD * ) ( @@a1@@ + Number ) ) { uip_ds6_defrt_rm ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; * ( _QWORD * ) ( @@a1@@ + Number ) = Number L ; } if ( @@a2@@ ) { * ( _QWORD * ) ( @@a1@@ + Number ) = uip_ds6_defrt_add ( @@a2@@ , * ( unsigned __int8 * ) ( @@a1@@ + Number ) * ( unsigned __int64 ) * ( unsigned __int16 * ) ( @@a1@@ + Number ) ) ; if ( ! * ( _QWORD * ) ( @@a1@@ + Number ) ) return Number L ; } else if ( * ( _QWORD * ) ( @@a1@@ + Number ) ) { uip_ds6_defrt_rm ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; } return Number L ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "a2", "t": {"T": 3, "t": "_QWORD"}, "location": "r64"}]} {"name": "rpl_alloc_dag", "code": "char * __fastcall rpl_alloc_dag ( unsigned __int8 @@a1@@ ) { char * @@v2@@ ; char * @@s@@ ; @@v2@@ = ( char * ) rpl_get_instance ( @@a1@@ ) ; if ( ! @@v2@@ ) { @@v2@@ = rpl_alloc_instance ( @@a1@@ ) ; if ( ! @@v2@@ ) return Number L ; } for ( @@s@@ = @@v2@@ + Number ; @@s@@ < @@v2@@ + Number ; @@s@@ += Number ) { if ( ! @@s@@ [ Number ] ) { memset ( @@s@@ , Number , Number ) ; * ( ( _QWORD * ) @@s@@ + Number ) = @@s@@ + Number ; * ( ( _QWORD * ) @@s@@ + Number ) = Number L ; list_init ( * ( ( _QWORD * ) @@s@@ + Number ) ) ; @@s@@ [ Number ] = Number ; * ( ( _WORD * ) @@s@@ + Number ) = Number ; * ( ( _WORD * ) @@s@@ + Number ) = Number ; * ( ( _QWORD * ) @@s@@ + Number ) = @@v2@@ ; return @@s@@ ; } } rpl_free_instance ( @@v2@@ ) ; return Number L ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "unsigned __int8", "s": 1}, "location": "r56"}, {"n": "v2", "t": {"T": 3, "t": "char"}, "location": "s16"}, {"n": "s", "t": {"T": 3, "t": "char"}, "location": "s8"}]} {"name": "rpl_add_parent", "code": "__int64 __fastcall rpl_add_parent ( __int64 @@a1@@ , __int64 @@a2@@ , _QWORD * @@a3@@ ) { __int64 v4 ; __int64 @@v6@@ ; if ( ( unsigned int ) list_length ( * ( _QWORD * ) ( @@a1@@ + Number ) ) == Number ) return Number L ; @@v6@@ = memb_alloc ( & parent_memb ) ; if ( ! @@v6@@ ) return Number L ; v4 = @@a3@@ [ Number ] ; * ( _QWORD * ) ( @@v6@@ + Number ) = * @@a3@@ ; * ( _QWORD * ) ( @@v6@@ + Number ) = v4 ; * ( _QWORD * ) ( @@v6@@ + Number ) = @@a1@@ ; * ( _WORD * ) ( @@v6@@ + Number ) = * ( _WORD * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v6@@ + Number ) = Number ; * ( _QWORD * ) ( @@v6@@ + Number ) = * ( _QWORD * ) ( @@a2@@ + Number ) ; list_add ( * ( _QWORD * ) ( @@a1@@ + Number ) , @@v6@@ ) ; return @@v6@@ ; }", "source": [{"n": "a3", "t": {"T": 3, "t": "_QWORD"}, "location": "r16"}, {"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r64"}, {"n": "v6", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s8"}]} {"name": "rpl_remove_parent", "code": "__int64 __fastcall rpl_remove_parent ( __int64 @@a1@@ , __int64 @@a2@@ ) { rpl_nullify_parent ( @@a1@@ , @@a2@@ ) ; list_remove ( * ( _QWORD * ) ( @@a1@@ + Number ) , @@a2@@ ) ; return memb_free ( & parent_memb , @@a2@@ ) ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r64"}]} {"name": "rpl_find_of", "code": "__int64 ( __fastcall * * __fastcall rpl_find_of ( __int16 @@a1@@ ) ) ( ) { int @@i@@ ; for ( @@i@@ = Number ; ! @@i@@ ; @@i@@ = Number ) { if ( @@a1@@ == LOWORD ( rpl_of_etx [ Number ] ) ) return rpl_of_etx ; } return Number L ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int16", "s": 2}, "location": "r56"}, {"n": "i", "t": {"T": 1, "n": "int", "s": 4}, "location": "s4"}]} {"name": "rpl_process_dio", "code": "__int64 __fastcall rpl_process_dio ( _QWORD * @@a1@@ , __int64 @@a2@@ ) { __int64 @@result@@ ; __int64 @@v3@@ ; __int64 @@v4@@ ; _WORD * @@v5@@ ; _QWORD * @@v6@@ ; @@result@@ = * ( unsigned __int8 * ) ( @@a2@@ + Number ) ; if ( ( _BYTE ) @@result@@ == Number ) { @@v5@@ = get_dag ( * ( _BYTE * ) ( @@a2@@ + Number ) , ( const void * ) @@a2@@ ) ; @@v4@@ = rpl_get_instance ( * ( _BYTE * ) ( @@a2@@ + Number ) ) ; if ( @@v5@@ && @@v4@@ ) { if ( lollipop_greater_than ( * ( unsigned __int8 * ) ( @@a2@@ + Number ) , * ( ( unsigned __int8 * ) @@v5@@ + Number ) ) ) { if ( @@v5@@ [ Number ] != * ( _WORD * ) ( @@v4@@ + Number ) ) return global_repair ( @@a1@@ , ( __int64 ) @@v5@@ , @@a2@@ ) ; * ( ( _BYTE * ) @@v5@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; ++ * ( ( _BYTE * ) @@v5@@ + Number ) ; return rpl_reset_dio_timer ( @@v4@@ ) ; } if ( lollipop_greater_than ( * ( ( unsigned __int8 * ) @@v5@@ + Number ) , * ( unsigned __int8 * ) ( @@a2@@ + Number ) ) && * ( ( _BYTE * ) @@v5@@ + Number ) ) return rpl_reset_dio_timer ( @@v4@@ ) ; } @@result@@ = * ( unsigned __int16 * ) ( @@a2@@ + Number ) ; if ( ( _WORD ) @@result@@ == Number ) return @@result@@ ; if ( ! @@v4@@ ) return rpl_join_instance ( @@a1@@ , @@a2@@ ) ; if ( ! @@v5@@ ) return ( __int64 ) rpl_add_dag ( @@a1@@ , @@a2@@ ) ; @@result@@ = * ( unsigned __int16 * ) ( @@v4@@ + Number ) ; if ( * ( _WORD * ) ( @@a2@@ + Number ) >= ( unsigned __int16 ) @@result@@ ) { if ( * ( _WORD * ) ( @@a2@@ + Number ) == Number && * ( ( _BYTE * ) @@v5@@ + Number ) ) rpl_reset_dio_timer ( @@v4@@ ) ; if ( @@v5@@ [ Number ] == * ( _WORD * ) ( @@v4@@ + Number ) ) { @@result@@ = * ( unsigned __int16 * ) ( @@a2@@ + Number ) ; if ( ( _WORD ) @@result@@ != Number ) { @@result@@ = @@v4@@ ; ++ * ( _BYTE * ) ( @@v4@@ + Number ) ; } return @@result@@ ; } @@v6@@ = rpl_find_parent ( ( __int64 ) @@v5@@ , @@a1@@ ) ; if ( @@v6@@ ) { if ( * ( ( _WORD * ) @@v6@@ + Number ) == * ( _WORD * ) ( @@a2@@ + Number ) ) { if ( * ( ( _BYTE * ) @@v5@@ + Number ) ) ++ * ( _BYTE * ) ( @@v4@@ + Number ) ; } else { * ( ( _WORD * ) @@v6@@ + Number ) = * ( _WORD * ) ( @@a2@@ + Number ) ; } } else { @@v3@@ = find_parent_dag ( @@v4@@ , @@a1@@ ) ; if ( @@v3@@ ) { @@v6@@ = rpl_find_parent ( @@v3@@ , @@a1@@ ) ; if ( @@v6@@ ) rpl_move_parent ( @@v3@@ , ( __int64 ) @@v5@@ , ( __int64 ) @@v6@@ ) ; } else { if ( ( unsigned int ) list_length ( * ( ( _QWORD * ) @@v5@@ + Number ) ) == Number ) remove_worst_parent ( ( __int64 ) @@v5@@ , * ( _WORD * ) ( @@a2@@ + Number ) ) ; @@result@@ = rpl_add_parent ( ( __int64 ) @@v5@@ , @@a2@@ , @@a1@@ ) ; @@v6@@ = ( _QWORD * ) @@result@@ ; if ( ! @@result@@ ) return @@result@@ ; } } @@v6@@ [ Number ] = * ( _QWORD * ) ( @@a2@@ + Number ) ; @@result@@ = rpl_process_parent_event ( @@v4@@ , ( __int64 ) @@v6@@ ) ; if ( ( _DWORD ) @@result@@ ) { if ( * ( ( _BYTE * ) @@v5@@ + Number ) && @@v6@@ == * ( ( _QWORD * * ) @@v5@@ + Number ) && should_send_dao ( @@v4@@ , @@a2@@ , ( __int64 ) @@v6@@ ) ) { ++ * ( _BYTE * ) ( @@v4@@ + Number ) ; rpl_schedule_dao ( @@v4@@ ) ; } @@result@@ = ( __int64 ) @@v6@@ ; * ( ( _BYTE * ) @@v6@@ + Number ) = * ( _BYTE * ) ( @@a2@@ + Number ) ; } return @@result@@ ; } } return @@result@@ ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "_QWORD"}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r64"}, {"n": "result", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r8"}, {"n": "v5", "t": {"T": 3, "t": "_WORD"}, "location": "s16"}, {"n": "v4", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s24"}, {"n": "v3", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s32"}, {"n": "v6", "t": {"T": 3, "t": "_QWORD"}, "location": "s8"}]} {"name": "rpl_reset_dio_timer", "code": "__int64 __fastcall rpl_reset_dio_timer ( unsigned __int8 * @@a1@@ ) { __int64 @@result@@ ; @@result@@ = @@a1@@ [ Number ] ; if ( @@a1@@ [ Number ] > ( unsigned __int8 ) @@result@@ ) { @@a1@@ [ Number ] = Number ; @@a1@@ [ Number ] = @@a1@@ [ Number ] ; @@result@@ = new_dio_interval ( ( __int64 ) @@a1@@ ) ; } return @@result@@ ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "unsigned __int8"}, "location": "r56"}, {"n": "result", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r8"}]} {"name": "rpl_schedule_dao", "code": "__int64 __fastcall rpl_schedule_dao ( __int64 @@a1@@ ) { __int64 result ; unsigned __int16 v2 ; etimer_expiration_time ( ( _QWORD * ) ( @@a1@@ + Number ) ) ; result = etimer_expired ( @@a1@@ + Number ) ; if ( ( _DWORD ) result ) { v2 = random_rand ( ) ; result = ctimer_set ( @@a1@@ + Number , ( int ) ( v2 % Number + Number ) , handle_dao_timer , @@a1@@ ) ; } return result ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}]}