crytic / ethersplay

EVM dissassembler
GNU Affero General Public License v3.0
834 stars 116 forks source link

Duplicated contract code when opened in ethersplay #44

Closed offlinemark closed 5 years ago

offlinemark commented 5 years ago

when you open this file, it seems there is an extra copy of the dispatch stub and the fallback function appended to the end.

[I] mark forge ~/c/e/s/tmp ❯ xxd fallback-empty-func.evm
00000000: 4556 4d60 8060 4052 6004 3610 603f 5760  EVM`.`@R`.6.`?W`
00000010: 0035 7c01 0000 0000 0000 0000 0000 0000  .5|.............
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 9004 63ff ffff ff16 8063 0c55 699c 1460  ..c......c.Ui..`
00000040: 4d57 5b34 8015 604a 5760 0080 fd5b 5000  MW[4..`JW`...[P.
00000050: 5b34 8015 6058 5760 0080 fd5b 5060 5f60  [4..`XW`...[P`_`
00000060: 6156 5b00 5b56 00a1 6562 7a7a 7230 5820  aV[.[V..ebzzr0X
00000070: 210d ee2f 7e07 8f5b e8b2 aaf3 a368 8021  !../~..[.....h.!
00000080: 4511 6015 dd72 47bd 89a0 ee26 f6d8 33ef  E.`..rG....&..3.
00000090: 0029 0a                                  .).

fallback-empty-func.evm.zip

image

offlinemark commented 5 years ago

nevermind, this was my fault. it was because i used vim to add the EVM file magic, which also added a newline to the end of the file. this slightly messes up the offsets used in the interval set.

joshwatson commented 5 years ago

Well, fortunately, the refactor doesn't have the EVM header requirement :)