๋ชฉ๋ก์ ์ฒด ๊ธ (1110)
KoreanFoodie's Study
'๋ฆฌ๋ฒ์ฑ ํต์ฌ ์๋ฆฌ'์ ๋ด์ฉ ๋ฐ ์ด์๋ค๊ณผ ํด๊ฒฐ์ฑ ์ ๋ค๋ฃน๋๋ค. 1. EP(Entry Point) EP(Entry Point)๋ Windows ์คํ ํ์ผ (EXE, DLL, SYS๋ฑ)์ ์ฝ๋ ์์์ ์ ์๋ฏธํ๋ค. ํ๋ก๊ทธ๋จ์ด ์คํ๋ ๋ CPU์ ์ํด ๊ฐ์ฅ ๋จผ์ ์คํ๋๋ ์ฝ๋ ์์ ์์ฐจ๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค. 2. ๋๋ฒ๊ฑฐ ๋ช ๋ น์ด ๋ช ๋ น์ด |๋จ์ถํค |์ค๋ช |:------|:-------|:------| Go to | [Ctrl+G] | ์ํ๋ ์ฃผ์๋ก ์ด๋(์ฝ๋/๋ฉ๋ชจ๋ฆฌ๋ฅผ ํ์ธํ ๋ ์ฌ์ฉ. ์คํ๋๋ ๊ฒ์ ์๋) Execute till Cursor | [F4] | cursor ์์น๊น์ง ์คํ (๋๋ฒ๊น ํ๊ณ ์ถ์ ์ฃผ์๊น์ง ๋ฐ๋ก ๊ฐ ์ ์์) Set/Reset Breakpoint | [F2] | BP ์ค์ / ํด์ Run | [F9..
'๋ฆฌ๋ฒ์ค ์์ง๋์ด๋ง ๋ฐ์ด๋ธ'์ ํต์ฌ ๋ด์ฉ ๋ฐ ์ด์๋ค๊ณผ ํด๊ฒฐ์ฑ ์ ๋ค๋ฃน๋๋ค. Windows programming ๋ง๋ณด๊ธฐ #include #include #include void RunPorcess() { STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); //start the child process. if (!CreateProcess(NULL, "MyChildProcess", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) ) { printf("CreateProcess failed.\n"); return; } // Wa..
C ์ธ์ด๋ก ์ด์ ๋ธ๋ฆฌ ์ฌ์ฉํด ๋ณด๊ธฐ! ์ด์ ๋ธ๋ฆฌ๋ก ๋ ๋ณ์์ ๊ฐ์ ๋ํ๋ ์ฝ๋๋ฅผ ์ง ๋ณด์! #include #include int Plus(int a, int b) { return a +b; } _declspec(naked) PlusAsm(int a, int b) { _asm { mov ebx, dword ptr ss:[esp+8] mov edx, dword ptr ss:[esp+4] add edx, ebx mov eax, edx retn }; } void main(int argc, char *argv[]) { int value = Plus(3, 4); printf("value: %d\n", value); int value2 = PlusAsm(3,4); printf("value2: %d\n", value2);..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala์ Abstract class์ ๋ํด ์์๋ณด์ Abstract Class: Specification Abstract Classes can be used to abstract away the implementation details. In short, abstract classes is used for specfication, and concrete sub-classes for implementation. Example: Abstract case for specification abstract class Iter[A] { def getValue: Option[A] def getNext: Iter[A] } def sumElements[A](f: A=>Int)(xs: Iter[A])..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala์ class์ ๋ํด ์์๋ณด์ Class: Parameterized Record object gee { val a : Int = 10 def b : Int = a + 20 def f(z: Int) : Int = b + 20 + z } type gee_type = {val a:Int; def b: Int; def f(z:Int): Int} class foo_type(x: Int, y: Int) { val a : Int = x def b : Int = a + y def f(z: Int) : Int = b + y + z } val foo : foo_type = new foo_type(10,20) If you define class, new type is made. The name r..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala์ sub types์ ๋ํด ์์๋ณด์ Sub Type Polymorphism (Concept) Let's assume that we want this: object tom { val name = "Tom" val home = "02-880-1234" } object bob { val name = "Bob" val home = "02-123-1234" } def greeting(r: ???) = "Hi " + r.name + ", How are you?" greeting(tom) greeting(bob) // Note that we have tom: {val name: String; val home: String} bob: {val name: String; val mobile: ..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala์ parametric polymophism์ ๋ํด ์์๋ณด์ Parametric Polymorphism: Functions Problem def id1(x: Int): Int = x def id2(x: Double): Double = x Can we avoid DRY(Do not Reapeat Yourself)? Parametric Polymorphism(a.k.a. For-all Types) def id[A](x: A): A = x // type for definition val f = (x:Int) => x // type for value The type of id is [A](x: A)A. id is a parametric expression. Only definition..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala datatypes part2 Pattern Matching A way to use algebraic datatypes Syntax: e match { case C1(...) => e1 ... case Cn(...) => en } Example : sealed abstract class IList case class INil() extends IList case class ICons(hd: Int, tl: IList) extends IList def x: IList = ICons(2, ICons(1, INil())) def length(xs: IList) : Int = xs match { case INil() => 0 case ICons(x, tl) => 1 + length(t..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala์ datatypes์ ๋ํด ์์๋ณด์ Types in general Introdection : How to construct elements Elimination : How to use elements of the type Primitive types : Int, Boolean, Double, String... Intro for Int: ...,-2,-1,0,1,2 Elim for Int: +,-,*,/... -Function types : Int => Int, (Int => Int)=>(Int => Int) Intro: (x:T)=>e Elim: f(v) Tuples Intro : (1, 2, 3) : (Int, Int, Int) (1, "a") : (Int, String) ..
์ค์นผ๋ผ ํํ ๋ฆฌ์ผ, scala์์ currying์ ๋ํด ์์๋ณด์ Currying Why we use currying? Let's look at the code, simplified by currying. def sum(f: Int=>Int, a: Int, b: Int): Int = if (a Int): (Int, Int) => Int = { def sumF(a: Int, b: Int): Int = if (a Int)(a: Int, b: Int): Int = if (a T can be turned into one of type T1 => (T2 => (... Tn =>T) This is called 'currying' named after Haskell Brooks Curry. The opposite di..