Skip to content

Commit

Permalink
Merge branch 'main' of github.com:gdlocalisation/gdl-geode
Browse files Browse the repository at this point in the history
  • Loading branch information
JaanDev committed Jan 7, 2025
2 parents 8993ad8 + ee2e9de commit c61beae
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ jobs:
os: ubuntu-latest
target: Android32

- name: Android64
os: ubuntu-latest
target: Android64

name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

Expand All @@ -34,10 +30,10 @@ jobs:
- name: Build the mod
uses: geode-sdk/build-geode-mod@main
with:
bindings: QD-Studio/geode-bindings
bindings-ref: main
sdk: 'v3.0.0'
cli: 'v3.0.3'
# bindings: QD-Studio/geode-bindings
# bindings-ref: main
sdk: 'v4.1.2'
cli: 'v3.3.1'
combine: true
target: ${{ matrix.config.target }}

Expand Down
6 changes: 5 additions & 1 deletion api/PageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

using namespace geode::prelude;

#ifdef GEODE_IS_WINDOWS64

void PageManager::freeAll() {
for (auto& page : m_pages) {
page.free();
Expand Down Expand Up @@ -73,4 +75,6 @@ PageManager::Page& PageManager::allocNewPage() {
m_pages.push_back(Page {.m_address = (uint8_t*)newPageAddr, .m_totalSize = PAGE_SIZE, .m_offset = 0, .m_id = m_pages.size()});

return m_pages.back();
}
}

#endif
2 changes: 1 addition & 1 deletion api/PageManager.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <Geode/Geode.hpp>

#if defined(GEODE_IS_WINDOWS64)
#ifdef GEODE_IS_WINDOWS64

class PageManager {
struct Page {
Expand Down
9 changes: 6 additions & 3 deletions api/stringPatch.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#include "stringPatch.hpp"

#ifdef GEODE_IS_WINDOWS64
#include <Zydis/Zydis.h>
#include <PageManager.hpp>
#endif

#include <string.h>
#include <chrono>
#include <PageManager.hpp>
#include <utils.hpp>

using namespace geode::prelude;
Expand Down Expand Up @@ -74,9 +77,9 @@ namespace gdl {
// =========================================

uint8_t* arr = (uint8_t*)srcAddr;
uint8_t* start = arr;
uint8_t availableSize = 0;
uint8_t reg = 0;


// check for 64-bit or 16-bit operation
if (*arr == 0x48 || *arr == 0x49 || *arr == 0x66) {
Expand All @@ -86,7 +89,7 @@ namespace gdl {

if (*arr == 0x8D) { // lea
auto modrm = gdlutils::decodeModRM(*arr);
availableSize += modrm.size + 1;
availableSize += modrm.size;
reg = modrm.reg;
} else if (*arr == 0x89 || *arr == 0x8B) { // mov <reg>, <reg> || mov <reg>, [mem]
auto modrm = gdlutils::decodeModRM(*arr);
Expand Down
2 changes: 1 addition & 1 deletion libs/utf8
2 changes: 2 additions & 0 deletions src/patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ void patches::fixCyrillicP() {
#error "Unsupported platform"
#endif

#ifdef GEODE_IS_WINDOWS
if (res.isErr())
log::warn("Failed to patch the Рррр fix ({}), be aware that CommentCell with cyrillic comments may crash!", res.err());
#endif
}

void patches::patchStrings() {
Expand Down

0 comments on commit c61beae

Please sign in to comment.