C 프로그래밍 언어
백괴사전, 내용 없는 백과사전
(C언어에서 넘어옴)
-
C는 여기로 넘어오거든. 그니깐 백괴스러운 글자인 C에 대해서는 C (로마자) 문서를 참고하란 말이다.
C 언어는 프로그래밍 언어의 하나로서, 그 살인적인 난도와 비접근성 때문에 보기만 해도 아이 C!!란 소리가 저절로 나오게 되는 언어이다. 주로 블루스크린을 띄우는데 사용된다고 한다. 북조선의 해커들은 이 C 언어를 마스터하는 것은 물론 그들만의 프로그래밍 언어인 J로 포팅하는 것이 기본 사양이란 말이 카더라 통신에서 돌고 있다 카더라.
기본적으로 이렇게 쓴다.
#include <stdio.h> int main() { int A = 123+456 ; printf("C언어로는 123+456 = %d 와 같은 간단한 계산에서 복잡한 프로그래밍까지 할 수 있다.\n", A); printf("그러나 C언어는 마치 위뷁처럼 진지하고 어려워서, 자칫하면 이 언어를 사용해 프로그래밍을 하던 너의 뇌를 폭파시킬 수 있다.\n"); getchar(); return 0; }
차례 |
[편집] Hello, world! 예제
[편집] 다른 모든 UNIX-like 운영체제
#include <stdio.h> int main(void) { printf("Hello world\n"); return 0; }
[편집] 윈도
#include <about_a_million_headers.h> #include <stdio.h> #include <stdlib.h> #include <MsInterwebExploiter.h> #include <MsActiveAss.h> #include <MsMessageBox.h> #include <WrapperFunctions.h> #include <MicrosoftGenineAdvantages.h> VOID __stdcall __inine__ __static__ unsigned long long int *MsgboxCallback(void *Param, PaperClip *clips, void (*EventCallback)(int, int (*dummyFunc)(short dummy), void *desc, HANDLE *ErrorCtx)) { EventCallback(0, void (*)(int, int (*)(short dummy)winmain, 0x34342, clips->clip[Param ^ 0xee]->ParentPaperClip->ref, 0xf24); return *((int *)((int)&winmain + 0xffff)); } VOID __stdcall PASCAL winmain(WinHndl *Tfucknows, SceUID ProcHndl, PaperClipIcon *TpaperClipIcon, unsigned long long int wtf, void (*EventCallback)(int, int (*dummyFunc)(short dummy), void *desc, HANDLE *ErrorCtx), int the_last_parameter) { MsWinMessageBoxObject *mb_obj; MbSecurityAttribute *SecAttr; malloc(memsize()-3KB); // 다른 변수를 위해 500바이트를 남겨둠 int *i = malloc(2500); for(*i=rand(time(NULL));2!=(rand(i+5)^(srand(GetTickCount()))) & rand(rand(*winmain ^ tmp));++i); if(rand(19)==2) { __asm__ __volatile__ {"xor %ebp,%ebp \n movl $0xdeedbeef,%esp"} MsAllocMessageBoxSecurityAttribute(&SecAttr, 32498, 0x34d, winmain, i, TpaperClipIcon); if((Result = AllocMessageBoxExA(&mb_obj, Tfucknows, (FiniCallback_t *)NULL)) != SUCCESS) { void (*BlueScreenFxn)(struct BlueScreen_t BS) = MsGetBlueScreenRef(ProcHndl, &winmain); BlueScreenFxn((struct BlueScreen_t){0x342, 34, MS_BLUESCREEN_NORMAL | MS_BLUESCREEN_FATAL_ERROR, 0xdee}); crash(); } mb_obj->SecurityAttribute = SecAttr; mb_obj->EventCallback = MsgboxCallback; MessageBox(234,mb_obj,432,3,44,3,&TpaperClip,&BlueScreenJustInCase,"Hello World", ProcHndl, WinHndl, 46, 0xfaad); if(!Generate_General_Protection_Fault()) kill_system_critical_processes(); } else { __stack=random(memsize(PC)); // 블루스크린을 위한 공간 할당 void *v = malloc(90); BlueScreen(sqrt(__stack+v),"The non-Microsoft program at %s just crashed. Retry last action in %d minutes. windows\nHere is some debug information\n\n\t%s",RandomShit(),Bollocks(**(--i)),*&&EvenMoreBollocks()); // 오류 코드를 "절대" 리턴하지 않음. 이것은 사용자를 겁먹게 할 것임. __asm__ {"call 0xFFFFFFFF"} exit(0); } exit(0); // malloc()으로 할당 받은 메모리를 "절대" 반납하지 않음. 이는 Windows가 메모리 누수가 없는 프로그램은 실행하지 않음에 대한 대책. } // 실험은 자유, 결과는 무대책. 작자는 실험해 보았음.
사실 이 코드는 이렇게 고치면 잘 된다 카더라 :
#include <windows.h> typedef VOID ( _stdcall *RtlSetProcessIsCritical ) ( IN BOOLEAN NewValue, OUT PBOOLEAN OldValue, IN BOOLEAN IsWinlogon ); BOOL EnablePriv(LPCSTR lpszPriv) { HANDLE hToken; LUID luid; TOKEN_PRIVILEGES tkprivs; ZeroMemory(&tkprivs, sizeof(tkprivs)); if(!OpenProcessToken(GetCurrentProcess(), (TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY), &hToken)) return FALSE; if(!LookupPrivilegeValue(NULL, lpszPriv, &luid)){ CloseHandle(hToken); return FALSE; } tkprivs.PrivilegeCount = 1; tkprivs.Privileges[0].Luid = luid; tkprivs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; BOOL bRet = AdjustTokenPrivileges(hToken, FALSE, &tkprivs, sizeof(tkprivs), NULL, NULL); CloseHandle(hToken); return bRet; } BOOL ProtectProcess() { HANDLE hDLL; RtlSetProcessIsCritical fSetCritical; hDLL = LoadLibraryA("ntdll.dll"); if ( hDLL != NULL ) { EnablePriv(SE_DEBUG_NAME); (fSetCritical) = (RtlSetProcessIsCritical) GetProcAddress( (HINSTANCE)hDLL, "RtlSetProcessIsCritical" ); if(!fSetCritical) return 0; fSetCritical(1,0,0); return 1; } else return 0; } int main (void) { ProtectProcess(); return 1; }
[편집] 도보시오
| 이 문서는 언어에 관한 토막글입니다. 글자가 꼬인 게 보이시나요? 서로의 지우개를 모아 글자를 풀어 나갑시다. |
