Skip to content

Commit

Permalink
add chacha_decrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-smx committed Apr 6, 2024
1 parent b6a8a91 commit 651b9ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions xzre.h
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,23 @@ extern BOOL process_shared_libraries(backdoor_shared_libraries_data_t *data);
*/
extern BOOL process_shared_libraries_map(struct link_map *r_map, backdoor_shared_libraries_data_t *data);

/**
* @brief decrypts a buffer with chacha20
*
* @param in the input buffer to decrypt
* @param inl the length of the input buffer
* @param key the 256bit chacha key
* @param iv the 128bit chacha iv
* @param out the output buffer
* @param funcs OpenSSL imported functions
* @return BOOL TRUE if successful, FALSE otherwise
*/
extern BOOL chacha_decrypt(
u8 *in, int inl,
u8 *key, u8 *iv,
u8 *out, imported_funcs_t *funcs
);

extern global_context_t *global_ctx;

#include "util.h"
Expand Down
3 changes: 3 additions & 0 deletions xzre.lds
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ SECTIONS {

"process_shared_libraries_map" = ".";
*(.text.lzma_index_encoder_inia);

"chacha_decrypt" = ".";
*(.text.lzma_delta_encoder_inia);
}
} INSERT AFTER .text;

Expand Down

0 comments on commit 651b9ed

Please sign in to comment.