The invention discloses a binary-based system for detecting a memory modifying attack and positioning a bug, which comprises a code converting unit, a basic block data dependency relation recording unit, a code inserting unit and a bug positioning unit, wherein the code converting unit is used for converting x86 binary codes into VEX in the form of Valgrind intermediate codes; the code inserting unit comprises a color transmission code inserting part, an attack detecting code inserting part and a memory pollution command recording code inserting part, is used for dynamic staining analysis and can effectively detect the abnormal condition of memory data with the implementation of a program and record a writing command of a polluted memory; and the bug positioning unit comprises a modified memory address positioning part and a memory modifying command positioning part and is used for finding a memory address modified by an outer input and finding the address of the writing command modifying the memory to complete final positioning. The binary-based system can effectively detect the memory modifying attack and position the bug accurately.