cairo graphics 0.5 (arc )

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { int i; cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0.3, 0.8, 0.7); cairo_set_line_width(cr,1.0); for (i=0;i<100;i++) { /* cairo_move_to(cr,30+i,60); cairo_line_to(cr,30+i,60+i);*/ /* cairo_rectangle(cr,100,100,10+i,10+i);*/ cairo_arc(cr,100,100,60,50,10); /* cairo_line_to(cr,40,200); */ cairo_stroke(cr); /* …

rectangle with cairo

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width(cr,1.0); cairo_rectangle(cr,30,20,67,70); cairo_stroke(cr); cairo_destroy (cr); cairo_surface_write_to_png (surface, “hello.png”); cairo_surface_destroy (surface); return 0; }

line with cairo

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width(cr,1.0); cairo_move_to (cr, 10.0, 50.0); cairo_line_to(cr,20,300); cairo_stroke(cr); cairo_destroy (cr); cairo_surface_write_to_png (surface, “hello.png”); cairo_surface_destroy (surface); return 0; }

Print With Delay 0.6 ( with option)

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include #include int main(int argc,char *argv[]) { int count; int i=0,getptr; pid_t pid; size_t length; char array[20]=”Happy Friendship Day”; /* printf(“n Happy Friendship Day n”); */ pid=fork(); if (pid == 0) { setsid(); setenv(“PS1″,”$”,1); /* getptr=getenv(“PS1”); printf(“%s”,getptr); */ printf(“\n”); for(i=0;i<20;i++) …

negate instruction NEG

GDB shows “neg” instruction or $0xffffffffffffffff,%eax jmp 0x7f94f7fce0d0 mov 0x296e5f(%rip),%rax # 0x7f94f8264f98 neg %edx mov %edx,%fs:(%rax) or $0xffffffffffffffff,%eax jmp 0x7f94f7fce10f End of assembler dump. (gdb) 0x00007f94f7fce139 : neg %edx Process Involved software : gnome-panel. The launcher and docking facility for GNOME Explanation The neg (negate) instruction takes the two’s complement of a byte or word. …

CMP . Instruction

WinDbg shows cmp Instruction 7c9011ec 803d94b0977c00 cmp byte ptr [ntdll!fltused+0x4c (7c97b094)],0 7c9011f3 8b7508 mov esi,dword ptr [ebp+8] 7c9011f6 8945fc mov dword ptr [ebp-4],eax 7c9011f9 0f85d7ec0000 jne ntdll!RtlInitUnicodeStringEx+0x61 (7c90fed6) 7c9011ff f6461010 test byte ptr [esi+10h],10h 7c901203 0f84cdec0000 je ntdll!RtlInitUnicodeStringEx+0x61 (7c90fed6) 7c901209 5e pop esi 7c90120a c9 leave 7c90120b c20400 ret 4 ntdll!DbgBreakPoint: 7c90120e cc int 3 …

exclusive OR Instruction :-

GDB shows XOR Instruction (gdb) disassemble 0x00007f16db50b647 Dump of assembler code for function gtk_main: 0x00007f16db50b5a0 : push %r15 0x00007f16db50b5a2 : xor %edi,%edi 0x00007f16db50b5a4 : mov $0x1,%esi 0x00007f16db50b5a9 : push %r14 0x00007f16db50b5ab : push %r13 0x00007f16db50b5ad : push %r12 0x00007f16db50b5af : push %rbp 0x00007f16db50b5b0 : push %rbx 0x00007f16db50b5b1 : sub $0x38,%rsp 0x00007f16db50b5b5 : addl $0x1,0x4e2af4(%rip) # …

RET instruction :)

WinDbg shows RET Instruction 7c901042 c20400 ret 4 7c901045 52 push edx 7c901046 e8447f0100 call ntdll!RtlpWaitForCriticalSection (7c918f8f) 7c90104b 648b0d18000000 mov ecx,dword ptr fs:[18h] 7c901052 8b542404 mov edx,dword ptr [esp+4] 7c901056 ebc4 jmp ntdll!RtlEnterCriticalSection+0x17 (7c90101c) 7c901058 8da42400000000 lea esp,[esp] 7c90105f 8d9b00000000 lea ebx,[ebx] 7c901065 8b4124 mov eax,dword ptr [ecx+24h] 7c901068 39420c cmp dword ptr [edx+0Ch],eax 7c90106b …

test instruction +

| GDB shows TEST instruction | Dump of assembler code for function *__GI___poll: 0x00007f73ec2120b0 : sub $0x28,%rsp 0x00007f73ec2120b4 : mov 0x29c52e(%rip),%eax # 0x7f73ec4ae5e8 0x00007f73ec2120ba : test %eax,%eax 0x00007f73ec2120bc : jne 0x7f73ec2120d5 0x00007f73ec2120be : movslq %edx,%rdx 0x00007f73ec2120c1 : mov $0x7,%eax 0x00007f73ec2120c6 : syscall 0x00007f73ec2120c8 : cmp $0xfffffffffffff000,%rax 0x00007f73ec2120ce : ja 0x7f73ec212121 0x00007f73ec2120d0 : add $0x28,%rsp 0x00007f73ec2120d4 …

Jump if Equal :)

je instruction (gdb) disass Dump of assembler code for function fputs_unlocked: 0xb7788c30 : push %ebp 0xb7788c31 : mov %esp,%ebp 0xb7788c33 : sub $0x1c,%esp 0xb7788c36 : mov %ebx,-0xc(%ebp) 0xb7788c39 : call 0xb773daaf 0xb7788c3e : add $0xe13b6,%ebx 0xb7788c44 : mov %edi,-0x4(%ebp) => 0xb7788c47 : mov 0x8(%ebp),%edi 0xb7788c4a : mov %esi,-0x8(%ebp) 0xb7788c4d : mov 0xc(%ebp),%esi 0xb7788c50 : mov …