上一页 1 2 3 4 5 6 7 8 ··· 30 下一页
摘要: # blockchain | ethernaut 11 Elevator 这关就是简单的合约交互,以及view/pure函数的编写。 合约: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface B 阅读全文
posted @ 2023-09-06 14:41 Mz1 阅读(20) 评论(0) 推荐(0)
摘要: # blockchain | ethernaut 09 King 这关考察的是合约地址转账时的细节。 在合约中进行转账可以transfer,send,或者底层的call。 transfer如果出错会回退撤销执行。 所以如果transfer到一个不接受转账的合约地址,就没办法成功。 题目合约如下: ` 阅读全文
posted @ 2023-09-06 11:26 Mz1 阅读(50) 评论(0) 推荐(0)
摘要: # blockchain | ethernaut 08 Vault 这关考察读取私有变量,直接getStorageAt即可。 顺便说明: web3.js读取public变量可以直接contract.methods.[变量名].call()获取 对于私有变量需要用插槽位置的方式去读。 exp: ``` 阅读全文
posted @ 2023-09-05 17:14 Mz1 阅读(28) 评论(0) 推荐(0)
摘要: # blockchain | ethernaut 07 Force 考察给一个合约强制转账,在一个合约selfdestruct()的时候是可以指定转账地址的。 exp: hack合约: ```solidity pragma solidity ^0.8.0; contract Hack { const 阅读全文
posted @ 2023-09-02 17:04 Mz1 阅读(26) 评论(0) 推荐(0)
摘要: # blockchain | ethernaut 05 Token 考察无符号整数溢出。 合约: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract Token { mapping(address 阅读全文
posted @ 2023-09-01 16:19 Mz1 阅读(15) 评论(0) 推荐(0)
摘要: # blockchain | ethernaut 04 Telephone 这关展示了tx.origin和msg.sender之间的区别。 msg.sender是直接调用者。 tx.origin是这次交易的发起者。 合约如下: ```solidity // SPDX-License-Identifi 阅读全文
posted @ 2023-09-01 15:58 Mz1 阅读(22) 评论(0) 推荐(0)
摘要: # blockchain | Ethernaut 03 coin flip 投硬币合约,用区块哈希来当随机数。 合约代码: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract CoinFlip { 阅读全文
posted @ 2023-08-31 21:52 Mz1 阅读(37) 评论(0) 推荐(0)
摘要: # Blockchain | geth1.12的一些问题 最近重装了geth,是最新的geth version 1.12.2-stable-bed84606 但是这个版本似乎挖不了矿了,不再PoW了。 ![image](https://img2023.cnblogs.com/blog/2154950 阅读全文
posted @ 2023-08-31 15:15 Mz1 阅读(141) 评论(0) 推荐(0)
摘要: # 逆向 | 简单调试器进程检测、虚拟机进程检测、启动路径检测、计算机名检测 写在自己书里的代码,丢一份到blog。 简单调试器检测: ```cpp #include #include // 定义枚举值 const int ProcessDebugPort = 0x7; const int Proc 阅读全文
posted @ 2023-08-21 20:20 Mz1 阅读(68) 评论(0) 推荐(0)
摘要: # Blockchain | web3.js 合约交互模板 最近发现ethers.js没有想象的那么好用了。。。 就换成了web3.js。 环境是node和web3.js v4。 这玩意儿还是得看文档,很麻烦,嗐,方法又多又烂,难用。 ```javascript const Web3 = requi 阅读全文
posted @ 2023-08-20 15:02 Mz1 阅读(95) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 30 下一页