Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while building stub #1

Closed
nzyuko opened this issue May 24, 2023 · 4 comments
Closed

Error while building stub #1

nzyuko opened this issue May 24, 2023 · 4 comments

Comments

@nzyuko
Copy link

nzyuko commented May 24, 2023

Compiling memexec v0.2.0
error[E0425]: cannot find value IMAGE_REL_BASED in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:38:36
|
38 | if (item >> 12) == IMAGE_REL_BASED {
| ^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_THUNK_DATA in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:80:79
|
80 | base_addr.offset(import_desc.FirstThunk as isize) as *mut IMAGE_THUNK_DATA,
| ^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_THUNK_DATA in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:82:35
|
82 | as *const IMAGE_THUNK_DATA,
| ^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_THUNK_DATA in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:86:79
|
86 | base_addr.offset(import_desc.FirstThunk as isize) as *mut IMAGE_THUNK_DATA,
| ^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_THUNK_DATA in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:87:81
|
87 | base_addr.offset(import_desc.FirstThunk as isize) as *const IMAGE_THUNK_DATA,
| ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value IMAGE_ORDINAL_FLAG in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:97:33
|
97 | if thunk_data & IMAGE_ORDINAL_FLAG != 0 {
| ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_THUNK_DATA in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:119:45
|
119 | *iat_ptr = proc_addr as IMAGE_THUNK_DATA;
| ^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_THUNK_DATA in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:153:45
|
153 | *iat_ptr = proc_addr as IMAGE_THUNK_DATA;
| ^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type IMAGE_TLS_DIRECTORY in this scope
--> /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peloader/mod.rs:169:60
|
169 | let tls = &*mem::transmute::<*const c_void, *const IMAGE_TLS_DIRECTORY>(
| ^^^^^^^^^^^^^^^^^^^
|
::: /home/kali/.cargo/registry/src/github.com-1ecc6299db9ec823/memexec-0.2.0/src/peparser/def.rs:84:9
|
84 | pub struct $name {
| ---------------- similarly named struct IMAGE_TLS_DIRECTORY32 defined here
|
help: a struct with a similar name exists
|
169 | let tls = &*mem::transmute::<*const c_void, *const IMAGE_TLS_DIRECTORY32>(
| ~~~~~~~~~~~~~~~~~~~~~
help: you might be missing a type parameter
|
166 | unsafe fn call_tls_callback<IMAGE_TLS_DIRECTORY>(pe: &PE, base_addr: *const c_void) -> Result<()> {
| +++++++++++++++++++++

Some errors have detailed explanations: E0412, E0425.
For more information about an error, try rustc --explain E0412.
error: could not compile memexec due to 9 previous errors

@Amaop
Copy link
Owner

Amaop commented May 24, 2023

can you show me your cargo build command that you used please?

@nzyuko
Copy link
Author

nzyuko commented May 24, 2023

cargo build --release

@Amaop
Copy link
Owner

Amaop commented May 24, 2023

try this mate, cargo build --target x86_64-pc-windows-gnu --release
youre building on kali so cargo is defaulting to linux, this should work

@nzyuko
Copy link
Author

nzyuko commented May 24, 2023

yeah this fixed it thanks

@nzyuko nzyuko closed this as completed May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants