# 以太坊智能合约逆向分析与实战：（2）深入了解以太坊虚拟机

By [Hackit](https://paragraph.com/@hackbot) · 2022-02-15

---

关于以太坊虚拟机的实现原理及操作码分析，我自身掌握的一些知识也比较零散，但网上有很好的资料可以学习，通过阅读一系列文章，有助于梳理自己的知识点，把一个个离散的点串成一条线，为更加深入的学习打下基础。

个人推荐这五篇文章，但由于时间紧张，我也没有工夫逐篇说明了，自己找想要的看吧。（建议前置知识：一些Solidity编程基础）

**Diving Into The Ethereum Virtual Machine 系列：**

*   [Introduction to the EVM assembly code.](https://medium.com/@hayeah/diving-into-the-ethereum-vm-6e8d5d2f3c30)
    
*   [How fixed-length data types are represented.](https://medium.com/@hayeah/diving-into-the-ethereum-vm-part-2-storage-layout-bc5349cb11b7)
    
*   [How dynamic data types are represented.](https://medium.com/@hayeah/diving-into-the-ethereum-vm-the-hidden-costs-of-arrays-28e119f04a9b)
    
*   [How ABI Encodes External Method Calling.](https://medium.com/@hayeah/how-to-decipher-a-smart-contract-method-call-8ee980311603)
    
*   [What is going on when a new contract is created.](https://medium.com/@hayeah/diving-into-the-ethereum-vm-part-5-the-smart-contract-creation-process-cb7b6133b855)
    

**有网友对以上文档制作了翻译版：**

*   [EVM汇编代码的介绍(第1部分)](https://www.jianshu.com/p/1969f3761208)
    
*   [固定长度数据类型的表示方法(第2部分)](https://www.jianshu.com/p/9df8d15418ed)
    
*   [动态数据类型的表示方法(第3部分)](https://www.jianshu.com/p/af5721c79505)
    
*   [ABI编码外部方法调用的方式(第4部分)](https://www.jianshu.com/p/d0e8e825d41b)
    
*   [一个新合约被创建后会发生什么(第5部分)](https://www.jianshu.com/p/d9137e87c9d3)
    

读完之后，相信你会对EVM的原理有深入的认识，或许会解答你的一些疑惑！

比如：

**EVM汇编代码与 Solidity 的对应关系是什么？**

答：请查阅第一部分。

**为什么有些人的钱包地址会比别人节省Gas?**

答：因为他们钱包地址0比较多（哈哈） 请查阅第一、第二部分。

**为什么有些合约操作这么费Gas？**

答：有些指令（尤其是存储）的Gas价格是很贵的。请查阅第一、第二部分。

**映射、数组这两种看似不同的数据结构，在虚拟机的存储器中是怎样的存在？**

答：其实数组属于是一种有着更加高级特征的映射，具体查阅第三部分。

**调用合约一定要ABI吗？ABI是如何对参数进行编码的？**

答：不一定。 ABI 可以将参数编码为字节序列，以进行交易的发送。详情参阅第四部分。

**当一个新合约被创建时，EVM里究竟发生了什么？**

答：说来话长，看第五部分吧！

_注:译文（第4部分）似乎URL打不开了，可尝试到_[_CSDN博客_](https://blog.csdn.net/qq_21518355/article/details/89306432)_查看。_

---

*Originally published on [Hackit](https://paragraph.com/@hackbot/2)*
