diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2021-11-24 12:45:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 12:45:26 -0500 |
commit | f39ac40fbdf79d9bf3ea86226bb042365dda8143 (patch) | |
tree | 053b76c56f74519d7956b70a8c2cff5e744062b2 | |
parent | a84ecb36410c266f7d4628b261904c2ef2e02d66 (diff) | |
parent | 825c5ac4b0991274b1c0e368898428c8e23fb850 (diff) |
Merge branch 'master' into extract_trainer_backsprites
-rw-r--r-- | .github/workflows/build.yml | 8 | ||||
-rw-r--r-- | tools/bin2obj/bin2obj.cpp | 42 | ||||
-rw-r--r-- | tools/msgenc/Makefile | 9 |
3 files changed, 30 insertions, 29 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48cc5d37..e62d772d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,22 +4,22 @@ on: [push, pull_request] env: LM_LICENSE_FILE: "$GITHUB_WORKSPACE/tools/mwccarm/license.dat" - CC: gcc-8 - CXX: g++-8 + CC: gcc-10 + CXX: g++-10 CALCROM_DISCORD_WEBHOOK_AVATAR_URL: "https://i.imgur.com/38BQHdd.png" CALCROM_DISCORD_WEBHOOK_USERNAME: OK CALCROM_WEBHOOK_URL: ${{ secrets.WEBHOOKURL }} jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 steps: - name: Update and Install Software run: | sudo apt update sudo ACCEPT_EULA=Y apt -y --fix-missing --allow-downgrades upgrade - sudo apt -y --allow-downgrades install g++-8-multilib linux-libc-dev binutils-arm-none-eabi p7zip-full pkg-config + sudo apt -y --allow-downgrades install g++-10-multilib linux-libc-dev binutils-arm-none-eabi p7zip-full pkg-config sudo dpkg --add-architecture i386 wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport diff --git a/tools/bin2obj/bin2obj.cpp b/tools/bin2obj/bin2obj.cpp index 160bb2d2..ec5ba065 100644 --- a/tools/bin2obj/bin2obj.cpp +++ b/tools/bin2obj/bin2obj.cpp @@ -2,6 +2,7 @@ #include <string>
#include <vector>
#include <fstream>
+#include <cstring>
extern "C" {
#include "elf.h"
}
@@ -188,27 +189,28 @@ int main(int argc, char** argv) { binfile.seekg(0);
// Elf header
- Elf32_Ehdr ehdr = {
- .e_ident = {
- ELFMAG0, // EI_MAG0
- ELFMAG1, // EI_MAG1
- ELFMAG2, // EI_MAG2
- ELFMAG3, // EI_MAG3
- ELFCLASS32, // EI_CLASS
- endian, // EI_DATA
- EV_CURRENT, // EI_VERSION
- ELFOSABI_NONE, // EI_OSABI
- 0, // EI_ABIVERSION
- },
- .e_type = ET_REL,
- .e_machine = proc,
- .e_version = EV_CURRENT,
- .e_shoff = sizeof(Elf32_Ehdr),
- .e_ehsize = sizeof(Elf32_Ehdr),
- .e_shentsize = sizeof(Elf32_Shdr),
- .e_shnum = 5,
- .e_shstrndx = 1,
+ Elf32_Ehdr ehdr;
+
+ static const unsigned char _eident[EI_NIDENT] {
+ ELFMAG0, // EI_MAG0
+ ELFMAG1, // EI_MAG1
+ ELFMAG2, // EI_MAG2
+ ELFMAG3, // EI_MAG3
+ ELFCLASS32, // EI_CLASS
+ endian, // EI_DATA
+ EV_CURRENT, // EI_VERSION
+ ELFOSABI_NONE, // EI_OSABI
+ 0, // EI_ABIVERSION
};
+ memcpy(ehdr.e_ident, _eident, EI_NIDENT);
+ ehdr.e_type = ET_REL;
+ ehdr.e_machine = proc;
+ ehdr.e_version = EV_CURRENT;
+ ehdr.e_shoff = sizeof(Elf32_Ehdr);
+ ehdr.e_ehsize = sizeof(Elf32_Ehdr);
+ ehdr.e_shentsize = sizeof(Elf32_Shdr);
+ ehdr.e_shnum = 5;
+ ehdr.e_shstrndx = 1;
// Five sections: NULL, user section, symtab, strtab, shstrtab
Elf32_Shdr shdr[5] = {};
diff --git a/tools/msgenc/Makefile b/tools/msgenc/Makefile index b39d97cb..acfabfd2 100644 --- a/tools/msgenc/Makefile +++ b/tools/msgenc/Makefile @@ -8,12 +8,11 @@ endif DEPDIR := .deps DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d -define SRCS := - msgenc.cpp - MessagesConverter.cpp - MessagesDecoder.cpp +SRCS := \ + msgenc.cpp \ + MessagesConverter.cpp \ + MessagesDecoder.cpp \ MessagesEncoder.cpp -endef OBJS := $(SRCS:%.cpp=%.o) |