From 6102cf92a2df6b96ad5f8b80dbd919ebc9525e24 Mon Sep 17 00:00:00 2001 From: Henri Nurmi Date: Tue, 16 Jul 2024 13:48:21 -0700 Subject: [PATCH 1/2] Add zu check --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5896d0f..80fbbd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,33 @@ on: name: build jobs: + bof-lint: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: NoZuFormatter + run: | + cpp_files=$(find . -type f -wholename "*-BOF/*.cpp") + found=0 + for file in $cpp_files; + do + if grep -Hn "%zu" "$file"; + then + found=1 + fi + done + + if [ $found -eq 1 ]; + then + echo "Found %zu in file. Beacon does not support this, change it to %Iu" + exit 1 + else + exit 0 + fi build: runs-on: windows-2022 + needs: bof-lint steps: - uses: ilammy/msvc-dev-cmd@v1 - name: Checkout From ec4f54503a166dd09f5411b70fdbff4eabbf4f3b Mon Sep 17 00:00:00 2001 From: Henri Nurmi Date: Tue, 16 Jul 2024 13:58:10 -0700 Subject: [PATCH 2/2] Change %zu to %Iu --- CredentialKatz-BOF/CredentialKatz/Memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CredentialKatz-BOF/CredentialKatz/Memory.cpp b/CredentialKatz-BOF/CredentialKatz/Memory.cpp index eafb0b7..f9d3227 100644 --- a/CredentialKatz-BOF/CredentialKatz/Memory.cpp +++ b/CredentialKatz-BOF/CredentialKatz/Memory.cpp @@ -188,10 +188,10 @@ extern "C" { #ifdef _DEBUG BeaconPrintf(CALLBACK_OUTPUT, "Address of beginNode: 0x%p\n", (void*)credentialMap.beginNode); BeaconPrintf(CALLBACK_OUTPUT, "Address of firstNode: 0x%p\n", (void*)credentialMap.firstNode); - BeaconPrintf(CALLBACK_OUTPUT, "Size of the credential map: %zu\n", credentialMap.size); + BeaconPrintf(CALLBACK_OUTPUT, "Size of the credential map: %Iu\n", credentialMap.size); #endif // _DEBUG - BeaconPrintf(CALLBACK_OUTPUT, "Number of available credentials: %zu\n\n", credentialMap.size); + BeaconPrintf(CALLBACK_OUTPUT, "Number of available credentials: %Iu\n\n", credentialMap.size); if (credentialMap.firstNode == 0) //CookieMap was empty {