예전에 썻던 글인데, 누가 reference 로 달아놨다.

http://portal.acm.org/citation.cfm?id=1368510

여기의 reference 중, 30번.

Rodream, One Possible Way to Avoid UAC in Windows Vista, 2007. http://www.rootkit.com/newsread.php?newsid=773

나도 ACM에 글을 얼른 실어야 할텐데!!
__global__ void incKernel(int *g_out, int *g_in, int N, int inner_reps)
00402070  push        ebp  
00402071  mov         ebp,esp 
00402073  mov         eax,dword ptr [__cuda_3] 
00402076  push        eax  
00402077  mov         ecx,dword ptr [__cuda_2] 
0040207A  push        ecx  
0040207B  mov         edx,dword ptr [__cuda_1] 
0040207E  push        edx  
0040207F  mov         eax,dword ptr [__cuda_0] 
00402082  push        eax  
00402083  call        __device_stub__Z9incKernelPiS_ii (401FE0h) 
00402088  add         esp,10h 
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if( idx < N ) {
        for( int i=0; i<inner_reps; ++i ) {        
            //g_out[idx] = g_in[idx] + 1;      
g_out[idx] = i+1;
        }
    }
}
0040208B  pop         ebp  
0040208C  ret              
You can see CUDA APIs' and explanations in the following site.

http://www.clear.rice.edu/comp422/resources/cuda/html/modules.html 
  1. rodream 2011.06.28 16:27 신고

    The memory allocated by CUDA API has isolated address just like a host memory in OS. In other words, each process has its own memory space and cannot be accessed by other process even if it is the device's memory.

WaitForSingleObject function is usually used to wait a response of another process or thread. Most common usage is like the following code.

WaitForSingleObject(object, INFINITE);

Although it is really simple and useful, it blocks all messages until the function returned. Therefore, the application using this function acts as if it is an unresponsive applcation like applications that are hangged.

Thus, I added a message pumping feature to the WaitForSingleObject API.
The function assumes that the user uses WaitForSingleObject function with INFINITE parameter. Since it supports the message pumping feature, it allows you to wait until the object signaled with very responsive user interface.

(I know that using thread is much better than this function. However, the problem is that thread is somewhat tedious work and sometimes managing thread just for very short code is quite burden for people)

void WaitForSingleObjectWithMsgPump(HANDLE hHandle)
{
DWORD dwRet;
DWORD dwFailedCnt = 0;
while(1) {
dwRet = WaitForSingleObject(hHandle, 1);
switch( dwRet ) {
case WAIT_TIMEOUT:
// not released - let it go
dwFailedCnt = 0;
break;
case WAIT_ABANDONED:
// released
return ;
break;
case WAIT_OBJECT_0:
// released
return ;
break;
case WAIT_FAILED:
// ? 
// if failed statues are repated over 5 times, 
// consider it as released
dwFailedCnt++;
if( dwFailedCnt > 4 ) {
return ;
}
break;
}

// pump message
PumpMsg();
Sleep(1);
}
}
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( pDC ) {
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
return hbr;
http://ref.x86asm.net/
  1. rodream 2011.01.30 01:47 신고

    I'm almost there!

  2. rodream 2011.01.30 03:56 신고

    I'm there!!! :D

  3. rodream 2011.01.31 15:21 신고

    Find What's the TLB trick?

  4. rodream 2011.06.25 23:22 신고

    TLB trick is the technique Shadow Walker implemented

1. Analyzing and writing some stubs related to a virtualization.
2. Planning to write articles about migrating legacy software for Windows7
3. Planning a seminar or articles for Visual Studio 2010(migration issues)

Hope we will meet soon in public!
집단으로
지랄하는
성가신것들
I am going to attend Global Summit 2011!

http://icerainbow.tistory.com/1125
http://icerainbow.tistory.com/1126
This is one of the most awesome software in the world!
'Simnow' is the software what I always dreamed and wanted to get.

It emulates huge ranges of machines including up-to-date features! 


+ Recent posts