|
http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=20 [복사]
강의내용이 아직 어려운부분이 좀있는거같아요 ㄷㄷ
일단 현재까지 진행된만큼만 올리도록하겠습니다. (마감시간보다 늦은건 죄송합니다)
조금씩 진행될때마다 글이 수정될수도 있구요..
으 ㅠ0ㅠ 어렵네요 ㅋㅋ
======================
**별표**나 (괄호) 표시가 된 부분은 불확실한 부분인것도 있고
해석편의상 생략하고 싶은 부분도 있어요.
잘 안들리는 부분은 최대한 들리는대로만 적었습니다.
0:00
And, what would happen if "strlen" tries to calculate the length of it?
그리고, 만약 strlen 함수가 그 문자열의 길이를 계산하려고 하면 무슨 일이 발생할까요?
So when it tries to calculate the length and **calcurs the just tag**
길이를 계산하려고 시도하고 *** 한다면
it's going to cause the problem.
문제를 일으키게 될 것입니다.
It's going to overflow, ok?
오버플로우가 발생하죠.
0:20
conditional termination
조건부 종료 //0:20~2:20 부분은 강의내용을 아직 이해를못해서 빈칸이많아요.. 차차 수정될 듯 합니다..
**the (ints) are at the very bottom, (they sured in the last three lines)**
??
Anyone?
0 :40
What would happen if the first clause is completed with the while loop?
(의역) while문의 첫번째 조건을 만족하는 동안에는 무슨 일이 발생할까요? //의역이 맞는지는 확신x
See it says, while index is less than buffer length,
여길 보면, index의 값이 BufferLength보다 작게 유지되는 동안에는
and, it is not terminated
반복문이 종료되지 않습니다.
so it's tries to see extra(?) to to take a string,
따라서 반복문은, 문자열의 뒷부분을 추가적으로 보게 되고
(it이 무엇을 가르키냐에 따라서 다른해석 가능:
"따라서 반복문은, while의 두번째 조건문을 추가적으로 검사하게 되고")
1:00
which is, and looking for,
(더듬기)
it should be less than buffer length
그것의 크기는 BufferLength 보다 작아야합니다 //그것이 정확히 무얼 가르키는지는 모르겠습니다
in this case 20 characters
이 예제에서는 20글자보다 작아야하죠
and it should be not terminated
그 동안에는 종료되지 않아요.
(it is) not the proper method of doing it
이건 올바른 방법이 아닙니다
(의역: 이런 식으로 조건문을 작성하는 것은 올바르지 않습니다.)
if you do it, simply pass (lo slive zero wall??)
만약 그렇게 했다면, ???
(불확실한 해석: 만약 그렇게 했다면, 그 프로그램에 ???를 인자로 넘겨줌으로써)
it's going to try to read (..and read) the whole thing
프로그램은 문자열을 끝까지 읽으려고 할 것입니다.
1:20
and StringLength is going to be what?
그러면 StringLength 의 값은 무엇이 될까요?
It's going to be 12 over there
이부분에서 12가 될 겁니다.
it could be **R** where
??
when it encounters either one of them, it should proceed forward
//(단어는 쉬운데 정확한 해석이 어렵네요..)
and it should say, ok **어나더스 엔 컨커**
??
so go ahead and actually terminate the that point of (type)
??
1:42
the other problem over here is that
이부분에서 또다른 문제점은
it just presumes that the while loop succedes
(프로그램의 입장에서는), while문이 정상적으로 끝났다고 생각한다는 점입니다.
It Actually went through properly and, OK i did this,
그것은 올바르게 실행되었고,
i got the right value,
난 올바른 값을 얻었고,
everything is working fine
모든 것이 잘 돌아가고 있고,
I did the value-checking
나는 값 검사도 했고,
and everything is working fine
모든 게 잘 돌아가고 있다, 이렇게 생각하죠.
what will happen if just the first (start index) is less than BufferLength
만약 index의 초기값이 BufferLength보다 작다면 무슨 일이 발생할까요?
(it's poofed)
it'll cause a problem
문제가 발생합니다
It'll just jump out of the loop
루프문의 밖으로 빠져나오게 되고
and StringLength value would be 12, ok?
StringLength의 값은 12가 됩니다. OK?
2:20
the next one, premature termination
다음 주제, "너무 이른 종료(?)"
there's another thing that seems so awkward, and a..
여기 또다른 예제가 있는데, 꽤 어색해 보이죠.
it's in the second input ****
(음..)
(학생: it doesn't work!)
학생: 그 코드 작동 안하잖아요..
2:40
That's,
(더듬기)
it's really for examples, these are..
이건 그냥 예제일 뿐이에요, 이것들은..
Go ahead.
말씀하세요.
(학생:??)
??
Exactly.
정확합니다.
And you would be surprised how many times this to see
이러한 실수가 얼마나 자주 일어나는지 보게 된다면 놀랄거에요
3:00
There're so many times they'll do in this exact code
So many times, 그들은 이것과 똑같은 코딩 실수를 합니다.
yeah,
yeah, it's nothing significant, but
네, 이건 그닥 중요한(의미있는) 건 아니지만,
so many times you'll see that
이러한 경우를 매우 자주 보게 될 겁니다
it tries to do some kind of validation?
if문을 통해 일종의 확인을 하려고 하지 않습니까?
and they'll accidentally put a semicolon
그런데 실수로 문장의 끝에 세미콜론을 넣음으로써
and the entire validation goes out of the bench.
모든 확인(if문을 통한 확인)이 무효가 되버립니다.
3:20
(**first three lengths**)
??
Pretty classic
꽤 전형적인 예제입니다.
Yes, it is classic, it's classic strcpy problem, right?
전형적인 strcpy 문제입니다, 맞죠?
Getting in argument from command line
커맨드 라인으로부터 인자를 받아와서
and passing it into "var" which is 20 bytes
크기가 20인 var 배열에 복사합니다.
It's going to causes a problem.
이건 문제를 일으키게 됩니다.
Reading from the network
네트워크로부터 읽기
This i put in because
제가 이 주제를 넣은 이유는
this was i found one of our team very very similar to this.
우리 팀 중 하나가 이와 매우매우 비슷한 실수를 한 것을 확인한 적이 있기 때문입니다.
Again this is the classic strcpy problem (because)
이것도 전형적인 strcpy 문제라고 할수있는데요, (그이유는)
receiving data it was expecting 5 thousand
5000 바이트의 데이터를 받기 위해 기다리고 있습니다.
but actually allocated local allocation was only 2000
그런데 지역변수로 할당된 메모리의 크기는 2000바이트이죠.
and again we have buffer overflow there
Again, 저 곳에서 버퍼오버플로우가 발생합니다.
So always keep your variable length consistent
따라서, 변수의 길이는 항상 일정하게 유지하도록 하세요.
(다른해석: 따라서, 변수의 길이는 항상 상수로 다루도록 하세요.)
Think about that, don't forget that
유의하시고, 잊지 마시기 바랍니다.
4:14 //여기서부턴 일단 보류하겠습니다. (내용이해가 힘듬!..)
Exported functions
You can kind-a see the solution
but i prefer if you does very (bill?) code there
basically the first line is a exporter
it's exporting this dll
it's exporting ex_func
but it's taking a (filing) and length whenever you call it
right?
(학생:untrusted input)
untrusted input
those are very very typical example of untrusted input
again these kind of things in (아싸이피)s
(per pri-free 아싸이피) you find it all the time
일단 여기까지입니다.. |
Hit : 2144 Date : 2011/05/11 02:34
|