Skip to content

Commit

Permalink
✏️ Fix a typo in v8_exports.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShellWen committed Oct 19, 2023
1 parent e964f1a commit 23d4fdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/core/src/v8_exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub const V8_CONTEXT_GET_ISOLATE_SYMBOL: &str = "_ZN2v87Context10GetIsolateEv";
pub const V8_CONTEXT_GET_ISOLATE_SYMBOL: &str = "?GetIsolate@Context@v8@@QEAAPEAVIsolate@2@XZ";

#[cfg(any(target_os = "linux", target_os = "macos"))]
pub const V8_STRING_NEW_FROM_UTF8_PTR: &str =
pub const V8_STRING_NEW_FROM_UTF8_SYMBOL: &str =
"_ZN2v86String11NewFromUtf8EPNS_7IsolateEPKcNS_13NewStringTypeEi";
#[cfg(target_os = "windows")]
pub const V8_STRING_NEW_FROM_UTF8_PTR: &str = "?NewFromUtf8@String@v8@@SA?AV?$MaybeLocal@VString@v8@@@2@PEAVIsolate@2@PEBDW4NewStringType@2@H@Z";
pub const V8_STRING_NEW_FROM_UTF8_SYMBOL: &str = "?NewFromUtf8@String@v8@@SA?AV?$MaybeLocal@VString@v8@@@2@PEAVIsolate@2@PEBDW4NewStringType@2@H@Z";
4 changes: 2 additions & 2 deletions crates/core/src/v8_sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::ffi::{c_char, c_int, c_void};
use frida_gum::Module;

use crate::v8_exports::{
V8_CONTEXT_GET_ISOLATE_SYMBOL, V8_STRING_NEW_FROM_UTF8_PTR, V8_STRING_UTF8LENGTH_SYMBOL,
V8_CONTEXT_GET_ISOLATE_SYMBOL, V8_STRING_NEW_FROM_UTF8_SYMBOL, V8_STRING_UTF8LENGTH_SYMBOL,
V8_STRING_WRITE_UTF8_SYMBOL,
};

Expand Down Expand Up @@ -123,7 +123,7 @@ pub(crate) unsafe fn v8_string_new_from_utf8(
length: i32,
) -> V8Local<V8String> {
let v8_string_new_from_utf8_ptr =
Module::find_export_by_name(None, V8_STRING_NEW_FROM_UTF8_PTR).unwrap();
Module::find_export_by_name(None, V8_STRING_NEW_FROM_UTF8_SYMBOL).unwrap();
let v8_string_new_from_utf8_func: v8__String__NewFromUtf8 =
std::mem::transmute(v8_string_new_from_utf8_ptr.0);

Expand Down

0 comments on commit 23d4fdd

Please sign in to comment.