Cristi Balas . wordpress . com

A blog about programming, hacking and open source

Blog moved

Posted by Cristi on Tuesday, 2015-01-20

I’ve started to write again. The new site is on my own domain at http://blog.cristi8.net/

Posted in Uncategorized | Leave a Comment »

CTreeCtrl loop through items

Posted by Cristi on Wednesday, 2010-01-13

I was in the need of looping through the items of a CTreeCtrl in an easy way, like a list..

Here are my 2 functions from a derived class:

HTREEITEM CMyTreeCtrl::GetFirstItem() {
	return GetRootItem();
}

HTREEITEM CMyTreeCtrl::GetNextItem(HTREEITEM hItem)
{
	if(ItemHasChildren(hItem))
		return GetChildItem(hItem);
	HTREEITEM tmp;
	if((tmp = GetNextSiblingItem(hItem)) != NULL)
		return tmp;
	HTREEITEM p = hItem;
	while((p = GetParentItem(p)) != NULL) {
		if((tmp = GetNextSiblingItem(p)) != NULL)
			return tmp;
	}
	return NULL;
}

So now i can easily do:

for(HTREEITEM i = m_treeDB.GetFirstItem(); i; i = m_treeDB.GetNextItem(i)) {
    // ...
}

Posted in Windows | Tagged: , , | Leave a Comment »

Your collection of Yahoo! Messenger avatars

Posted by Cristi on Wednesday, 2008-11-26

Did you know that Yahoo! Messenger saves your friends’ avatars on your disk and forgets to delete them? And now you probably have an impressive collection of avatars. They’re in %MessengerFolder%\cache\Icon\ folder, but they have no extension (they should be .png), and are pretty hard to browse.

So, I’ve made a little perl script that shows them in your browser (tested with Internet Explorer and Firefox), sorted by date, so you can now view your friends’ avatar history, and easily save them if you want to use one (just right click and Save image as…, as you normally do on a web page)

Here’s a sample screenshot from my collection:

The .pl script requires Perl installed on your system, BUT i’ve compiled it with perl2exe, and now everyone can use it.
Should work on all windows versions (including Vista)

Download .zip file

Enjoy!

Posted in Utility programs, Windows | Tagged: , , , | Leave a Comment »

Faculty of Mathematics and Computer Science, University of Bucharest

Posted by Cristi on Thursday, 2008-10-23

As you can see on the About page, I’m a student at the Faculty of Mathematics and Computer Science.
Here are a few words about how I see this school..

Read the rest of this entry »

Posted in School | Tagged: , , , | 2 Comments »

Yahoo! Messenger Archive Decoder

Posted by Cristi on Sunday, 2008-10-12

Using the same approach as others did (see notes at the bottom of this page), and doing some reverse engineering of my own, I’ve created a little script in C that decodes all the messages (chats are ignored) in a yahoo profile directory.
I’ve made this because i wanted to merge my Yahoo! Messenger logs and Pidgin logs (I am also using Linux) in one common place.

It doesn’t have any interface.. it works like this:
Method 1: Just drag and drop the user profile folder on the exe. The user profile folder is, for example
C:\Program Files\Yahoo!\Messenger\Profiles\pufuletz_roz
Example:

Method 2: From the command line, run YM_decoder <user_profile_folder>

The decoded logs are put in a “Decoded_Archive” subfolder of the target profile.

Download .zip

Notes
Some reverse engineering for finding out the format of the archive I did my own, but I was also inspired by:

Good luck!

LE:

Linux Version
A lot of visitors are searching for a linux version.
I haven’t yet writen one (the chdir functions are different across platforms).
BUT the source code is in the .zip archive, and there’s a multi-platform function that decodes an archive. It’s like

int ym_decode_file(const char *id, const char *other_id, const char *strFin, const char *strFout);

So just pass the yahoo IDs of the file and input and output file names, and that’s it.
If u would need a ym decoder for linux, leave a comment and i’ll write it as soon as i have some free time.

Posted in Security, Utility programs, Windows | Tagged: , , , , | 3 Comments »

Back from the summer

Posted by Cristi on Thursday, 2008-10-09

I have been away for a few months, because a lot have happened and I didn’t have time for research and for writing.
Now things have settled, and I hope I can open a new section about security and continue writing.

Let’s code!

Posted in Uncategorized | 1 Comment »

[Windows] Run multiple applications from one command

Posted by Cristi on Sunday, 2008-06-15

I was in the need for running multiple commands with one single command line.
In the command line, that was as easy as “notepad & notepad”, but for the windows version i couldn’t find an alternative, no command separator.
So I wrote one.. It’s a small program that works like this:

run_combo application1 [@@ application2 [@@ application3 [...]]]

(for example: “run_combo notepad @@ notepad”)

You can download the source code / exe from my google-code page, or access this download link.

I used the MinGw compiler from Dev-C++ package to compile it.

Posted in Utility programs, Windows | Tagged: , | Leave a Comment »

Generic string TRIE implementation

Posted by Cristi on Sunday, 2008-05-11

This is an implementation of a generic TRIE data structure that holds strings (of any characters except 0, which means the end of the string). You can attach some application data to each string in the trie, so it can be useful for example in a Property/Value implementation.
Read the rest of this entry »

Posted in Library, Programming | Tagged: , , | 1 Comment »

Video Buzz for linux

Posted by Cristi on Thursday, 2008-05-08

Here’s a little C program that sends a visual notification.
It can be used to be triggered at an event and notify you of something, without any window to pop up Read the rest of this entry »

Posted in Linux, Utility programs | Tagged: , , , , | Leave a Comment »

A generic int HEAP implementation with custom compare function

Posted by Cristi on Tuesday, 2008-05-06

I would like to share a generic HEAP implementation (heap_int.h / heap_int.c) for C. Read the rest of this entry »

Posted in Library, Programming | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.