In IDAPython,
execfile('<path>/cxxparser.py')
parse_file('<path>/a.cpp',[r'-I<path>\LuaJIT-2.0.5\src', '-D__NT__', '-D__X64__', '-D__EA64__'])
parse_file('<path>/malloc.c',['-target=x86_64-linux-gnu'])
| /* | |
| * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. | |
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| * | |
| * This code is free software; you can redistribute it and/or modify it | |
| * under the terms of the GNU General Public License version 2 only, as | |
| * published by the Free Software Foundation. Oracle designates this | |
| * particular file as subject to the "Classpath" exception as provided | |
| * by Oracle in the LICENSE file that accompanied this code. | |
| * |
| # file read shellcode | |
| # riscv | |
| # - buffer: pc + 0x100, must be writable | |
| # - if you want, you can change it | |
| # compile: | |
| # export PATH=$PATH:/opt/riscv/bin | |
| # riscv64-unknown-elf-as code.s -o code.o | |
| # riscv64-unknown-elf-objcopy --dump-section .text=code.dump code.o | |
| # output: code.dump |
| My ethereum address is 0x332Ec6B21f552e390e8C1eBDbf5c769fF69941eB |
| #include <sys/socket.h> | |
| #include <sys/types.h> | |
| #include <arpa/inet.h> | |
| #include <strings.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <signal.h> | |
| #include <stdlib.h> | |
| int main(int argc, char **argv, char **envp) { |
| /* | |
| first malloc(16) : 0x1a61450 | |
| eh.. and malloc(-1) : (nil) | |
| second malloc(16) : 0x7fe57c0008c0 | |
| FYI, libc.so address is : 0x7fe5837dc000 | |
| let's calculate! : 0x7fe580000000 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> |
| import idaapi | |
| from Queue import Queue | |
| from PyQt5.QtCore import QCoreApplication | |
| from PyQt5.QtWidgets import qApp, QMainWindow, QWidget, QLineEdit | |
| def _query(window, predicate): | |
| results = [] |
| meta: | |
| id: apple_script | |
| file-extension: scpt | |
| application: AppleScript files | |
| endian: be | |
| ks-opaque-types: true | |
| seq: | |
| - id: magic | |
| size: 4 |
| diff --git "a/pwnlib/context/__init__.py" "b/pwnlib/context/__init__.py" | |
| index 6d43994..e813de6 100644 | |
| --- "a/pwnlib/context/__init__.py" | |
| +++ "b/pwnlib/context/__init__.py" | |
| @@ -26,6 +26,8 @@ import socks | |
| from pwnlib.config import register_config | |
| from pwnlib.device import Device | |
| from pwnlib.timeout import Timeout | |
| +import colorama | |
| +colorama.init() |
| from pwn import * | |
| import struct | |
| def flatten(input_array): | |
| result_array = [] | |
| for element in input_array: | |
| if isinstance(element, list): | |
| result_array += flatten(element) | |
| else: | |
| result_array.append(element) |