Crucify my love
If my love is blind
Crucify my love
If it sets me free
Never know Never trust
"That love should see a color"
Crucify my love
If it should be the way
Swing the heartache
Feel it inside out
When the wind cries
I'll say goodbye
Tried to learn Tried to find
To reach out for eternity
Where's the answer
Is this forever
Like a river flowing to the sea
You'll be miles away, and I will know
I know I can deal with the pain
No reason to cry
Crucify my love
If my love is blind
Crucify my love
If it sets me free
Never know Never trust
"That love should see a color"
Crucify my love
If it should be the way
'Til the loneliness shadows the sky
I'll be sailing down and I will know
I know I can clear clouds away
Oh Is it a crime to love
Swing the heartache
Feel it inside out
When the wind cries
I'll say goodbye
Tried to learn Tried to find
To reach out for eternity
Where's the answer
Is this forever
If my love is blind
Crucify my love
If it sets me free
Never know Never trust
"That love should see a color"
Crucify my love
If it should be the way
Tommy used to work on the docks
Unions been on strike
Hes down on his luck...its tough, so tough
Gina works the diner all day
Working for her man, she brings home her pay
For love - for love
She says weve got to hold on to what weve got
cause it doesnt make a difference
If we make it or not
Weve got each other and thats a lot
For love - well give it a shot
Chorus:
Whooah, were half way there
Livin on a prayer
Take my hand and well make it - I swear
Livin on a prayer
Tommys got his six string in hock
Now hes holding in what he used
To make it talk - so tough, its tough
Gina dreams of running away
When she cries in the night
Tommy whispers baby its okay, someday
Weve got to hold on to what weve got
cause it doesnt make a difference
If we make it or not
Weve got each other and thats a lot
For love - well give it a shot
Chorus
Weve got to hold on ready or not
You live for the fight when its all that youve got
Chorus
FOPEN_MAX is a pre-defined macro that yields the maximum number of files allowed to open simultaneously. It is defined in <cstdio>
This is how it looks like
#define FOPEN_MAX <integer constant expression >= 8>
Have fun!@
Verse 1
The dream is fading, now I'm staring at the door
I know its over cause my feet have hit the cold floor
Check my reflection, I ain't feelin what I see
It's no mystery
Whatever happened to a passion I could live for?
What became of the flame that made me feel more?
And when did i forget that...
Chorus
I was made to love You
I was made to find You
I was made just for You
Made to adore You
I was made to love
And be loved by You
You were here before me
You were waiting on me
And you said you'd keep me
Never would you leave me
I was made to love
and be loved by You
Verse 2
The dream's alive with my eyes opened wide
Back in the ring You've got me swinging for the grand prize
I feel the haters is spittin vapors on my dreams
But I still believe
I'm reachin out, reachin up, reachin over
I feel a breeze cover me called Jehovah
And Daddy I'm on my way
Cause I was made to love...
Chorus
I was made to love You
I was made just for you Made to adore you
I was made to love and be loved by you
You were here before You were waiting on me
And you said you'd keep
Me never would you leave
I was made to love and be loved by you
Bridge
Anything I would give up for You
Everything, I'd give it all away
(Repeat 3x)
I was made to love You, I was made to love You
I was made to love You, I was made to find you
I was made to love You, Made just for You
I was made to love You, Made just for You
I was made to love You, Made just for You
I was made to love You, I will love by you
Today, we will learn a new widget control, GtkEntry, a text editor. It's a text box that users can input text inside.
Reference GtkEntry
I'm not gonna explain each properties and methods in details anymore. However, to practice directly is the better way of learning it since you've already familiar with Gtk+ programming.
Practice 1: A simple one, a label will show up everything you type in the entry box when clicking a button.
Practice 2: How about a login dialog !
/*
* @author [JaPh]
* @date 30 August, 2009
* @file GtkEntry_01.c
* @site http://xjaphx.blogspot.com/
*/
#include <gtk/gtk.h>
#include <glib.h>
typedef struct _STORE {
GtkLabel *label;
GtkEntry *entry;
} STORE;
void
btn_get_clicked_event( GtkButton *btn_get, STORE *data )
{
gtk_label_set_text( data->label, gtk_entry_get_text(data->entry));
}
int
main( int argc, char *argv[] )
{
GtkWidget *window;
GtkWidget *label;
GtkWidget *entry;
GtkWidget *btn_get;
GtkWidget *vbox;
STORE *data;
gtk_init( &argc, &argv );
window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW(window), "[JaPh]Lesson 13: GtkEntry" );
gtk_window_set_default_size( GTK_WINDOW(window), 100, 100 );
label = gtk_label_new("Type anything to entry below: ");
btn_get = gtk_button_new_with_mnemonic("_Get");
entry = gtk_entry_new_with_max_length( 128 );
vbox = gtk_vbox_new( TRUE, 5 );
gtk_box_pack_start( GTK_BOX(vbox), label, TRUE, TRUE, 5);
gtk_box_pack_start( GTK_BOX(vbox), entry, TRUE, TRUE, 5);
gtk_box_pack_start( GTK_BOX(vbox), btn_get, TRUE, TRUE, 5);
data = (STORE *) g_malloc( sizeof (STORE) );
data->label = GTK_LABEL(label);
data->entry = GTK_ENTRY(entry);
gtk_container_add( GTK_CONTAINER(window), vbox);
g_signal_connect( G_OBJECT(window), "destroy", G_CALLBACK( gtk_main_quit ), NULL );
g_signal_connect( GTK_BUTTON(btn_get), "clicked",
G_CALLBACK( btn_get_clicked_event ), data );
gtk_widget_show_all( window );
gtk_main();
g_free( data );
return 0;
}

Well, not much to say but I'm going to create several special sessions next on Gtk+ programming. Make sure you understand all the basics of Gtk+.
/*
* @author [JaPh]
* @date 30 August, 2009
* @file GtkEntry_02.c
* @site http://xjaphx.blogspot.com/
*/
#include <gtk/gtk.h>
#include <string.h>
#include <glib.h>
typedef struct _DATA {
GtkWidget *widget;
struct _DATA *next;
} DATA;
const char *username = "[JaPh]";
const char *password = "Lesson 14";
void
MessageBox( GtkMessageType type, const char *title, const char *message, const char* details )
{
int res;
GtkWidget *message_box;
message_box = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
type, GTK_BUTTONS_OK,
message );
gtk_window_set_title( GTK_WINDOW(message_box), "[JaPh]Lesson 14: GtkEntry" );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG(message_box), details );
res = gtk_dialog_run( GTK_DIALOG(message_box));
if( res == GTK_RESPONSE_OK ) {
gtk_widget_destroy( message_box );
}
}
void
btn_login_clicked_event( GtkButton *btn_login, DATA *data )
{
if( !strcmp( username, gtk_entry_get_text( data->widget ) ) &&
!strcmp( password, gtk_entry_get_text( data->next->widget )) )
{
MessageBox( GTK_MESSAGE_INFO, "Congratulations!", "Correct!",
"Username and password are correct." );
} else {
MessageBox( GTK_MESSAGE_ERROR, "Fail ", "Incorrect",
"Username and password are incorrect." );
}
}
int
main( int argc, char *argv[] )
{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *hbox_user, *hbox_pass, *hbox_button;
GtkWidget *lbl_user, *lbl_pass;
GtkWidget *txt_user, *txt_pass;
GtkWidget *btn_login, *btn_exit;
DATA *data;
gtk_init( &argc, &argv );
window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW(window), "[JaPh]Lesson 14: GtkEntry" );
gtk_window_set_default_size( GTK_WINDOW(window), 100, 100 );
lbl_user = gtk_label_new("Username: ");
txt_user = gtk_entry_new();
hbox_user = gtk_hbox_new(TRUE, 5);
gtk_box_pack_start( GTK_BOX(hbox_user), lbl_user, TRUE,TRUE, 5);
gtk_box_pack_start( GTK_BOX(hbox_user), txt_user, TRUE,TRUE, 5);
lbl_pass = gtk_label_new("Password: ");
txt_pass = gtk_entry_new();
/* set invisible character */
gtk_entry_set_invisible_char( GTK_ENTRY(txt_pass), '*' );
/* activate the invisibility mode */
gtk_entry_set_visibility( GTK_ENTRY( txt_pass ), FALSE );
hbox_pass = gtk_hbox_new( TRUE, 5);
gtk_box_pack_start( GTK_BOX(hbox_pass), lbl_pass, TRUE, TRUE, 5);
gtk_box_pack_start( GTK_BOX(hbox_pass), txt_pass, TRUE, TRUE, 5);
btn_login = gtk_button_new_with_mnemonic("_Login");
btn_exit = gtk_button_new_with_mnemonic("E_xit");
hbox_button = gtk_hbox_new( TRUE, 5);
gtk_box_pack_start( GTK_BOX(hbox_button), btn_login, FALSE, TRUE, 20);
gtk_box_pack_start( GTK_BOX(hbox_button), btn_exit, FALSE, TRUE, 20);
vbox = gtk_vbox_new( TRUE, 0);
gtk_box_pack_start( GTK_BOX(vbox), hbox_user, TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(vbox), hbox_pass, TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(vbox), hbox_button, TRUE, TRUE, 0);
data = (DATA *) g_malloc( sizeof( DATA ));
data->widget = txt_user;
data->next = (DATA *) g_malloc( sizeof( DATA ));
data->next->widget = txt_pass;
data->next->next = NULL;
gtk_container_add( GTK_CONTAINER(window), vbox);
g_signal_connect( G_OBJECT(window), "destroy",
G_CALLBACK( gtk_main_quit ), NULL );
g_signal_connect( GTK_BUTTON(btn_login), "clicked",
G_CALLBACK( btn_login_clicked_event ), data );
g_signal_connect( G_OBJECT(btn_exit), "clicked",
G_CALLBACK( gtk_main_quit ), NULL );
gtk_widget_show_all( window );
gtk_main();
g_free(data);
return 0;
}
Have fun!@
[ Crackme Info ]
Difficulty: 1 - Very easy, for newbies
Platform: Unix/linux etc.
Language: Assembler
Refer: click here
Click to Download
Load into IDA, we have the main program
.text:08048085 mov ebx, 1 ; fd
.text:0804808A mov ecx, offset aPassword ; "\nPassword : "
.text:0804808F mov edx, 0Dh ; len
.text:08048094 int 80h ; LINUX - sys_write
.text:08048096 mov edx, 100h ; len
.text:0804809B mov ecx, offset asc_804911B ; " "
.text:080480A0 mov ebx, 0 ; fd
.text:080480A5 mov eax, 3
.text:080480AA int 80h ; LINUX - sys_read
.text:080480AC mov esi, offset aQtbxctu ; "QTBXCTU"
.text:080480B1 mov edi, esi
.text:080480B3 xor ebx, ebx
.text:080480B5 cld
.text:080480B6
.text:080480B6 loc_80480B6: ; CODE XREF: start+43j
.text:080480B6 lodsb
.text:080480B7 xor al, 21h
.text:080480B9 stosb
.text:080480BA inc ebx
.text:080480BB cmp ebx, 7
.text:080480C1 jz short loc_80480C5
.text:080480C3 loop loc_80480B6
.text:080480C5
.text:080480C5 loc_80480C5: ; CODE XREF: start+41j
.text:080480C5 mov esi, offset asc_804911B ; " "
.text:080480CA mov edi, offset aQtbxctu ; "QTBXCTU"
.text:080480CF mov ecx, 7
.text:080480D4 cld
.text:080480D5 repe cmpsb
.text:080480D7 jnz short loc_80480EF
.text:080480D9 mov eax, 4
.text:080480DE mov ebx, 1 ; status
.text:080480E3 mov ecx, offset unk_8049105 ; addr
.text:080480E8 mov edx, 16h ; len
.text:080480ED int 80h ; LINUX - sys_write
.text:080480EF
.text:080480EF loc_80480EF: ; CODE XREF: start+57j
.text:080480EF mov eax, 1
.text:080480F4 int 80h ; LINUX - sys_exit
.text:080480F4 start endp
.text:080480F4
.text:080480F4 _text ends
.text:080480F4
Each bytes of our input password is encrypted:
.text:080480B6 loc_80480B6: ; CODE XREF: start+43j
.text:080480B6 lodsb
.text:080480B7 xor al, 21h
.text:080480B9 stosb
.text:080480BA inc ebx
.text:080480BB cmp ebx, 7
.text:080480C1 jz short loc_80480C5
.text:080480C3 loop loc_80480B6
So, the real password can be found if we decrypt the string "QTBXCTU".
The encryption is simple, each byte is XORed w/ 0x21.
Then, we also use XORed w/ 0x21 to decrypt it.
Here a little perl script I wrote to decrypt.
#!/usr/bin/perl
my $cipher_txt = "QTBXCTU";
my $plain_txt;
my @arr = unpack("C*", $cipher_txt);
foreach my $c (@arr) {
$plain_txt .= chr( $c ^ 0x21 );
}
print $plain_txt, "\n";
Have fun!@