Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ extracted/
# VS Code
.vscode/

# dist dic itself, not only .elf files
dist/
targets/*/build

submodules/uefi/edk2/build_modulepkg.log

submodules/unsigned_abl.elf
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:22.04

LABEL org.opencontainers.image.title="gbl_builder"
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
submodule_uefi_clean:
cd submodules/uefi && make clean
submodule_patcher_clean:
cd submodules/patcher && make clean
submodule_elflinker_clean:
cd submodules/elflinker && make clean
submodule_ablfvextractor_clean:
cd submodules/ablfvextractor && make clean
clean_submodules: submodule_uefi_clean submodule_patcher_clean submodule_elflinker_clean submodule_ablfvextractor_clean

target_generic_efi_clean:
cd targets/generic_efi && make clean
target_toolkit_windows_clean:
cd targets/toolkit_windows && make clean
target_toolkit_linux_clean:
Expand All @@ -20,8 +14,6 @@ targets_clean: clean_submodules target_generic_efi_clean target_toolkit_windows_

clean: targets_clean clean_submodules

target_generic_efi:
cd targets/generic_efi && make build
target_toolkit_windows:
cd targets/toolkit_windows && make build
target_toolkit_linux:
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
abl-builder:
build:
context: .
dockerfile: Dockerfile
image: gbl_builder:latest
volumes:
- .:/workspace
command: >
bash -c "make clean && make build && make build_module"
2 changes: 2 additions & 0 deletions docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker build -t gbl_builder:latest .
docker image prune -f --filter label=org.opencontainers.image.title="gbl_builder"
4 changes: 0 additions & 4 deletions submodules/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
### Submodules
dependences of the project
# uefi
superfastboot, for better testing
# ablfvextractor
extract abl
# elflinker
links abl with superfb
# patcher
core patching engine
1 change: 0 additions & 1 deletion submodules/elflinker/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions submodules/elflinker/Makefile

This file was deleted.

167 changes: 0 additions & 167 deletions submodules/elflinker/elf_inject.c

This file was deleted.

5 changes: 3 additions & 2 deletions submodules/patcher/src/patchs/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int32_t patch_adrl_unlocked_to_locked(char* buffer, int32_t size, uint64_t load_
if (!str_at(buffer, size, off0, "unlocked")) continue;
if (!str_at(buffer, size, off1, "locked")) continue;
bool match = false;
for(int j=i+16; j<=i+40;j+=4){
for(int j=i+16; j<=i+40 && j<=size-8;j+=4){
DecodedInst c0 = decode_at(buffer, j);
DecodedInst c1 = decode_at(buffer, j + 4);
if(c0.type == INST_ADRP && c1.type == INST_ADD_X_IMM){
Expand Down Expand Up @@ -191,7 +191,8 @@ bool PatchBuffer(char* data, int32_t size) {
int32_t num_patches = patch_abl_bootstate(data, size, &lock_register_num, &offset);
if (num_patches == 0) {
printf("Error: Failed to find/patch ABL Boot State\n");
free(data);
// free(data);
// caller is patch_abl.c, which has freed already. free there would cause double free. NCC, 2026-06-30
return 0;
}
printf("Anchor offset : 0x%X\n", offset);
Expand Down
1 change: 0 additions & 1 deletion submodules/uefi/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions submodules/uefi/Conf/ReadMe.txt

This file was deleted.

Loading
Loading