본문 바로가기

Research

입출력 리다이렉션 Popen 을 이용한 리다이렉션을 하고싶은데.하나의 스크립트로만 사용을 하고싶은데! 잘 안된다.그냥 단순히 subprocess.Popen( '....', stdin = subprocess.PIPE, stdout=subprocess.PIPE)이렇게 주고 어떻게든 짜면 될 것 같아서 별짓 다 했지만... buffered 라는게 있다고 하네.그래서 혹여나 퍼너블 시에 canary를 구하는 등의, 상호 동기적인(synchronous한) 데이터의 주고받기가 필요한 경우에는... 다른 방법을 써야 겠고.그게 아니면. 그냥 일방적으로 데이터를 밀어넣기만 하면 되는 경우는아래와 같이 해도 되겠더라. int main() {어쩌고저쩌고 초기화for(i=0; i 더보기
ARM 에서는 current instruction 과 PC 가 같지 않다. 명령어 중 이런게 있었다 0x8448 mov r3, pc0x844a mov r4, pc r3 에는 0x8448 이, r4 에는 0x844a 가 들어갈 것 같았는데실제로는 r3 에는 0x844c, r4 에는 0x844e 가 들어갔다. 조금 찾아보니 pc 값은 thumb mode 에서는 항상 +4 byte , arm mode 에서는 +8 byte 라고 하는데..(http://www.iamroot.org/xe/Kernel_8_ARM/49399)그래도 pc값을 저장하는 시점에서 + 4byte 값이 들어간다는 것이 이해가 안되었다. 영어 자료에서 찾게 된 내용은 이렇다. ARM 파이프라인에는 3 단계가 있어서, PC는 항상 fetched 된 인스트럭션을 가리키고 있습니다. 명령어가 해석되는 단계에서는 PC-4, .. 더보기
x64 syscall function table Linux System Call TableThe following table lists the system calls for the Linux 2.2 kernel. It could also be thought of as an API for the interface between user space and kernel space. My motivation for making this table was to make programming in assembly language easier when using only system calls and not the C library (for more information on this topic, go tohttp://www.linuxassembly.org). O.. 더보기
PEB, PEB_LDR_DATA, LDR_MODULE typedef struct _PEB_LDR_DATA { ULONG Length; // +0x00 BOOLEAN Initialized; // +0x04 PVOID SsHandle; // +0x08 LIST_ENTRY InLoadOrderModuleList; // +0x0c LIST_ENTRY InMemoryOrderModuleList; // +0x14 LIST_ENTRY InInitializationOrderModuleList;// +0x1c } PEB_LDR_DATA,*PPEB_LDR_DATA; // +0x24 typedef struct _LDR_MODULE{ LIST_ENTRY InLoadOrderModuleList; +0x00 LIST_ENTRY InMemoryOrderModuleList; +0x08.. 더보기
windbg 심볼 / 치트 시트 아 외워도 맨날 까먹네 ㅠㅠ windbg symbol pathsrv*c:\websymbols*http://msdl.microsoft.com/download/symbols windbg cheeat sheet 더보기
번역 - The Art of Win32 ShellCoding 보호되어 있는 글입니다. 더보기
ARMv8 Qemu Install Reference https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Virtual_ARM_Linux_environmenthttp://www.cnx-software.com/2011/03/15/qemu-linaro-versatile-express-image-on-ubuntu-10-10/http://opensecuritytraining.info/IntroARM_files/IntroARM_Setting_up_QEMU.pdfhttps://sskaje.me/2013/12/virtualized-arm-ubuntu/#.VGHU2fmsXighttp://lwip-rtos-html-arm.googlecode.com/svn-history/r6/references/tmp_text.. 더보기
C++ constructor 생성자 호출 방식 글로벌 오브젝트의 경우 /* * do C++ constructors (initializers) specific to this EXE */ if (__native_startup_state == __initializing)010816CD A1 B0 33 08 01 mov eax,dword ptr [___native_startup_state (10833B0h)] 010816D2 3B C6 cmp eax,esi 010816D4 75 1B jne __tmainCRTStartup+0D0h (10816F1h) { _initterm( __xc_a, __xc_z );010816D6 68 F4 20 08 01 push offset ___xc_z (10820F4h) 010816DB 68 E8 20 08 01 push off.. 더보기