Wednesday, June 30, 2004

World Wild Web #3 - New Blog

I've copied my blog content to my web site.

You can access my blog here.

Monday, June 28, 2004

Programming #2 - The making of a Debugger, Part #1

Yep.
Since I have some good knowledge in computer programming and I'm still reading a lot on this topic (between "Book of Illusions" from Paul Auster and "The Sigma Protocol" from Robert Ludlum).

Lately I've checked the "Undocumented Windows 2000 Secrets: A Programmers Cookbook" from Sven Schreiber. Excellent book for those who want to know the inside of windows even more. Maybe a review on my web site (when I've rebooted my stupid machine). And I've come to the idea of making a debugger. So I'll make a little simple one for the windows platform (I may come later for a solution on *x platforms).

The first part of this big project will deal with inserting your program into a remote process. Doing this is tricky but necessary. You've maybe seen the IsDebuggerPresent function I explained earlier. The standard method could be a problem when a program (may be malicious) checks for IsDebuggerPresent and kill ourselves or the process we try to debug (again, it would be even worse if it removes itself from memory, incapacipating our goal to check it). Using the standard windows api methods trigger normally this flag and so IsDebuggerPresent returns true....

So what can we do to insert into a process?
Note: You cannot use this kind of techniques you need to have administrator rights.


We can always create a thread into a remote process with this function:
// Returns the handle of the new thread.

// Don't forget that everything about memory is in the other process.
// #1 - Start Address and the Parameter are in another process, so for now we cannot access
// them directly. We'll see what we can do later.

HANDLE CreateRemoteThread(
HANDLE hProcess, // Process to create thread into.
LPSECURITY_ATTRIBUTES lpThreadAttributes, // Thread attributes, normally NULL.
SIZE_T dwStackSize, // Default size of the stack, normally 0.
LPTHREAD_START_ROUTINE lpStartAddress, // See #1.
LPVOID lpParameter, // See #2.
DWORD dwCreationFlags, // Creation Flags, default is ok.
LPDWORD lpThreadId ); // ID Thread container.


Most things are possible with this method. For now, I'll give you this code, that uses many functions, and receives two parameters: the name and path for an EXE file that will be executed, and the name of a DLL to load. I'll come back on this code later. For now, just check it out:

#define VC_EXTRALEAN

#include <windows.h>
#include <stdio.h>

int main(int argc, char** argv)
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
void* pToDllName;
HANDLE hKernel32 = LoadLibrary( "kernel32.dll" );

if (argc < 3) return -1;

ZeroMemory( &pi, sizeof(pi) );
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
CreateProcess( argv[1], NULL, NULL, NULL, FALSE, 0, 0, 0, &si, &pi );

pToDllName = VirtualAllocEx( pi.hProcess, NULL, 513,
MEM_COMMIT,
PAGE_READWRITE );

WriteProcessMemory( pi.hProcess, pToDllName, argv[2], 512, NULL );
CreateRemoteThread( pi.hProcess,
NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress( hKernel32, "LoadLibraryA" ),
pToDllName, 0, NULL );

printf("Press any key to end remote process and current program.\n");
getc( stdin );
TerminateProcess( pi.hProcess, 0 );
return 0;
}

Friday, June 25, 2004

World Wild Web #2 - Web Site

Hey! I'll be having my website ready somewhere soon. Check out at
http://poltras.no-ip.com
to see when it's coming.

I still haven't configured anything except security (no exploit, guys, sorry about that...), but I'll do so maybe this weekend.

Here are a sample of most of the sections to come:
1 - Programming and Computer (of course), maybe some section more specifics later.
2 - Science (in general), maybe I'll make more subsections of it too.
3 - Philosophy (who would have doubted)
4 - Politics
5 - Music / Movie reviews
6 - Global (everything else)

7 - Personnal. Everyone will be able to have their personnal page with pictures and stuff.
7.1 - Thesis and studies. Some stuff important in studying and some interesting thesis, documents. It will be open to personnal thesis or studies (I'd like to have yours, Julie, about the Japanese market and the other one I, sigh, read in about 3 minutes which seemed interesting).
7.2 - Movies, pictures one took.
7.3 - WWW. Interesting sites, etc.

Forums to come, as well as polls, files, images, etc etc etc. Pretty complete, and the engine has all of this already included. I've already worked with this engine before, so I think I'll be able to make something neat really fast.

Of course, every one can be moderator/editor, with my permission (friends first, then references), and write news or anything for any of those sections.

Hope you'll all be there to see it :)

Of course, some documents won't be in english. By my multi-ethnic nature (germanish looking figure leaving in french canada speaking 3 languages majorly) I'll accept most documents. I'll tag them though for those in dutch (if you want of course, dutch people), french, spanish...

Thanks for the support!

Thursday, June 24, 2004

A share of me #3 - Short...

I can't sleep anymore... at least once again, I have insomnia problems. I slept 4 hours last night, and I can't go to bed right now... because I'm not feeling like it.

I've had my nightmares again lately. I've had recurrent nightmares all my life, sometimes it goes better, sometimes they come back. Now I'm grown up, so I don't scream, but they don't help me to sleep.

And they seem to appear with the lack of sleep.

Tuesday, June 22, 2004

Why What Web #1 - What?

Ok bad title for this... I'll try to find a better one :)

Here are some interesting links I've come upon, some funny other not. Those are all about computer or computer-related development.

I'm actually "taking care" of two students working with me. They have a good base on what C/C++ is/works, but they lack some deeper comprehension. Now I'm teaching them whatever they want, by doing exercises (most of them will be on my website, coming soon).

I just sent them those two links. I personnally think those are really important to read and understand, along others, because:
1 - this one explains mostly how Microsoft is losing a war mainly because it makes too much backward uncompatible changes in so little time, compared to the rest of its existence.
2 - that, on the other part, has mainly changed my view of Java on many points. First the benchmarks are no new stuff, I've seen them for 3 years now and followed the discussion. The most interesting parts come from the theory part, though, where
3 - Raymond Chen's blog, a very interesting share from the inside of Microsoft, on the why, how and what of the API.

More to come when I have some time left :)

Monday, June 21, 2004

A share of me #2 - Choices we don't make

There are some choices we do not want to make, whatever happens. Those choices depend on either the avaibility of a good ending, or no desired options, or even both.
One tries often to predict the future to the outcomes of either possibility (even if those prediction are futile, considering the different interactions), and take it into consideration.

It is a vicious way of solving this problem. In a sense, it often comes to short-term good for long-term bad, or the reverse. Then you look at the options, and can't decide if you want to make up later for not-so-bad consequences and take the present as-good-as-it-is-possible, or the other way around...

Sometimes you get away of this, timing out, or because someone else took the decision instead of you. You're then glad you didn't make the choice... and happy about the outcome of it...

Or so it seems.

Friday, June 18, 2004

Discussion #2 - Intelligence

Does learning languages improve intelligence in general? And, genuinely, does a polylinguist have more IQ than a monolinguist?

There is someone at work (we'll call him Anthony, both because it's his name and for the sake of not saying "that guy I work with" everytime :P) who's got a really good average in his courses. He speaks fluently and everyday 3 languages. So I've come to the question above... and I think the answer could be a yes for the first, and a no for the second. The question was out of the fact that he speaks 3 majorly different languages (with different roots), so that his mind is more structured to learn. I'll come back on this later.

Because intelligence is non deterministic, there is no real matter of saying that guy is more intelligent BECAUSE of this. Therefore, I think that speaking many languages improves intelligence, but not that a person who speaks only his mother tongue can't be more intelligent that someone who had the chance (it's a chance more than a choice, since this specules that the language was learnt in an age where choices was not made by us but mainly by our parents/society/environnement). Following this, I also agree to the fact that someone can have learnt many tongues without ever being more intelligent (IQ speaking) than an apple. You have to improve yourself. But the premices can be made with this. I'm coming to the why.

A language structures the mind (in terms of neural paths) so that it recognizes certain pattern (expressions) in every day life. Since french people tends to have different expressions than english speaking people, and learns to use them (neural paths are formed to the nature of the expression, its meaning) correctly, they are more used to a certain kind of thinking.
Learning is mostly made by associating different patterns with the patterns we know first. One who is really good with mathematics, and hadn't never really philosophed (which use different neural paths, even a different part of the brain - right part), will have a hard time reading Marx or Kant. Why? Because he can't find a meaning to it, they do not depends on the mathematical theories, and his mind is not formed to use them easily.

With time, eventually, the brain becomes more and more static. Once the main neural paths are strong, the less important one will have hard time forming. So learning a lot of different things young helps to master learning, helping to trace patterns with everything that has touched the patterns we've learnt. Of course, this is mostly subconciously done.

And languages that are strongly separated (Spanish and French are close, Chinese and English are really far) helps learn patterns that have almost nothing in common. So when one comes to learn something, he already has a diversified brain which can both associate expressions or path of meaning in the languages he's learnt, and help him to choke the difference.

At least I think so. What do YOU think?

Wednesday, June 16, 2004

Computer Programming #1 - IsDebuggerPresent

This is the main code to execute to check if a debugger using Microsoft's API is working. I'll check for gdb code and post it here if I have time.

unsigned long IsDebuggerPresent()

{
unsigned long ret;
__asm {
mov eax, fs:[0x18]
mov eax, [eax + 0x30]
movzx ret, [eax + 0x02]
}
return ret;
}


In fact, not too much has been done: I've disassembled kernel32.dll, checked the code for the already available IsDebuggerPresent and put it in a function :P I'll check for the flags in fs:[0x18] or even other fs segment variable. They seem interesting. Will post it here :)

Tuesday, June 15, 2004

Phrases #1 - There is no Master but the Master, and QT-1 is His Prophet.

You have to fight hard for what you believe is right, and work harder to believe it might be wrong.
- HL Jun 2004

Our fear to lose is always greater than our desire to win.
- Frederick Landry (took from someone, I think)

Do something Stupid
- Sebastien Bouchard

Say something stupid
- Steeve L'arrivee

It's good to remember we were someone before.
- HL Avr 2004

If humanity's biggest problem is communication, can we talk about it?
- HL 1998

No book can equal an instant of reflexion over the present action.
(Aucun livre ne peut égaler un instant de réflexion sur l'action présente)
- Bernard Werber - Les fourmis

Even walking, a man needs a ground.
- HL Jun 2004

Art must remake a boy from a man.
- ??? (from Gabrielle Garant)

Gravity cannot be held responsible for people falling in love.
- Albert Einstein

Life, is a lettuce. We use it all trying to tell ourselves that we could better than a salad, while a salad is already much enough.
- HL 2002

If you don't have fun somewhere in a party, you can always change place to somewhere else in the party and have fun.
- Jimmy Fortin, Winter 2003 - Because we must not forget.


:)

Discussion #1 - Your pack

Everybody has a way of opening a pack of cigarette. Every clever smoker knows why they are doing it.

As for example, here in Canada we have two types of pack: those which contains 25 cigarettes in 2 sections (left and right for purposes, 13 to the left and 12 to the right), and those who are larger (3 rows of 8,9,8 cigarettes or 7,6,7 if there is only 20 cigarettes in pack), which does not have any separation, and are a more international pack I think.

Now for the firsts, there are many ways to open them: left, smoke 13, right; right, smoke 12, left; both way, smoke from left to right; both way, smoke from right to left. Even with each ways there are different things we can do...


Now we all have our little manias...

Gabrielle, improvisation teammate, turn a butts upside-down, and smoke it last (I did the mistake to take it by mistake... it wasn't in my mouth that she was screaming around... or am I exagerating things?).

As for I, when I use the larger pack, I usually remove the top plastic, not the bottom part, just enough to open the pack and take a cigarette. If it is a 2-sections-pack, I open the left side, then smoke it all, then open the right part. Simple and efficient, in the reading sense.
My biggest mania comes when offering a clop to someone. I open the pack, pull a cigarette half out, and offer it to the one asking. Just enough to tell them "I offer you THIS cigarette, but you are the one who takes it and I don't take any responsibilities as for your health"... :)

What are your manias, smokers? And what are the reasons?

Monday, June 14, 2004

A share of me #1 - Becoming someone...

It seems like I've become a lot less wise with time. I don't know why, but I seem to miss something. Something that was inspiring me, guiding me. My brain is now so full of technical writing, mathematics and useless stuff that I have forgotten even what it is. I don't care what it is, not anymore. Life has proven I can live without, even as half a man. Who am I anyway to refrain destiny. Sure, if I ever have the chance to find it again, never would I let it go. never? Can't tell really.
One realize some day that it doesn't serve any purpose to put things in cage to let them free (see "L'arrache-coeur", from Boris Vian) or to free himself. Therefore, you have to let it go. The strong feeling that results from this act is often trust, or at least it should.

Maybe it's part of becoming an adult...

Friday, June 11, 2004

Meditation Technique #1 - When you have bad feelings

Close your eyes. Concentrate a little to regulate your ventilation. You need to inhale at the same rate you exhale, with a little break between the two.

Think about nothing other than yourself. You are in an egg. Everything outside you and the egg exists no more. The egg is your sanctuary, no one can reach you and it is floating in the void.
You are at the center of the egg, at the place where the yellow should be. Everything is white, and warmth. Your knees are under your breast and your arms surrounding your legs.

Now think about your bad feelings. Every bad feeling is purple. Think about your good feelings. Represent them as yellow. They are there, inside of you. You are mostly purple. Let them perspire through you. They are filling, one by one, the white part of the egg.

As time goes, the egg becomes more and more purple-ish. When it is all purple, you are filled with a little yellow circle.

You decide where this circle starts. It may be from your heart, your head, your groin. Concentrate on this circle. It is warmth and emaning a yellow aura. With every exhalation, the circle expands a bit, filling you from inside. It's filling, but doesn't get out of you. It is still emaning a warmth yellow aura that surrounds every part it fills. It takes time, but it is good.
It fills your head, your brain, your eyes and your mouth. It fills your breast, your lungs, your heart, your belly, your arms. It fills your hands, your groin, your genitals, your legs, your feet. Feel it fills every part, feel every part of yourself.

When every part of you is yellow, and you are emaning a yellow aura, you are in control of your body. Since you control the yellow circle, and you are now the yellow circle, your body makes one with your soul.

Just push a little bit outside with the yellow part of yourself now. Crack the egg, crack its covering. With every crack, a little part of the purple liquid contained inside the egg exhale it. It goes away into the void, disappearing. When there is no more covering, there is no more purple liquid, and you are free from the egg.

You can now open your eyes.




More explanation to come, or if you can think of some :P
When I say a sanctuary, I actually mean it. The egg represent your internal world, the place where you keep your secrets. No one can reach you there if you don't allow them, and it is important in this meditation trick, because every bad feelings start from that place. As well as good feelings, but you don't want to get rid of them, right?
There are things even secret to yourself. Your subconscious is really strong normally, so that's why I don't want to focus on what my bad feelings are, just to evacuate them.
Stanislavski (IIRC, maybe I'm wrong) did use yellow to represent concentration. It also means freedom and non-attachment, which is perfect. Purple is a calm color, instead of red. I took it to represent the bad feelings since they seem less important with this color than black. I couldn't take a better color (white represents purity, blue is too cold). I think green could fit, since it is often represented as freedom from negative attitude.
This is a meditation trick I made out of many things. You can either say I'm the author or not. I just find it very efficient and it's what matters. My circle starts from my forehead, the junction between my nose bone and the point between my eyes, since it seems more efficient there than elsewhere (I can concentrate more on it). I tried the belly, the heart, the feet (two circles), the groin and the back of my head. I tried the lungs too once, but it didn't fit.
When controling my respiration, I exhale everything, wait a second, then start inhaling. I count 4 seconds in my head, then waits 2 seconds, exhale 4 seconds and wait 2 seconds. I do this a lot of time, like 2-3 minutes, to be sure my heart follows the rythm and that I am more in control of my body. It seems easier after that to breathe with a regular rythm without concentrating.
I wasn't actually able to feel every part of me until a good time, so it may need practice. But it is important that you try to feel every muscle, every finger, every cell of your body. You'll feel more comfortable after. I did some mediation (trick to come, but I'll explain it now) just concentrating on a part, say my arms, and try to feel and contact everything inside of it. Fluids, cells, bones, everything. It's actually very psychological since you can't physically feel any cell, but it practices the symbiose and homogeneity of the body.
I sometimes just do the yellow circle part. It seems efficient enough to calm me when the feelings are not so strong and I need to solve them, not throw them away. You can skip it too, just do the purple part. It works.
I took bad feelings, but it could have been something else. I have another technique for worries and re-energize, and I found this one didn't fit for physical harm. Strong emotions like lost-love, death of a friend or greater stress need more efficient and active techniques, because the mind only can't get rid of them. You need movement and a good state. Maybe I'll come with something for it.



Comments?

Thursday, June 10, 2004

Poetry #1 - Who we are (Old stuff)

This is a little poem I made a coupla years ago... it would indeed need some rewriting, and I think I'll make it soon, but here is what it was:

Who we are...


Are we really here and there,
In this little gloomy universe?
If so, why do I still fear
The one who are so far and so near?
I can see light so right
Is coming to me so tight...
Is it once again the perfect illusion
Of another love therefore strong.
But who am I and who are they?
Does it so matter as long as we lay?
The night is mighty,
the day is shady.
Is it love real and true,
Or just another "I want you"?
If I can touch, if I can care,
If I can't breathe, if I can't dare,
The illusion of life stays right,
And love stays in its shady light.
Along with you, so near and so far,
I am still wondering who we are...



It was really deep, and has meaning that some people may not understand. Still I find it right, and true. At least at that time it was.
I'll come back soon with some new materials ;)

Tuesday, June 01, 2004

First blog ever

Ok. Ok ok ok. Ok I know!

This is my first step to the new "hip trip of the 'net": blog (short of web log, which IMO is shorting something comprehensible into a buzzword (or hipword) that has no meaning).

So what? I'm not here to judge the new tendances of the web. Even if some of them are purely marketing, like that everybody should have their own blog, most of them are remarkably legitimately talking about their animals.

Of course, there are original ones, or just some talking about themselves and their hobbies. There are already a lot of joke about this.

Well, mind you, mine won't be any different. Although I won't talk much about what's going on in my day-to-day little life, and I don't tell you how cute my ferret is (mainly because I don't have one). This will likely be a discussion, in either way (monolog or dialog) you want (or dare), like any discussion you might have had around a pack of cigarettes and a cup...

Maybe because I kinda miss the period of my life where 10 cups of coffee per evening, 4 out of 5 days (and some the weekends), at Stratos Pizza (The king of poutine, which is kind of funny considering the name), just talking about anything...