- From console create file:
dd if=/dev/zero of=/tmp/sharedfile bs=12288 count=1 - The C# program
- The C program
mcs Sender.cs| using System; | |
| using System.Runtime.InteropServices; | |
| namespace PInvokeSamples | |
| { | |
| public static class Program | |
| { | |
| [DllImport("libc.so.6")] | |
| private static extern int fork(); | |
| [DllImport("libc.so.6")] |
| import subprocess | |
| # $cat input > output | |
| subprocess.run(['cat'], stdin=open("input", 'r'), stdout=open("output", 'a')) |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define BUFFSIZE 512 | |
| #define err(mess) { fprintf(stderr,"Error: %s.\n", mess); exit(1); } |
| #include<stdio.h> | |
| int main(void) { | |
| for(int i = 0; i < 8; i++) { | |
| for(int x = 0; x < 20; x++) { | |
| int d = x - 10; | |
| if (d <= 0) { | |
| d *= -1; | |
| } | |
| char c = ' '; |
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<jansson.h> | |
| void jansson_pack_stdout_free(json_t *root) { | |
| char *out = json_dumps(root, JSON_ENCODE_ANY); | |
| printf("out:%s\r\n", out); | |
| free(root); | |
| free(out); |
| # ref: https://reverseengineering.stackexchange.com/questions/23469/way-to-get-basic-blocks-of-a-binary-using-ghidra | |
| from ghidra.program.model.block import BasicBlockModel | |
| from ghidra.util.task import TaskMonitor | |
| bbm = BasicBlockModel(currentProgram) | |
| blocks = bbm.getCodeBlocks(TaskMonitor.DUMMY) | |
| block = blocks.next() | |
| bbl_cnt = 0 | |
| while block: |
| # ==================== Emojis ==================== | |
| # 🎉 :tada: 初めてのコミット(Initial Commit) | |
| # 🔖 :bookmark: バージョンタグ(Version Tag) | |
| # ✨ :sparkles: 新機能(New Feature) | |
| # 🐛 :bug: バグ修正(Bagfix) | |
| # ♻️ :recycle: リファクタリング(Refactoring) | |
| # 📚 :books: ドキュメント(Documentation) | |
| # 🎨 :art: デザインUI/UX(Accessibility) |
url: https://qiita.com/kimisyo/items/916f58ac6571815851ff
pip3 install requests pdfminer.six