darkarp / chromepass

Chromepass - Hacking Chrome Saved Passwords
GNU Affero General Public License v3.0
772 stars 109 forks source link

Error building the client. Could not compile ntapi #52

Open aggnostos opened 1 year ago

aggnostos commented 1 year ago

An error occurred while building the client. Although server was built successfully.

error[E0793]: reference to packed field is unaligned
--> C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\ntexapi.rs:2785:52
|
2785 |         *tick_count.QuadPart_mut() = read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad);
|                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

error[E0793]: reference to packed field is unaligned
--> C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\ntexapi.rs:2809:25
|
2809 |         ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad)
|                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

For more information about this error, try `rustc --explain E0793`.
error: could not compile `ntapi` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
[-] Client couldn't be copied: [Errno 2] No such file or directory: 'templates/chromepass-build/target/release/chromepass.exe'
[-] Error building the client
QYH2MMT4EVER commented 1 year ago

Have you solved this problem? I am stuck in the same problem! Could you plz give me some help to fix up this problem?

QYH2MMT4EVER commented 1 year ago

@Lian39

darkarp commented 1 year ago

I will look into this issue

aggnostos commented 1 year ago

@QYH2MMT4EVER No

SHarksGANG commented 1 year ago

### Hi ! How to fix it ?

Compiling solana-frozen-abi-macro v1.14.12 error[E0793]: reference to packed field is unaligned --> C:\Users\Arcturus.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.7\src\ntexapi.rs:2783:52 2783 tick_count.QuadPart_mut() = read_volatile(&(USER_SHARED_DATA).u.TickCountQuad); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned --> C:\Users\Arcturus.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.7\src\ntexapi.rs:2807:25 2807 ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

Compiling miow v0.3.7 For more information about this error, try rustc --explain E0793. error: could not compile ntapi due to 2 previous errors warning: build failed, waiting for other jobs to finish... error: failed to compile spl-token-cli v2.4.0, intermediate artifacts can be found at C:\Users\Arcturus\AppData\Local\Temp\cargo-installNHDEtX

C:\Windows\System32>cargo -V cargo 1.69.0 (6e9a83356 2023-04-12)

C:\Windows\System32>

yuezhao238 commented 1 year ago

ntapi v0.4.1 code may help :) https://github.com/MSxDOS/ntapi/blob/master/src/ntexapi.rs

SHarksGANG commented 1 year ago

Код NTAPI v0.4.1 может помочь :) https://github.com/MSxDOS/ntapi/blob/master/src/ntexapi.rs

Thank you very much! I'll test it

guanaug commented 1 year ago

I solved it by the following step:

cd templates/chromepass-build/ && cargo update
codingpeace commented 1 year ago

@guanaug Thank you, it's work.

darkarp commented 1 year ago

Thanks for the report. Working on a reboot for this to update the structure and all the dependencies. It will all get fixed in the next version with more optional AV/EDR evasion too.

noe8xc commented 11 months ago

Hi, I have the same error, I have done the update cd templates/chromepass-build/ && cargo update but I still have the same error, in my case compiling ntapi v0.3.7

[+] Building Client Compiling chromepass v4.1.5 (C:\Temp\chromepass\templates\chromepass-build) Compiling ntapi v0.3.7 error[E0793]: reference to packed field is unaligned --> C:\Users\a.cargo\registry\src\index.crates.io-6f17d22bba15001f\ntapi-0.3.7\src\ntexapi.rs:2783:52 2783 tick_count.QuadPart_mut() = read_volatile(&(USER_SHARED_DATA).u.TickCountQuad); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use read_unaligned/write_unaligned (loads and stores via *p must be properly aligned even when using raw pointers)

error[E0793]: reference to packed field is unaligned --> C:\Users\a.cargo\registry\src\index.crates.io-6f17d22bba15001f\ntapi-0.3.7\src\ntexapi.rs:2807:25 2807 ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use read_unaligned/write_unaligned (loads and stores via *p must be properly aligned even when using raw pointers)

For more information about this error, try rustc --explain E0793. error: could not compile ntapi (lib) due to 2 previous errors [-] Client couldn't be copied: [Errno 2] No such file or directory: 'templates/chromepass-build/target/release/chromepass.exe' [-] Error building the client