-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
624 changed files
with
2,271,017 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 The Skyline Project | ||
Copyright (c) 2021 MasaGratoR | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: all clean skyline | ||
|
||
NAME := $(shell basename $(CURDIR)) | ||
NAME_LOWER := $(shell echo $(NAME) | tr A-Z a-z) | ||
|
||
BUILD_DIR := build | ||
|
||
MAKE_NSO := nso.mk | ||
|
||
all: skyline | ||
|
||
skyline: | ||
$(MAKE) all -f $(MAKE_NSO) MAKE_NSO=$(MAKE_NSO) BUILD=$(BUILD_DIR) TARGET=$(NAME) | ||
|
||
clean: | ||
$(MAKE) clean -f $(MAKE_NSO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
global: | ||
__custom_init; | ||
__custom_fini; | ||
skyline_tcp_send_raw; | ||
getRegionAddress; | ||
A64HookFunction; | ||
A64InlineHook; | ||
sky_memcpy; | ||
get_program_id; | ||
get_plugin_addresses; | ||
|
||
local: *; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#pragma once | ||
|
||
#include <assert.h> | ||
#include <elf.h> | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
namespace rtld { | ||
struct ModuleObject { | ||
private: | ||
// ResolveSymbols internals | ||
inline void ResolveSymbolRelAbsolute(Elf64_Rel* entry); | ||
inline void ResolveSymbolRelaAbsolute(Elf64_Rela* entry); | ||
inline void ResolveSymbolRelJumpSlot(Elf64_Rel* entry, bool do_lazy_got_init); | ||
inline void ResolveSymbolRelaJumpSlot(Elf64_Rela* entry, bool do_lazy_got_init); | ||
|
||
public: | ||
struct ModuleObject* next; | ||
struct ModuleObject* prev; | ||
union { | ||
Elf64_Rel* rel; | ||
Elf64_Rela* rela; | ||
void* raw; | ||
} rela_or_rel_plt; | ||
union { | ||
Elf64_Rel* rel; | ||
Elf64_Rela* rela; | ||
} rela_or_rel; | ||
uint64_t module_base; | ||
Elf64_Dyn* dynamic; | ||
bool is_rela; | ||
uint64_t rela_or_rel_plt_size; | ||
void (*dt_init)(void); | ||
void (*dt_fini)(void); | ||
uint32_t* hash_bucket; | ||
uint32_t* hash_chain; | ||
char* dynstr; | ||
Elf64_Sym* dynsym; | ||
uint64_t dynstr_size; | ||
void** got; | ||
uint64_t rela_dyn_size; | ||
uint64_t rel_dyn_size; | ||
uint64_t rel_count; | ||
uint64_t rela_count; | ||
uint64_t hash_nchain_value; | ||
uint64_t hash_nbucket_value; | ||
uint64_t got_stub_ptr; | ||
#ifdef __RTLD_6XX__ | ||
uint64_t soname_idx; | ||
uint64_t nro_size; | ||
bool cannot_revert_symbols; | ||
#endif | ||
|
||
void Initialize(uint64_t aslr_base, Elf64_Dyn* dynamic); | ||
void Relocate(); | ||
Elf64_Sym* GetSymbolByName(const char* name); | ||
void ResolveSymbols(bool do_lazy_got_init); | ||
bool TryResolveSymbol(Elf64_Addr* target_symbol_address, Elf64_Sym* symbol); | ||
}; | ||
|
||
#ifdef __RTLD_6XX__ | ||
static_assert(sizeof(ModuleObject) == 0xD0, "ModuleObject size isn't valid"); | ||
#else | ||
static_assert(sizeof(ModuleObject) == 0xB8, "ModuleObject size isn't valid"); | ||
#endif | ||
} // namespace rtld |
Oops, something went wrong.