With the continuous improvement in oilfield development and the application of tertiary oil recovery technology, the water content of oilfield-produced fluids has gradually increased, and a large number of oilfield sewage with complex components has also been produced after oil–water separation, and effective treatment is urgently needed. ASP flooding sewage contains alkali, various surfactants, polymers, microemulsion oil droplets, and solid impurities, which are difficult to be effectively treated by traditional water treatment agents and methods. In this study, aminopropyl triethoxysilane (APTES) was used to modify the nano-Fe3O4 coated with tetraethyl silicate (TEOS). The product was used as the ferromagnetic nano-core for the iterative reaction of Michael addition and ester amidation to synthesize a magnetic hyperbranched polyamide amine, and its performance in the treatment of ASP flooding wastewater was evaluated experimentally. For the preparation of APTES-modified Fe3O4@SiO2 (FOSN) product, TEOS was coated over Fe3O4 in an ethanol aqueous solution environment and then APTES was added dropwise. The first-generation branched product (1-FSMN) was obtained by the reaction of FOSN and methyl acrylate graft product (FOSN-M) with ethylenediamine, and the highest yield was 93.7%. The highest yield of the second-generation branched product (2-FSMN) was 91.6%. In this study, a composite flooding wastewater sample from a block in the Bohai oilfield was taken. The suspended solids content was 143 mg/L, the oil content was 921.09 mg/L, the turbidity was 135 NTU, and the zeta potential was −47 mV. The third-generation hyperbranched polymer (3-FSMN) and its quaternary ammonium salt (3-FSMN-Q) performed best in the appropriate dosage range, with the highest oil removal rate of 97%, suspended solid removal rate of 90.3%, turbidity reduction rate of 86.6% and zeta potential reduction rate of 88%. For 3-FSMN and its quaternary ammonium salt, the gravity/magnetic PAC compound treatment experiment was carried out. In the settlement time of only 5 min, 3-FSMN/PAC and 3-FSMN-Q/PAC can achieve the maximum oil removal rate of 87.1% and suspended solids removal rate of 87.3% for polymer containing wastewater from ASP flooding, and 86.3 and 86.0% for 120 mg/L. Its treatment capacity was much better than that of common treatment agent combination (CPAM/PAC).