2

I found a smart contract. The address is '0x2fabe69843e9a74a35b89145cb52e5568986c7a1'.

I am really confused about is that why it need over 3000 lines Opcode to when Created this smart contract? Like some operation 'Balance' it didn't show in the Source Code.

How to analyze the Opcode based on the Source Code The Source code is below:

pragma solidity ^0.4.11;

contract IMG{


    function IMG(){

    }

    function read() returns(string){

        return "FF D8 FF E0 00 10 4A 46 49 46 00 01 01 00 00 01 00 01 00 00 FF DB 00 84 00 28 28 28 28 2B 28 2D 32 32 2D 3F 44 3C 44 3F 5D 55 4E 4E 55 5D 8C 64 6C 64 6C 64 8C D5 85 9B 85 85 9B 85 D5 BC E4 B9 AD B9 E4 BC FF FF EB EB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 01 28 28 28 28 2B 28 2D 32 32 2D 3F 44 3C 44 3F 5D 55 4E 4E 55 5D 8C 64 6C 64 6C 64 8C D5 85 9B 85 85 9B 85 D5 BC E4 B9 AD B9 E4 BC FF FF EB EB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF C0 00 11 08 00 80 00 80 03 01 22 00 02 11 01 03 11 01 FF C4 00 6C 00 00 02 03 01 00 00 00 00 00 00 00 00 00 00 00 00 03 04 00 01 02 05 10 00 02 02 01 03 04 01 04 03 01 00 00 00 00 00 00 00 01 02 11 03 12 21 31 04 13 41 51 61 14 22 23 42 32 62 71 B1 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 02 03 11 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 01 11 21 02 31 51 FF DA 00 0C 03 01 00 02 11 03 11 00 3F 00 7C 85 30 11 CC 9F 27 07 53 04 29 3B 2C 08 51 08 04 21 08 04 21 0A 02 C8 42 80 B2 88 40 21 08 50 00 EE 48 07 EE C7 B4 21 7C D0 AA 68 D6 C5 48 C9 AF F0 32 98 BA FF 00 4D 53 5E 51 03 1A D1 76 80 46 B8 34 F6 08 2D A2 5A 17 73 33 DC 18 1A 2C 5A 39 53 B2 D6 52 E2 19 A2 52 00 B2 7C 11 E5 A7 43 03 1A 51 7A 50 A7 D4 04 8E 6B 18 74 7D 31 26 98 83 D7 23 2E 6D 72 C7 0E B3 DD 89 52 94 65 16 81 F6 4A ED 31 C5 61 3F 46 B6 F4 8A 94 5C 4C D8 56 CA 77 5B 92 0A 4C D6 8F 0D 84 44 B6 D4 56 26 E5 BF 80 D3 8B 78 DA 46 63 50 82 44 18 8B 50 96 44 09 34 D2 51 37 CF 92 94 6A CA 37 07 6A D7 00 BB 92 D7 A4 62 15 54 0E 10 FC ED BE 06 98 AC 97 15 60 D5 3A A7 4F 90 B9 93 7B 24 E8 03 8B F0 20 61 64 69 03 72 DC CA BA A3 51 AF 20 3A 41 3E EC 89 DD 90 C3 4C E4 DE 0C 4A D4 6D B0 DD D6 D5 01 58 96 57 BF 02 70 17 BF 05 01 07 97 34 DE C3 F9 FA 78 C3 0D C2 22 53 7A 31 AA 2C C4 B5 B5 9F 3E 2A D6 9D 0F B8 AC 98 B5 2E 1A 38 FA F2 CD 69 B6 D1 D6 C1 3D 18 61 01 EA 48 79 B6 A9 41 AA 33 38 B7 B2 18 BF 26 7B 91 4C C6 D6 B1 23 8D C6 22 73 EA A3 09 34 B7 61 FA 9C ED C3 44 0E 5C 23 A6 DB 46 E4 D6 6D B0 67 D4 E4 93 FE 21 F1 F5 38 E5 B3 54 C5 5F 53 36 AA A2 65 AD 51 4D 72 6A F9 8C CA E8 4D 24 DB 45 25 68 1C BA 6C CA 09 A6 0E 12 9C 5D 48 CB 4E 96 94 56 88 97 A9 13 52 32 A5 F2 AB D9 18 57 1D 86 52 5B B6 2D 91 A9 3E 4A 0B 0C B3 5E 42 D6 39 FF 00 2C 11 15 8A 7A 92 1B 8C B7 5E 59 29 8D 68 BF D5 46 3E 12 10 73 8F 71 AD 47 5A 3F 27 37 AB E9 E1 1F CB 01 0D 62 79 12 5B CC 98 57 71 8B E1 C5 DF 92 4D 9D 8C 38 31 61 5F 69 AB 38 6E 52 D3 C4 D4 D4 90 69 C3 0E 48 FD F0 09 92 5A 39 4E 80 AC 8B C7 06 3A BF 4B 7D 27 4B EE 61 A0 B0 62 A7 1C 66 72 71 A8 0B 6D EE 6F B5 30 79 75 36 2F 26 A4 B7 2A DB 75 46 96 36 B6 03 5A 24 4D 12 F6 34 53 E0 9A 61 59 CA 55 B3 07 0C 6D BB 61 92 B4 EC D2 D8 2A A1 8D 26 34 B4 C7 60 29 A2 F5 7C 90 30 E7 4B 81 1C F9 B6 68 C6 5C AD 6C 85 9E 39 4B 79 1A 91 04 E9 B2 51 D3 8E 4B F1 67 1B B7 28 F0 12 19 DA 74 CD 59 A8 EB 6B 8F 87 40 67 04 FF 00 AF FC 06 B2 36 4B 66 1A 54 A2 E9 AB 14 B7 17 BA 63 8D 58 09 5D D3 42 01 AC CB D0 7C 6F DB 16 9E 3F 46 61 91 C5 9A 47 4F 51 7A 91 44 D8 C3 58 06 4D 9E A4 C1 77 02 E4 DC 5B B3 E9 96 58 65 30 A5 65 49 FC 80 ED 4D 71 23 32 86 5F 65 E2 77 F0 C2 A6 C2 3A 13 83 C9 17 BA 36 F2 BB E1 8C 07 69 0B CE 09 98 96 67 E9 99 EE 4B D3 35 89 AD A9 4E 21 63 95 BF 1B 80 52 6F F5 61 62 FF 00 AB 00 FA AC A7 2F 0C CD FC 03 7A BD 11 56 EF C0 27 BF 3C 9A 4D F9 4C A9 4B C5 15 1D 32 99 08 72 74 09 99 A3 6C C8 54 A2 9A 34 5D 00 3A 29 A3 74 53 03 14 BD 15 48 D9 28 0C D2 2D 23 5A 4B A0 2A 8A 68 D1 90 2A 8A A3 44 03 FF D9";
    }
0

Most of the bytes in the code of this contract belong to the .data section where the constant string is stored (returned by read).

You can use http://remix.ethereum.org to compile the contract, view the assembly and trace the transaction step by step.

  • I am really confused is why the how to connect the instructions with the source code? I tried Remix, but I am still confused about how to connect each step with the source code. Thank you. – Gabriel Mike Apr 8 '18 at 15:47
  • You can deploy the contract, then press on the debug button. It will open the transaction in the debugger and you can step through it. – ivicaa Apr 8 '18 at 18:38
0

The long hexadecimal string is not OpCode. From the first few bytes, "FF D8 FF E0", this is the signature of JPEG files. The contract essentially stores the raw bytes of a picture.

If the data is valid, one can save it as a JPEG file to restore the picture. However, one needs to be careful before trusting and viewing the data. See also here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.