From 0e15aa359075235b0a85a361f2839219c2c6c72a Mon Sep 17 00:00:00 2001 From: Mikhael Skvortsov Date: Thu, 20 Oct 2022 22:06:09 +0300 Subject: [PATCH 1/3] Add cpp selector --- src/disasm/commands.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/disasm/commands.rs b/src/disasm/commands.rs index cb6b0e8a..2b34d456 100644 --- a/src/disasm/commands.rs +++ b/src/disasm/commands.rs @@ -260,6 +260,11 @@ fn disasm_text_command(m: &ArgMatches) -> Status { .branch(Shape::var("dict-c3") .branch(Shape::any())); // just to mark any() as used, can be omitted + let shape_cpp = Shape::literal("ff0020c101f4a4205892f4a0e05f028a20ed53d9") + .branch(Shape::var("dict-public")) + .branch(Shape::literal("f4a420f4a1") + .branch(Shape::var("code-c3"))); + let code = roots.remove(0).reference(0).unwrap(); if let Ok(assigned) = shape_deprecated1.captures(&code) { println!(";; solidity deprecated selector detected"); @@ -287,6 +292,12 @@ fn disasm_text_command(m: &ArgMatches) -> Status { println!(";; fun-c selector detected"); println!(";; internal functions dictionary"); print_code_dict(&assigned["dict-c3"], 19); + } else if let Ok(assigned) = shape_cpp.captures(&code) { + println!(";; cpp selector detected"); + println!(";; public methods dictionary"); + print_code_dict(&assigned["dict-public"], 32); + println!(";; internal functions dictionary"); + print_code_dict(&assigned["code-c3"], 32); } else { bail!("failed to recognize selector") } From d09bc347666d167528cf7d7154e7313ac6b61691 Mon Sep 17 00:00:00 2001 From: Mikhael Skvortsov Date: Thu, 20 Oct 2022 22:21:07 +0300 Subject: [PATCH 2/3] Add MYCODE insn --- src/disasm/handlers.rs | 1 + src/disasm/loader.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/disasm/handlers.rs b/src/disasm/handlers.rs index 5e280210..66fbde9f 100644 --- a/src/disasm/handlers.rs +++ b/src/disasm/handlers.rs @@ -798,6 +798,7 @@ impl Handlers { .set(0x27, Loader::balance) .set(0x28, Loader::my_addr) .set(0x29, Loader::config_root) + .set(0x2a, Loader::my_code) .set(0x30, Loader::config_dict) .set(0x32, Loader::config_ref_param) .set(0x33, Loader::config_opt_param) diff --git a/src/disasm/loader.rs b/src/disasm/loader.rs index e45f8286..42412357 100644 --- a/src/disasm/loader.rs +++ b/src/disasm/loader.rs @@ -1646,6 +1646,7 @@ impl Loader { create_handler_2!(balance, 0xf827, "BALANCE"); create_handler_2!(my_addr, 0xf828, "MYADDR"); create_handler_2!(config_root, 0xf829, "CONFIGROOT"); + create_handler_2!(my_code, 0xf82a, "MYCODE"); create_handler_2!(config_dict, 0xf830, "CONFIGDICT"); create_handler_2!(config_ref_param, 0xf832, "CONFIGPARAM"); create_handler_2!(config_opt_param, 0xf833, "CONFIGOPTPARAM"); From 3315bef05b175dfe917305539e2b6c2935b341f3 Mon Sep 17 00:00:00 2001 From: Mikhael Skvortsov Date: Wed, 25 Jan 2023 00:05:56 +0300 Subject: [PATCH 3/3] Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a89df4da..5fde3f70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1325,7 +1325,7 @@ dependencies = [ [[package]] name = "tvm_linker" -version = "0.19.1" +version = "0.19.2" dependencies = [ "assert_cmd", "base64 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 29510d9d..fa3be58c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license-file = 'LICENSE.md' name = 'tvm_linker' readme = 'README.md' repository = 'https://github.com/tonlabs/TVM-linker' -version = '0.19.1' +version = '0.19.2' [[bin]] name = 'tvm_linker'