전체 글 27

Program Counter -> Instruction Memory

Program CounterThe program counter is a 32bit register that contains the address of a location in the Instruction Memory.PC always points to the next instruction in the memory that is to be fetched.Before we talk about how the PC is updated, we will look into the Instruction Memory.명령어 메모리의 주소값을 가지는 32비트 레지스터.항상 다음에 가져올 명령어를 가르키는 주소값을 가짐.PC가 update되기전에 명령어 메모리를 살핌. Instruction MemoryThe instruct..

MIPS Instruction

MIPS(Microprocessor without Interlocked Pipeline Stages)RISC(Reduced Instruction Set Computer) 방식 - CPU 명령어 개수를 줄여 하드웨어 구조를 간단하게 하는 방식. 마이크로 프로세서를 설계하는 방식 32비트 기준 32개의 범용 32비트 레지스터를 가짐.프로그램은 명령어들의 집합 - CPU는 메모리 상에 올라와있는 Instruction Mem.를 찾아가서 명령어(Instruction)들을 하나씩읽어와 해독, 연산, 적재.명령어는 3가지 타입 - R, I, J 6 5 5 5 5 6 bits [ op | rs | rt | rd |shamt| funct] R-type [ op | rs | rt | address/immediate] I..

[C언어] 화살표와 도트 멤버연산자

구조체를 보면 종종 ->(애로우) 와 .(도트)가 있다 이들을 멤버연산자라고 한다 다음 코드를 보자. (연결리스트 스택의 코드일부) typedef int element; // typedef는 새로운 자료형을 정의하는데 사용, int의 자료형을 element로 쓰겠다는 의미. 새로운 자료형 element를 int로 정의 typedef struct stackNode //새로운 자료형 stackNode를 구조체로 정의, 스택의 노드구조체 정의 { element data; struct stackNode *link; }stackNode; stackNode *top; void push(element item) { stackNode *temp = (stackNode *)malloc(sizeof(stackNode));..

Computer/Software 2011.08.13

[C언어] typedef 구조체선언

구조체는 자료형의 한 종류이다. 보통 구조체는 다음과 같은 방식으로 짤수있다. struct Pocket { int a; int b; //a, b는 멤버데이터이며, {}는 멤버데이터들을 묶어준다 }; //구조체 선언 끝에는 ;가 명시된다. 함수 선언의경우 {}의 의미는 메인메모리에서 스택할당이 되지만, 구조체 선언시 {}는 메인메모리에 아무런 영향을 주지않는다. 따라서 구분을 위해 ;가 필요하다. 구조체의 객체생성은 다음과 같다. struct Pocket { int a; int b; }; struct Pocket A1, *pA2; //c에서는 struct지시어가 필요하지만 c++은 없어도 무방하다. A1은 정적객체, pA2는 포인터객체로 선언 간편하게 이렇게 해도 된다. struct Pocket { int..

Computer/Software 2011.08.13

[C언어] typedef와 #define의 차이점

typedef는 새로운 자료형을 정의할때 사용된다. 비슷한 선언으로 #define이 있지만 차이점이 있다. 우선 #define의 #은 기본적으로 컴파일되기전에 수행되는 선행처리기이며, define은 치환을 한다는 의미가 있다. 다음 문장을 살펴보자 ----------------------------------------------------------- #include #define limit 500 //이 문장을 해석하면, 코드전체에서 선행적으로 limit를 500으로 치환하는 것이다. void main() { int a = limit; //여기서 a값은 500이 된다. } ---------------------------------------------------------- 하지만 #define은 ..

Computer/Software 2011.08.09

[웹해킹] 패킷인코딩 방식

와이어샤크를 이용해 어느사이트를 패킷분석해봤다. (보안상 별표처리) ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ GET /static/functions/masterpc.js HTTP/1.1 Host: *******.net Connection: keep-alive Referer: http://*******.net/index.php User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30 Accept: */* Accept-Encoding: gzip,deflate,sdch Accept-Language: ko-KR,ko;q=0.8,en..

Computer/Software 2011.07.15

[Linux] Promiscuous mode 설정방법

vmware로 돌린 페도라15 라이브시스템에서 간단히 Promiscuous 모드로 바꿔보자 뱀웨어 어댑터설정은 브릿지 상태이다 우선 ifconfig커맨드로 설정을 본뒤, ifconfig eth0 promisc 라고 치면 끝 하지만 siocsifflags permission denied 라는 문구가 뜬다 루트권한을 얻어야 설정변환이 가능하다 PROMISC라는 표시가 생기면 완료 설정을 해제하려면 루트권한에서 ifconfig eth0 -promisc 치면 된다

Computer/Software 2011.07.14