h1

Moved all stuff to Google Code

November 23, 2008

After some hassle I finally got my own SVN repository at Google Code. Slowly I will be migrating all my stuff there and say goodbye to free filehosting. Hopefully Google Code won’t fail me.

Also, I decided to rewrite most of my MASM source here in C++, since most of you guys aren’t assembly freak like me :P and probably C++ is much easier to code than assembly too. (Side note: C/C++ pointer is very much different from assembly and that, have seriously confused me at times. :/)

My SVN repository is available here. Feel free to look around and leave comments here.
http://code.google.com/p/opcode0×90/

h1

MySql 5.0 Unsigned Integer Underflow

August 1, 2008

This is tested on MySql 5.0.60-r1 (gentoo portage).

mysql> system uname -a
Linux meepo 2.6.24-hardened-r3 #11 Mon Jul 28 07:31:20 MYT 2008 i686 AMD Sempron(tm) 2200+ AuthenticAMD GNU/Linux
mysql> SELECT VERSION();
+------------+
| VERSION()  |
+------------+
| 5.0.60-log |
+------------+
1 row in set (0.00 sec)

mysql> system uname -a
Linux gentoo 2.6.24-hardened-r3 #11 Mon Jul 28 07:31:20 MYT 2008 i686 AMD Sempron(tm) 2200+ AuthenticAMD GNU/Linux
mysql> SELECT CAST( -1 AS UNSIGNED );
+------------------------+
| CAST( -1 AS UNSIGNED ) |
+------------------------+
|   18446744073709551615 |
+------------------------+
1 row in set (0.00 sec)

mysql> SELECT CAST( 0 AS UNSIGNED ) - 1;
+---------------------------+
| CAST( 0 AS UNSIGNED ) - 1 |
+---------------------------+
|      18446744073709551615 |
+---------------------------+
1 row in set (0.00 sec)

mysql>

It is expected that any negative unsigned value to be “casted” to 0.

I have filed a bug report at bugs.mysql.com
http://bugs.mysql.com/bug.php?id=38512

Edit:
Its now fixed and closed. They introduced a strict mode instead of rounding the value to 0. You should upgrade your MySql now.

h1

Speeding up Portage and Kernel Compiling

June 5, 2008

Ever get annoyed by Gentoo’s forever-lasting compiling? Here is few tricks I found that really helps when surfing through gentoo-wiki.com.

Speedup compiling using tmpfs

To speed up Portage compiling, the trick here is to mount a ramdisk at Portage temp compile directory. Everything in that directory will be placed onto RAM instead of going to disk, therefore greatly improves speed.

This is the time needed to compile xorg-server.

Before:

real    9m18.899s
user    9m49.958s
sys    4m18.195s

After:

real    6m48.731s
user    5m9.471s
sys    4m6.079s

Impressive eh? ;) Its a 33% speed up. Since everything is placed in RAM, when compiling very large package (namely openoffice) you might get this message.

IOError: [Errno 28] No space left on device

It means we have ran out of space for ramdisk. Unmount the ramdisk and proceed with emerge.

gentoo ~ # umount /var/tmp/portage/
gentoo ~ # emerge something
Calculating dependencies -
...
gentoo ~ # mount /var/tmp/portage/

Next, we can speed up kernel compiling by using ccache. Since most of the time kernel is compiled with minor changes, ccache would speed up the process dramatically by “re-using” files that are already compiled. Its quite troublesome to make CC=”ccache gcc” -j3 everytime you want to compile the kernel, we can write up a script that simplifies the process.

File: /sbin/compile-kernel

cd /usr/src/linux

mount /boot
make clean

make CC="ccache gcc" -j3 && \  # -jN for parallel compiling (follow N = number of core + 1)
make modules_install && \
make install && \              # this will install kernel to default /boot/vmlinuz symlink
module-rebuild rebuild && \    # / You might want to comment out these two lines if
update-modules                 # \ you dont have module-rebuild installed.

make clean
umount /boot

cd $OLDPWD

As root, chmod u+x /sbin/compile-kernel to make it executable. Edit the script if necessary. To (re)compile kernel, just issue compile-kernel to do so.

Enjoy the blazing fast compiling. :)


Further reading:
Using ccache

h1

Installing Gentoo on Dell Inspiron 1420

March 26, 2008

Note: This post is depreciated as the things had changed quite a lot since then. You can find the updated info from gentoo-wiki.com here.

Read the rest of this entry »

h1

Experiencing freeze with ollydbg?

January 13, 2008

At ollydbg’s Debugging Options, uncheck Registers -> Decode SSE Registers. This should fix the hang up when debugging multi-threaded apps. Sometimes the hang up is caused by the plugins, check if any causing it and remove it accordingly.

h1

Patch for AppLocale

January 9, 2008

Finally back in action. :) My PC has broke down quite a while ago, spitting random BSOD and eventually met its uneventful death. Amen. Now I am starting a new year with a brand new laptop. :D Yay! Okay lets get back to business.

I am a person who frequently use non-English application while running on the default system locale. The result ? Garbage characters in UI as the Microsoft puts it. This is where AppLocale come in, it allows you to run an application in a specific locale without messing around with the default system locale. Unfortunately, for no good reason Microsoft left an annoying message that kept reminds you about “AppLocale is just a temporary solution” whenever you launch AppLocale via shortcut.

So I made a patch to remove the nag. All you have to do is drop the patched AppLoc.exe into C:\Windows\AppPatch\AppLoc.exe and replace it.

Enjoy !


AppLoc.exe Patch
http://opcode0×90.googlecode.com/files/AppLoc.rar

h1

Some Correction

November 1, 2007

After switching to Code::Blocks, I then realize it is a bug of MinGW and not of Dev-C++’s. The same bugfix too applies to Code::Blocks only with a few difference in the user interface.

For Code::Blocks the directories can be found under Settings -> Compiler. (version 1.0 RC2) Just replace\Dev-Cpp\ with \CodeBlocks\.

After that just follow this link if you still having problem with Code::Blocks:
http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista

Hope I have clear things up.


Here is a snip that tell us why “ld: XXXXXX.o: No such file: No such file or directory” happens

Read the rest of this entry »

h1

wxDev-C++ problems

October 22, 2007

(Edit: 1 November 2007)
Found out this is a bug of MinGW, and has nothing to do with wxDev-C++ either.

Stumbled into wxDev-C++ problems today, as I tried to compile the template wxWidgets dialog. Refer to my last post about the same old bugs again, and here we got ourself a new problem.

Open up your Compile Log, and there it is:
windows.h: No such file or directory

Another configuration problem, eh? Go to Tools -> Compiler Options -> Directories -> Resource Includes, add this directory.
\Dev-Cpp\include

Problem solved. Hopefully there wont be any pesky config problem anymore. <_<

h1

MinGW bugs under Windows Vista

October 19, 2007

(Edit: 1 November 2007)
Found out this is a bug of MinGW, and has nothing to do with Dev-C++.

Recently I installed Dev-C++ under Windows Vista, but when I try to compile the template DLL, it gives the following error in compile log.

gcc.exe: installation problem, cannot exec `cc1′: No such file or directory

In Dev-C++, go to Tools -> Compiler Options -> Directories -> Binaries, add this following directory
\Dev-Cpp\libexec\gcc\mingw32\3.4.2

Compile the project again. Okay, now what?

ld: crt2.o: No such file: No such file or directory
ld: dllcrt2.o: No such file: No such file or directory
ld: crtbegin.o: No such file: No such file or directory
ld: crtend.o: No such file: No such file or directory
ld: cannot find -lgcc

(Update: 1 November 2007)
To workaround this errors, you need to do the following steps:

  1. Copy dllcrt2.o and crt2.o from \Dev-Cpp\lib to \MinGW\lib.
  2. Copy crtbegin.o and crtend.o from \Dev-Cpp\lib\gcc\mingw32\3.4.2 (version may vary depending on your mingw version) to \MinGW\lib.
  3. In Dev-C++, go to Tools -> Compiler Options -> Directories -> Libraries, add this following directory
    \Dev-Cpp\lib\gcc\mingw32\3.4.2
    (again, version may vary depending on your mingw version)

Compile your project, it should work now. Now I try to compile the C version, oh no more errors.

In file included from dllmain.c:3:
C:/Dev-Cpp/include/windows.h:47:20: stdarg.h: No such file or directory
In file included from C:/Dev-Cpp/include/winnt.h:37,
from C:/Dev-Cpp/include/windef.h:253,
from C:/Dev-Cpp/include/windows.h:48,
from dllmain.c:3:
C:/Dev-Cpp/include/string.h:24:20: stddef.h: No such file or directory
In file included from C:/Dev-Cpp/include/winnt.h:37,
from C:/Dev-Cpp/include/windef.h:253,
from C:/Dev-Cpp/include/windows.h:48,
from dllmain.c:3:

blah blah blah

Here’s the fix. In Dev-C++, go to Tools -> Compiler Options -> Directories -> C Includes, add this directory
\Dev-Cpp\lib\gcc\mingw32\3.4.2\include
(I dont want to repeat that again)

Okay now everything is working. Hopefully these should solve your problem regarding compiling with Dev-C++ under Windows Vista.

h1

crackme_nop – Full Solution by alex_ls

September 6, 2007

Been inactive for quite a while, real life stuff made my life real busy. Finally a little break to update this dying blog.

Few things to update. First, I decided to move to another file hosting as the old file hosting been down for a long time. (and their promise to move to new server results in lost of all my uploaded files. -_-”) Now all the uploaded files is located in easy-share.com. Some files is lost, as I dont have a copy in my hard drive. If you are interested with that project, let me know. I might consider to recode the whole thing.


Okay back to the topic. Finally someone who is really good (or probably have to much time to kill, lol j/k) solved my first crackme.Here is a snip of his solution. (only the hash/algorithm part) Read the rest of this entry »