You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So to sum up, I found that the PC address reported does not match the disassemble code generated by solc. I don't know if I made any mistake in usage or if I apprehend the meaning of PC addresswrongly.
Thanks for your help!!
Tests
Let's use the example in README:
root@i10940x:/home/usr/mythril# myth analyze solidity_examples/killbilly.sol -t 3
==== Unprotected Selfdestruct ====
SWC ID: 106
Severity: High
Contract: KillBilly
Function name: commencekilling()
PC address: 354
Code: selfdestruct(msg.sender)
Estimated Gas Usage: 974 - 1399
Any sender can cause the contract to self-destruct.
Any sender can trigger execution of the SELFDESTRUCT instruction to destroy this contract account and withdraw its balance to an arbitrary address. Review the transaction trace generated for this issue and make sure that appropriate security controls are in place to prevent unrestricted access.
--------------------
In file: solidity_examples/killbilly.sol:22
selfdestruct(msg.sender)
--------------------
Initial State:
Account: [CREATOR], balance: 0x0, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x0, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [ATTACKER], function: killerize(address), txdata: 0x9fa299ccadadadadadadadadadadadaddeadbeefdeadbeefdeadbeefdeadbeefdeadbeef, value: 0x0
Caller: [ATTACKER], function: activatekillability(), txdata: 0x84057065, value: 0x0
Caller: [ATTACKER], function: commencekilling(), txdata: 0x7c11da20, value: 0x0
There is an item in the report PC address: 354. I considered it as the offset of the opcode in bytecode. Like here, I think at PC address: 354, the opcode should be CALL, but when I try to check this out by reading the disassemble code generated by solc, I found they are different. The disassemble code looks like this at 354 (equal to 0x162)
which is a pop.
Same thing happen when handling integer overflow, the PC address does not match the disassemble code generated by solc. For example, mythril reports PC address : 100, but the opcode in the disassemble code at offset 100 may not be MUL, ADD or other opcodes that might lead to overflow, instead, opcode at offset 100 might be POPCALL or other things.
Thanks for your help!!
The text was updated successfully, but these errors were encountered:
Description
So to sum up, I found that the
PC address
reported does not match the disassemble code generated by solc. I don't know if I made any mistake in usage or if I apprehend the meaning ofPC address
wrongly.Thanks for your help!!
Tests
Let's use the example in README:
There is an item in the report
PC address: 354
. I considered it as the offset of the opcode in bytecode. Like here, I think atPC address: 354
, the opcode should beCALL
, but when I try to check this out by reading the disassemble code generated bysolc
, I found they are different. The disassemble code looks like this at 354 (equal to 0x162)which is a pop.
Same thing happen when handling integer overflow, the
PC address
does not match the disassemble code generated bysolc
. For example, mythril reportsPC address : 100
, but the opcode in the disassemble code at offset 100 may not beMUL
,ADD
or other opcodes that might lead to overflow, instead, opcode at offset 100 might bePOP
CALL
or other things.Thanks for your help!!
The text was updated successfully, but these errors were encountered: