A method of simulating the effects of an attack seeking fraudulently to modify target code that can be executed or interpreted by a processor, the method comprising: · a search step of searching for at least one set of at least one sensitive instruction in said target code; · a generation step of generating at least one executable or interpretable "simulation" code having instructions representing the result of said attack on said at least one set as a function of at least one rule associated with said at least one set in a database; • a selection step of selecting at least one memory register (VAR_PIN, FN_AG) that might be accessed during execution or interpretation of said simulation code; • an execution or interpretation step of executing or interpreting at least a portion of said simulation code; and • a storage step of storing at least one value of said at least one register (VAN_PIN, FN_AG) during said execution or said interpretation to enable the effects of said attack to be analyzed, said method being characterized in that said at least one register corresponds to: - instructions performing password verification functions or cryptographic functions; or - data corresponding to values of cryptographic keys; and in that: - during said search step, a search is made in said target code for all of the sensitive instructions complying with at least one predetermined model; and in that - during said generation step, generating all possible simulation codes by subjecting each of said sensitive instructions to each of said rules that are applicable to said sensitive instructions. · a search step of searching for at least one set of at least one sensitive instruction in said target code; · a generation step of generating at least one executable or interpretable "simulation" code having instructions representing the result of said attack on said at least one set as a function of at least one rule associated with said at least one set in a database; • a selection step of selecting at least one memory register (VAR_PIN, FN_AG) that might be accessed during execution or interpretation of said simulation code; • an execution or interpretation step of executing or interpreting at least a portion of said simulation code; and • a storage step of storing at least one value of said at least one register (VAN_PIN, FN_AG) during said execution or said interpretation to enable the effects of said attack to be analyzed, said method being characterized in that said at least one register corresponds to: - instructions performing password verification functions or cryptographic functions; or - data corresponding to values of cryptographic keys; and in that: - during said search step, a search is made in said target code for all of the sensitive instructions complying with at least one predetermined model; and in that - during said generation step, generating all possible simulation codes by subjecting each of said sensitive instructions to each of said rules that are applicable to said sensitive instructions. - instructions performing password verification functions or cryptographic functions; or - data corresponding to values of cryptographic keys; and in that: - during said search step, a search is made in said target code for all of the sensitive instructions complying with at least one predetermined model; and in that - during said generation step, generating all possible simulation codes by subjecting each of said sensitive instructions to each of said rules that are applicable to said sensitive instructions.