Skip to content

Commit 4f3572f

Browse files
committed
fix: lab8 no angr
1 parent 19bb971 commit 4f3572f

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

.github/workflows/lab-autograding.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,7 @@ jobs:
5656
if [ ${{ steps.lab.outputs.result }} -eq 6 ]; then
5757
sudo apt install -y llvm-14
5858
fi
59+
if [ ${{ steps.lab.outputs.result }} -eq 8 ]; then
60+
python3 -m pip install angr
61+
fi
5962
./validate.sh

lab5/antiasan.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#include <stdio.h>
21
#include <string.h>
3-
#include <sanitizer/asan_interface.h>
42

5-
void antiasan(unsigned long addr) {
6-
__asan_unpoison_memory_region((void *) addr, 0x200);
3+
void antiasan(unsigned long addr)
4+
{
5+
76
}

lab6/llvm-pass.so.cc

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,7 @@ PreservedAnalyses LLVMPass::run(Module &M, ModuleAnalysisManager &MAM) {
1515
ConstantInt *debug_arg = ConstantInt::get(Int32Ty, 48763);
1616

1717
for (auto &F : M) {
18-
if(F.getName() == "main") {
19-
IRBuilder<> Builder(&*F.getEntryBlock().getFirstInsertionPt());
20-
21-
// call debug
22-
Builder.CreateCall(debug_func, debug_arg);
23-
24-
Argument *argc = F.getArg(0);
25-
argc->replaceAllUsesWith(debug_arg);
26-
27-
Argument *argv = F.getArg(1);
28-
Value *argv_ptr = Builder.CreateGEP(Builder.getInt8PtrTy(), argv, ConstantInt::get(Int32Ty, 1));
29-
Value *newStr = Builder.CreateGlobalStringPtr("hayaku... motohayaku!");
30-
31-
Builder.CreateStore(newStr, argv_ptr);
32-
}
18+
errs() << "func: " << F.getName() << "\n";
3319

3420
}
3521
return PreservedAnalyses::none();

0 commit comments

Comments
 (0)