{"name": "hapd_wps_reconfig_in_memory", "code": "__int64 __fastcall hapd_wps_reconfig_in_memory ( _QWORD * @@a1@@ , __int64 @@a2@@ ) { int @@v2@@ ; __int64 @@v4@@ ; @@v4@@ = @@a1@@ [ Number ] ; wpa_printf ( Number L , String ) ; * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; if ( * ( _QWORD * ) ( @@a2@@ + Number ) <= Number ) { memcpy ( ( void * ) ( @@v4@@ + Number ) , ( const void * ) @@a2@@ , * ( _QWORD * ) ( @@a2@@ + Number ) ) ; * ( _QWORD * ) ( @@v4@@ + Number ) = * ( _QWORD * ) ( @@a2@@ + Number ) ; * ( _BYTE * ) ( @@v4@@ + Number ) |= Number ; } if ( ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number && ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ) { * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; } else if ( ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ) { * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; } else { * ( _DWORD * ) ( @@v4@@ + Number ) = ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ; } if ( * ( _DWORD * ) ( @@v4@@ + Number ) ) { if ( ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ) * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; if ( ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ) * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; if ( ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ) { if ( * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number ) @@v2@@ = * ( _DWORD * ) ( @@v4@@ + Number ) | Number ; else @@v2@@ = * ( _DWORD * ) ( @@v4@@ + Number ) | Number ; * ( _DWORD * ) ( @@v4@@ + Number ) = @@v2@@ ; } if ( ( * ( _WORD * ) ( @@a2@@ + Number ) & Number ) != Number ) * ( _DWORD * ) ( @@v4@@ + Number ) |= Number ; * ( _DWORD * ) ( @@v4@@ + Number ) = * ( _DWORD * ) ( @@v4@@ + Number ) ; * ( _DWORD * ) ( @@v4@@ + Number ) = wpa_select_ap_group_cipher ( * ( unsigned int * ) ( @@v4@@ + Number ) , * ( unsigned int * ) ( @@v4@@ + Number ) , * ( unsigned int * ) ( @@v4@@ + Number ) ) ; if ( * ( _QWORD * ) ( @@a2@@ + Number ) <= Number || * ( _QWORD * ) ( @@a2@@ + Number ) > Number ) { if ( * ( _QWORD * ) ( @@a2@@ + Number ) == Number L ) { hostapd_config_clear_wpa_psk ( @@v4@@ + Number ) ; * ( _QWORD * ) ( @@v4@@ + Number ) = os_zalloc ( Number L ) ; if ( * ( _QWORD * ) ( @@v4@@ + Number ) ) { if ( ! ( unsigned int ) hexstr2bin ( @@a2@@ + Number , * ( _QWORD * ) ( @@v4@@ + Number ) + Number L , Number L ) ) { * ( _DWORD * ) ( * ( _QWORD * ) ( @@v4@@ + Number ) + Number L ) = Number ; free ( * ( void * * ) ( @@v4@@ + Number ) ) ; * ( _QWORD * ) ( @@v4@@ + Number ) = Number L ; } } } } else { free ( * ( void * * ) ( @@v4@@ + Number ) ) ; * ( _QWORD * ) ( @@v4@@ + Number ) = os_zalloc ( * ( _QWORD * ) ( @@a2@@ + Number ) + Number L ) ; if ( * ( _QWORD * ) ( @@v4@@ + Number ) ) memcpy ( * ( void * * ) ( @@v4@@ + Number ) , ( const void * ) ( @@a2@@ + Number ) , * ( _QWORD * ) ( @@a2@@ + Number ) ) ; hostapd_config_clear_wpa_psk ( @@v4@@ + Number ) ; } * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; } else { * ( _DWORD * ) ( @@v4@@ + Number ) = Number ; } eloop_register_timeout ( Number L , Number L , wps_reload_config , * @@a1@@ , Number L ) ; return Number L ; }", "source": [{"n": "v2", "t": {"T": 1, "n": "int", "s": 4}, "location": "r16"}, {"n": "a1", "t": {"T": 3, "t": "_QWORD"}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r64"}, {"n": "v4", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s8"}]}
{"name": "wps_reload_config", "code": "__int64 __fastcall wps_reload_config ( _QWORD * @@a1@@ ) { __int64 @@result@@ ; wpa_printf ( Number L , String ) ; if ( ! * @@a1@@ || ( @@result@@ = ( * ( __int64 ( __fastcall * * ) ( _QWORD * ) ) * @@a1@@ ) ( @@a1@@ ) , ( int ) @@result@@ < Number ) ) @@result@@ = wpa_printf ( Number L , String ) ; return @@result@@ ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "_QWORD"}, "location": "r56"}, {"n": "result", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r8"}]} {"name": "hapd_wps_cred_cb", "code": "__int64 __fastcall hapd_wps_cred_cb ( _QWORD * @@a1@@ , void * @@a2@@ ) { __int64 result ; __int64 v3 ; __int64 v4 ; __int64 v5 ; int * v6 ; char * v7 ; char @@s1@@ [ Number ] ; FILE * @@v9@@ ; FILE * @@stream@@ ; char * @@s@@ ; size_t @@size@@ ; __int64 @@v13@@ ; void * @@src@@ ; const char * @@v15@@ ; unsigned int @@v16@@ ; int @@v17@@ ; unsigned __int64 @@i@@ ; @@src@@ = @@a2@@ ; if ( ! @@a1@@ [ Number ] ) return Number L ; wpa_hexdump_key ( Number L , String , * ( ( _QWORD * ) @@src@@ + Number ) , * ( ( _QWORD * ) @@src@@ + Number ) ) ; wpa_printf ( Number L , String ) ; wpa_hexdump_ascii ( Number L , String , @@src@@ , * ( ( _QWORD * ) @@src@@ + Number ) ) ; wpa_printf ( Number L , String , * ( ( unsigned __int16 * ) @@src@@ + Number ) ) ; wpa_printf ( Number L , String , * ( ( unsigned __int16 * ) @@src@@ + Number ) ) ; wpa_printf ( Number L , String , * ( ( unsigned __int8 * ) @@src@@ + Number ) ) ; wpa_hexdump_key ( Number L , String , ( char * ) @@src@@ + Number , * ( ( _QWORD * ) @@src@@ + Number ) ) ; wpa_printf ( Number L , String , * ( ( unsigned __int8 * ) @@src@@ + Number ) , * ( ( unsigned __int8 * ) @@src@@ + Number ) , * ( ( unsigned __int8 * ) @@src@@ + Number ) , * ( ( unsigned __int8 * ) @@src@@ + Number ) , * ( ( unsigned __int8 * ) @@src@@ + Number ) , * ( ( unsigned __int8 * ) @@src@@ + Number ) ) ; if ( ( * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number || * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number ) && * ( ( _QWORD * ) @@src@@ + Number ) ) { hapd_new_ap_event ( ( __int64 ) @@a1@@ , * ( ( _QWORD * ) @@src@@ + Number ) , * ( ( _QWORD * ) @@src@@ + Number ) ) ; } else if ( * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number || * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number ) { @@v13@@ = wpabuf_alloc ( Number L ) ; if ( @@v13@@ && ! ( unsigned int ) wps_build_credential_wrap ( @@v13@@ , @@src@@ ) ) { v3 = wpabuf_len ( @@v13@@ ) ; v4 = wpabuf_head_u8 ( @@v13@@ ) ; hapd_new_ap_event ( ( __int64 ) @@a1@@ , v4 , v3 ) ; } wpabuf_free ( @@v13@@ ) ; } else { wpa_msg ( @@a1@@ [ Number ] , Number L , String ) ; } if ( * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number ) return Number L ; memcpy ( ( void * ) ( @@a1@@ [ Number ] + Number L ) , @@src@@ , * ( ( _QWORD * ) @@src@@ + Number ) ) ; * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _QWORD * ) @@src@@ + Number ) ; * ( _WORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _WORD * ) @@src@@ + Number ) ; * ( _WORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _WORD * ) @@src@@ + Number ) ; * ( _WORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _WORD * ) @@src@@ + Number ) ; * ( _WORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _WORD * ) @@src@@ + Number ) ; * ( _WORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _WORD * ) @@src@@ + Number ) ; * ( _WORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _WORD * ) @@src@@ + Number ) ; if ( * ( ( _QWORD * ) @@src@@ + Number ) ) { if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number && ( * ( ( _QWORD * ) @@src@@ + Number ) <= Number || * ( ( _QWORD * ) @@src@@ + Number ) > Number ) ) { wpa_printf ( Number L , String , * ( ( _QWORD * ) @@src@@ + Number ) ) ; return Number ; } if ( ! * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) || * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) < * ( ( _QWORD * ) @@src@@ + Number ) ) { * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) = Number L ; free ( * ( void * * ) ( @@a1@@ [ Number ] + Number L ) ) ; v5 = @@a1@@ [ Number ] ; * ( _QWORD * ) ( v5 + Number ) = malloc ( * ( ( _QWORD * ) @@src@@ + Number ) ) ; if ( ! * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) ) return Number ; } * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) = * ( ( _QWORD * ) @@src@@ + Number ) ; memcpy ( * ( void * * ) ( @@a1@@ [ Number ] + Number L ) , ( char * ) @@src@@ + Number , * ( ( _QWORD * ) @@src@@ + Number ) ) ; } else { free ( * ( void * * ) ( @@a1@@ [ Number ] + Number L ) ) ; * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) = Number L ; * ( _QWORD * ) ( @@a1@@ [ Number ] + Number L ) = Number L ; } * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) = Number ; if ( ! * ( _QWORD * ) ( * @@a1@@ + Number L ) ) return hapd_wps_reconfig_in_memory ( @@a1@@ , ( __int64 ) @@src@@ ) ; @@size@@ = strlen ( * ( const char * * ) ( * @@a1@@ + Number L ) ) + Number ; @@s@@ = ( char * ) malloc ( @@size@@ ) ; if ( ! @@s@@ ) return Number ; snprintf ( @@s@@ , @@size@@ , String , * ( const char * * ) ( * @@a1@@ + Number L ) ) ; @@stream@@ = fopen ( * ( const char * * ) ( * @@a1@@ + Number L ) , String ) ; if ( ! @@stream@@ ) { wpa_printf ( Number L , String ) ; free ( @@s@@ ) ; return Number ; } @@v9@@ = fopen ( @@s@@ , String ) ; if ( ! @@v9@@ ) { wpa_printf ( Number L , String ) ; free ( @@s@@ ) ; fclose ( @@stream@@ ) ; return Number ; } fwrite ( String , Number , Number , @@v9@@ ) ; fwrite ( String , Number , Number , @@v9@@ ) ; if ( ( unsigned int ) is_hex ( @@src@@ , * ( ( _QWORD * ) @@src@@ + Number ) ) ) { fwrite ( String , Number , Number , @@v9@@ ) ; for ( @@i@@ = Number L ; @@i@@ < * ( ( _QWORD * ) @@src@@ + Number ) ; ++ @@i@@ ) fprintf ( @@v9@@ , String , * ( ( unsigned __int8 * ) @@src@@ + @@i@@ ) ) ; } else { fwrite ( String , Number , Number , @@v9@@ ) ; for ( @@i@@ = Number L ; @@i@@ < * ( ( _QWORD * ) @@src@@ + Number ) ; ++ @@i@@ ) fputc ( * ( ( unsigned __int8 * ) @@src@@ + @@i@@ ) , @@v9@@ ) ; } fputc ( Number , @@v9@@ ) ; if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number && ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ) { @@v16@@ = Number ; } else if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ) { @@v16@@ = Number ; } else { @@v16@@ = ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ; } if ( @@v16@@ ) { fprintf ( @@v9@@ , String , @@v16@@ ) ; fwrite ( String , Number , Number , @@v9@@ ) ; @@v15@@ = ( const char * ) & unk_4629 ; if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ) { fwrite ( String , Number , Number , @@v9@@ ) ; @@v15@@ = String ; } if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ) fprintf ( @@v9@@ , String , @@v15@@ ) ; fputc ( Number , @@v9@@ ) ; fwrite ( String , Number , Number , @@v9@@ ) ; @@v15@@ = ( const char * ) & unk_4629 ; if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ) { if ( * ( _DWORD * ) ( @@a1@@ [ Number ] + Number L ) == Number ) fwrite ( String , Number , Number , @@v9@@ ) ; else fwrite ( String , Number , Number , @@v9@@ ) ; @@v15@@ = String ; } if ( ( * ( ( _WORD * ) @@src@@ + Number ) & Number ) != Number ) fprintf ( @@v9@@ , String , @@v15@@ ) ; fputc ( Number , @@v9@@ ) ; if ( * ( ( _QWORD * ) @@src@@ + Number ) > Number && * ( ( _QWORD * ) @@src@@ + Number ) <= Number ) { fwrite ( String , Number , Number , @@v9@@ ) ; for ( @@i@@ = Number L ; @@i@@ < * ( ( _QWORD * ) @@src@@ + Number ) ; ++ @@i@@ ) fputc ( * ( ( unsigned __int8 * ) @@src@@ + @@i@@ + Number ) , @@v9@@ ) ; LABEL_66 : fputc ( Number , @@v9@@ ) ; goto LABEL_73 ; } if ( * ( ( _QWORD * ) @@src@@ + Number ) == Number L ) { fwrite ( String , Number , Number , @@v9@@ ) ; for ( @@i@@ = Number L ; @@i@@ < * ( ( _QWORD * ) @@src@@ + Number ) ; ++ @@i@@ ) fputc ( * ( ( unsigned __int8 * ) @@src@@ + @@i@@ + Number ) , @@v9@@ ) ; goto LABEL_66 ; } wpa_printf ( Number L , String , * ( ( _QWORD * ) @@src@@ + Number ) ) ; } LABEL_73 : fwrite ( String , Number , Number , @@v9@@ ) ; fwrite ( String , Number , Number , @@v9@@ ) ; @@v17@@ = Number ; while ( fgets ( @@s1@@ , Number , @@stream@@ ) ) { if ( ! strncmp ( @@s1@@ , String , Number ) ) @@v17@@ = Number ; if ( ! @@v17@@ && ( ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) || ( unsigned int ) str_starts ( @@s1@@ , String ) ) ) { fprintf ( @@v9@@ , String , @@s1@@ ) ; } else { fputs ( @@s1@@ , @@v9@@ ) ; } } fclose ( @@v9@@ ) ; fclose ( @@stream@@ ) ; if ( rename ( @@s@@ , * ( const char * * ) ( * @@a1@@ + Number L ) ) >= Number ) { free ( @@s@@ ) ; eloop_register_timeout ( Number L , Number L , wps_reload_config , * @@a1@@ , Number L ) ; wpa_printf ( Number L , String ) ; result = Number L ; } else { v6 = _errno_location ( ) ; v7 = strerror ( * v6 ) ; wpa_printf ( Number L , String , v7 ) ; free ( @@s@@ ) ; result = Number ; } return result ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "_QWORD"}, "location": "r56"}, {"n": "a2", "t": {"T": 3, "t": "void"}, "location": "r64"}, {"n": "s1", "t": {"T": 2, "n": 1032, "s": 1, "t": "char"}, "location": "s1120"}, {"n": "i", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "s24"}, {"n": "v17", "t": {"T": 1, "n": "int", "s": 4}, "location": "s28"}, {"n": "v16", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s32"}, {"n": "v15", "t": {"T": 3, "t": "const char"}, "location": "s40"}, {"n": "src", "t": {"T": 3, "t": "void"}, "location": "s48"}, {"n": "v13", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s56"}, {"n": "size", "t": {"T": 1, "n": "size_t", "s": 8}, "location": "s64"}, {"n": "s", "t": {"T": 3, "t": "char"}, "location": "s72"}, {"n": "stream", "t": {"T": 3, "t": "FILE"}, "location": "s80"}, {"n": "v9", "t": {"T": 3, "t": "FILE"}, "location": "s88"}]}