SoftSec-KAIST / Smartian

Smartian: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses (ASE '21)
MIT License
138 stars 21 forks source link

Source request #7

Open codetronik opened 8 months ago

codetronik commented 8 months ago

I'm trying to modify the source and use it because it doesn't support the latest evm.

Unhandled exception. System.Exception: Failed to find codecopy
   at B2R2.MiddleEnd.Reclaimer.EVMCodeCopyAnalysis.findCodeCopyOffset(BinHandle hdl, BinaryPointer bp, FSharpList`1 pushList) in /mnt/c/Workspace/Smartian/EVMAnalysis/B2R2/src/MiddleEnd/Reclaimer/EVMCodeCopyAnalysis.fs:line 53
   at B2R2.MiddleEnd.Reclaimer.EVMCodeCopyAnalysis.recoverCopiedCode(BinEssence ess) in /mnt/c/Workspace/Smartian/EVMAnalysis/B2R2/src/MiddleEnd/Reclaimer/EVMCodeCopyAnalysis.fs:line 66
   at B2R2.MiddleEnd.Reclaimer.EVMCodeCopyAnalysis.B2R2.MiddleEnd.Reclaimer.IAnalysis.Run(BinEssence ess, AnalysisHint hint) in /mnt/c/Workspace/Smartian/EVMAnalysis/B2R2/src/MiddleEnd/Reclaimer/EVMCodeCopyAnalysis.fs:line 78
   at Microsoft.FSharp.Collections.ListModule.Fold[T,TState](FSharpFunc`2 folder, TState state, FSharpList`1 list) in D:\a\_work\1\s\src\FSharp.Core\list.fs:line 295
   at B2R2.MiddleEnd.Reclaimer.Reclaimer.run(FSharpList`1 analyses, BinEssence ess) in /mnt/c/Workspace/Smartian/EVMAnalysis/B2R2/src/MiddleEnd/Reclaimer/Reclaimer.fs:line 32
   at EVMAnalysis.Parse.run(String binFile, String abiFile) in /home/code/Smartian/EVMAnalysis/src/FrontEnd/Parse.fs:line 65
   at EVMAnalysis.TopLevel.parseAndAnalyze(String binFile, String abiFile) in /home/code/Smartian/EVMAnalysis/src/Analysis/TopLevel.fs:line 96
   at Smartian.Fuzz.initializeWithDFA(FuzzOption opt) in /home/code/Smartian/src/Fuzz/Fuzz.fs:line 21
   at Smartian.Fuzz.run[a](String[] args) in /home/code/Smartian/src/Fuzz/Fuzz.fs:line 144
   at Smartian.Main.runMode(String mode, String[] optArgs) in /home/code/Smartian/src/Main/Main.fs:line 14
   at Smartian.Main.main(String[] args) in /home/code/Smartian/src/Main/Main.fs:line 22

The B2R2 path does not have a file like EVMCodeCopyAnalysis.fs. Perhaps it is a source created by the developer himself, not a file included in B2R2.

Is there any way I can get these files?

faustocarva commented 3 months ago

Having this source out of those DLL files would be great, as we can make experiments and new enhanced versions of Smartian.

leosol commented 3 months ago

Just Up(ing) the issue! also interested in the sources.

jchoi2022 commented 3 months ago

Thank you for bringing this up. Previously, some parts of the B2R2 (so called "middle-end" module) was closed-sourced for a couple years. But just few months ago, those parts have been also switched to open-source.

So I can provide the full source code now. I will prepare the commits and push within few weeks. Thank you!

faustocarva commented 3 months ago

Thank you for bringing this up. Previously, some parts of the B2R2 (so called "middle-end" module) was closed-sourced for a couple years. But just few months ago, those parts have been also switched to open-source.

So I can provide the full source code now. I will prepare the commits and push within few weeks. Thank you!

Thanks!

jchoi2022 commented 3 months ago

In the latest commit of main branch, I made the full source code is available. Now, the front-end (B2R2) code will be cloned from the fork at https://github.com/infosec-sogang/B2R2.

Besides, the bug itself seems to be similar to issue #4. I'm trying to look into these front-end bugs, but I think it will require more time to fix them.