elf16kb

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

nbrain-android-16kb-go

Zero-dependency Go 1.22+ library and CLI (elf16kb) auditing ELF64 .so binaries, .apk, and .aab packages for Google Play's mandatory 16KB page-size alignment requirement.

go install github.com/NBrain-Studio/nbrain-android-16kb-go/cmd/elf16kb@v1.0.0

Built by Eng. Nadeem Mohamed Badr El-Din (nadeembadr.com) & NBrain (nbra.in).

Documentation

Overview

Package elf16kb audits ELF64 shared libraries (.so) and Android APK/AAB archives for Google Play's mandatory 16KB page-size alignment requirement (PT_LOAD p_align >= 16384 and p_vaddr % 16384 == p_offset % 16384).

Built by Eng. Nadeem Mohamed Badr El-Din (https://nadeembadr.com/about/) & NBrain (https://nbra.in/).

Index

Constants

View Source
const PageSize16KB uint64 = 16384

Variables

This section is empty.

Functions

This section is empty.

Types

type LibraryReport

type LibraryReport struct {
	Name      string           `json:"name"`
	Class     string           `json:"class"`
	Machine   string           `json:"machine"`
	Compliant bool             `json:"compliant"`
	Segments  []SegmentFinding `json:"segments"`
}

LibraryReport summarizes 16KB compliance for an ELF64 shared library.

func AuditAPKZipBytes

func AuditAPKZipBytes(zipBytes []byte) ([]LibraryReport, bool, error)

AuditAPKZipBytes scans all arm64-v8a and x86_64 .so files inside an APK or AAB ZIP buffer.

func AuditELF64Bytes

func AuditELF64Bytes(name string, data []byte) (LibraryReport, error)

AuditELF64Bytes parses an ELF64 binary in memory and validates every PT_LOAD segment for 16KB compliance.

type SegmentFinding

type SegmentFinding struct {
	Index     int    `json:"index"`
	Align     uint64 `json:"p_align"`
	Vaddr     uint64 `json:"p_vaddr"`
	Offset    uint64 `json:"p_offset"`
	Compliant bool   `json:"compliant"`
	Reason    string `json:"reason"`
}

SegmentFinding reports alignment details for one PT_LOAD segment.

Directories

Path Synopsis
cmd
elf16kb command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL