diff --git a/tools/elf2rpl/Makefile b/tools/elf2rpl/Makefile index 1b9ab15..b6a374f 100644 --- a/tools/elf2rpl/Makefile +++ b/tools/elf2rpl/Makefile @@ -10,7 +10,7 @@ CFILES := $(foreach dir,$(SOURCE),$(wildcard $(dir)/*.cpp)) INCLUDES := $(foreach dir,$(INCLUDE),-I$(dir)) CFLAGS := -O2 -Wall --std=c++14 -LDFLAGS := +LDFLAGS := -lz all: $(TARGET) diff --git a/tools/elf2rpl/main.cpp b/tools/elf2rpl/main.cpp index a9a4da0..1f4ef06 100644 --- a/tools/elf2rpl/main.cpp +++ b/tools/elf2rpl/main.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "elf.h" #pragma pack(push, 1) @@ -896,8 +897,8 @@ write(ElfFile &file, const std::string &filename) auto crc = 0u; if (!section->data.empty()) { - // TODO: Calculate crc of section->data - crc = 0xBEEFB00B; + crc = crc32(0, Z_NULL, 0); + crc = crc32(crc, reinterpret_cast(section->data.data()), section->data.size()); } sectionCRCs.push_back(crc); diff --git a/tools/readrpl/Makefile b/tools/readrpl/Makefile index f064673..3b0e90d 100644 --- a/tools/readrpl/Makefile +++ b/tools/readrpl/Makefile @@ -2,7 +2,7 @@ WUT_ROOT := $(CURDIR)/../.. TARGET := readrpl SOURCE := . -INCLUDE := ../common ../ext/cppformat ../ext/zlib +INCLUDE := ../common ../ext/cppformat CXX := g++