Monday, May 26, 2008

Live cash back --- A game changer?

Microsoft Live Search cash back definitely has caught a lot of eyeballs. There are lots of discussions on the Internet, mostly, about how Microsoft is trying to buy in customers to use live search. However, look a little further behind the scene, we will see this is not just about another type of "rebate".
Google didn't invent search, they invented pay-per-click advertisement. This game changing invention has brought them billions and billions of dollars and will continue to be their cash cow for a while. While pay-per-click advertisement has significantly reduced the advertisement risk because you don't have to pay for a badly placed key work because people simply won't click them, it does not grantee that people who clicked the ad will eventually buy the product. this kind of risk can be eliminated by a new type of advertisement : pay-per-action.
Many websites have tried this idea before, some of them are actually very successful, http://rebate.com/ is an example. For most of them, the number one problem is still, search. Customers need to find their product first. So the first step of game is still search. Microsoft live search still need to improve search to get the chance to change the game. At this point, however, seems Google is still leading the game at a firm No.1 position.

Wednesday, April 23, 2008

pc/tc for gdb

It would be nice if we can have the equivalent of windbg's pc and tc command in gdb, well, here is how:

def pc

set $continue_flag = 1

ni

while($continue_flag)

set $opcode = *(unsigned char *)$pc

x/i $pc

if ((unsigned int)$opcode == 0xe8)

set $continue_flag = 0

else

ni

end

end

end


def tc

si

set $continue_flag = 1

while($continue_flag)

set $opcode = *(unsigned char *)$pc

x/i $pc

if ((unsigned int)$opcode == 0xe8)

set $continue_flag = 0

else

si

end

end

end

Friday, March 28, 2008

Wednesday, March 26, 2008

Looking for "strace" for windows?

This one is windows' equivalent of linux's strace:
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Sunday, March 9, 2008

System Call Argument Passing

X86:

Windows:
The system call number is passed in the EAX register, and the stack stores the caller arguments.

Linux:
http://manugarg.googlepages.com/systemcallinlinux2_6.html

X64:

Windows:
A system-call is done via the syscall instruction. Parameters are passed by %rcx,%rdx, %r8 and %r9, the rest are passed on stack.

Linux:
A system-call is done via the syscall instruction. Parameters are passed by %rdi,%rsi, %rdx, %r10, %r8 and %r9.The kernel destroys
registers %rcx and %r11.

Saturday, February 16, 2008

How to run CMD.exe as localsystem

sc create testsvc type= own binpath= "cmd /c start c:\debuggers\remote /s cmd localsys"
sc start testsvc
sc delete testsvc
[Windows_Debugging_Tools_Dir]\remote /c . localsys

Friday, February 15, 2008

How to trace function enter and exit


class FuncEnterExitTracer{
private:
LPCWSTR m_functionName;
public:
FuncEnterExitTracer(LPCWSTR functionName)
: m_functionName(functionName) {
TRACE(L"Entering: %s\n...", m_functionName);
}

~FuncEnterExitTracer() {
TRACE(L"Exiting: %s\n...", m_functionName);
}
};

#define TRACE_FUNC_ENTER_EXIT() FuncEnterExitTracer autoVariable (TEXT(__FUNCTION__))




Now in any function, you can use TRACE_FUNC_ENTER_EXIT(); to trace enter and exit:

void AnyFunc(int p1, ...)

{

TRACE_FUNC_ENTER_EXIT();

....................

}