dword

Cant make value propagate through carry

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Making a little C++ large precision class, and everything seems to work decent, but the add, if I add 0xffffffff and 0x04 together I get 0xffff0003 when I should get 0x0100000003. Here is the function with the issue: mpfl operator+(const mpfl &lhs, const mpfl &rhs) { unsigned long i; mpfl ret(0); mpfl trhs(rhs); for (i = lhs.nbytes; i >= 0; i--) { if ( (unsigned short)lhs.data[i].data + (unsigned short)trhs.data[i].data > (unsigned short)255 ) { if (i > 0) { ret.data[i].carry = 1; ret.data[0].carry = 0; } else { ret.data[0].carry = 1; } }

Get drive type with SetupDiGetDeviceRegistryProperty

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to know whether i can get the drive information using the SP_DEVICE_INTERFACE_DETAIL_DATA's DevicePath my device path looks like below "\?\usb#vid_04f2&pid_0111#5&39fe81e&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}" also please tell me in the winapi they say "To determine whether a drive is a USB-type drive, call SetupDiGetDeviceRegistryProperty and specify the SPDRP_REMOVAL_POLICY property." i too use SetupDiGetDeviceRegistryProperty like below while ( !SetupDiGetDeviceRegistryProperty( hDevInfo,&DeviceInfoData, SPDRP_REMOVAL

How to pass a method as callback to a Windows API call?

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to pass a method of a class as callback to a WinAPI function. Is this possible and if yes, how? Example case for setting a timer: TMyClass = class public procedure TimerProc(Wnd:HWND; uMsg:DWORD; idEvent:PDWORD; dwTime:DWORD); procedure DoIt; end; [...] procedure TMyClass.DoIt; begin SetTimer(0, 0, 8, @TimerProc); // Thanks for your help! Edit : The goal is to specify a method of this class as callback. No procedure outside the class. Edit2 : I appreciate all your help but as long as the method has no "TMyClass." in front of its

how to get google chrome web browser active tab's Url (vb6)

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i do not get the url from chrome Version29.because url control can not be found using spy++. Option Explicit Private Const WM_GETTEXT = &HD Private Const WM_GETTEXTLENGTH = &HE Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private

CrackMe练习――Afkayas.1

匿名 (未验证) 提交于 2019-12-03 00:43:02
第2个练习CrackMe。 系统:Windows 7 SP1 x64 ultimate 工具:PEiD、OllyDbg 拖入PEiD查壳,无壳,而且是VB写的。 运行程序。 用户名输入、序列号输入。 随意输入,看错误提示。 错误字符串 You Get Wrong \n Try Again 。 载入OD,搜索字符串便可以看到错误提示。 双击定位,在该地址上面还可以看到 You Get It ,看意思是正确的意思。 00402588 . 8945 B4 mov dword ptr ss:[ebp-0x4C],eax ; kernel32.BaseThreadInitThunk 0040258B . 74 58 je short Afkayas_.004025E5 0040258D . 68 801B4000 push Afkayas_.00401B80 ; You Get It 00402592 . 68 9C1B4000 push Afkayas_.00401B9C ; \r\n 00402597 . FFD7 call edi 00402599 . 8BD0 mov edx,eax ; kernel32.BaseThreadInitThunk 0040259B . 8D4D E8 lea ecx,dword ptr ss:[ebp-0x18] 0040259E . FFD3

BITMAPINFOHEADER 结构体

匿名 (未验证) 提交于 2019-12-03 00:39:02
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183376(v=vs.85).aspx The BITMAPINFOHEADER structure contains information about the dimensions and color format of a DIB. typedef struct tagBITMAPINFOHEADER { DWORD biSize; LONG biWidth; LONG biHeight; WORD biPlanes; WORD biBitCount; DWORD biCompression; DWORD biSizeImage; LONG biXPelsPerMeter; LONG biYPelsPerMeter; DWORD biClrUsed; DWORD biClrImportant; } BITMAPINFOHEADER, *PBITMAPINFOHEADER; Members biSize The number of bytes required by the structure. biWidth The width of the bitmap, in pixels. If biCompression is BI_JPEG or BI_PNG,

bat脚本导入cadence数据库

匿名 (未验证) 提交于 2019-12-03 00:37:01
注册表: Windows Registry Editor Version 5.00 [ HKEY_USERS\S - 1 - 5 - 21 - 4124586831 - 1997789383 - 970267334 - 5707 \Software\ODBC\ODBC . INI ] [ HKEY_USERS\S - 1 - 5 - 21 - 4124586831 - 1997789383 - 970267334 - 5707 \Software\ODBC\ODBC . INI\BenchAccess1660 ] "DBQ" = "C:\\Cadence\\SPB_16.6\\tools\\Capture\\Samples\\BENCH.MDB" "Driver" = "C:\\Windows\\odbcjt32.dll" "UID" = "NULL" "SafeTransactions" = dword : 00000000 "DriverId" = dword : 00000019 "FIL" = "MS Access;" "Description" = "Access sample database" [ HKEY_USERS\S - 1 - 5 - 21 - 4124586831 - 1997789383 - 970267334 - 5707 \Software\ODBC

windows下的IOCP

匿名 (未验证) 提交于 2019-12-03 00:34:01
对应Linux下的epoll,windows下也有实现IO复用的方法,那就是IOCP,又叫重叠IO,其实和异步IO没什么区别,《TCPIP网络编程》这本书也没有对重叠IP和异步IO做明确的区分。 首先,创建重叠IO的套接字。 SOKET WSAocket( int af, int type , int protocol , LPWSAPROTOCOL_INFO lpProtocolInfo , GROUP g , DWORD dwFlags ); 成功时返回套接字句柄,失败时返回INVALID_SOKET。 af 协议族信息 前三个参数和普通套接字一致,后三个分别为 lpProtocolInfo 包含创建的套接字信息的WSAPROTOCOL_INFO结构体变量地址值,不需要时传递NULL。 g 为扩展函数而预约的参数,可以使用0。 dwFlags 套接字属性信息。 执行重叠IO的WSASend函数 int WSASend(SOKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 1

c++的进程和线程【windows】

匿名 (未验证) 提交于 2019-12-03 00:30:01
DWORD WINAPI YourThreadFunc(LPVOID lpvThreadParm); void FunCount(PVOID arg) { while(1) { } } void Function1(PVOID arg) { while(1) { } } HANDLE CreateThread( //线程安全属性 //堆栈大小 //线程函数 //线程参数 //线程创建属性 //线程ID );    LPVOID lpvThreadParm,DWORD fdwCreate,LPDWORDlpIDThread); handle=(HANDLE)_beginthread(FunCount,0, NULL); handle1=(HANDLE)_beginthread(Function1,0,NULL); BOOL TerminateThread(HANDLE hThread, DWORD dwExitCode); DWORD ResumeThread(HANDLE hThread); DWORD SuspendThread(HANDLE hThread); [cpp] view plain copy #include<Windows.h> #include<iostream> #include<process.h> using namespace struct int

C++ 练习-多线程

匿名 (未验证) 提交于 2019-12-03 00:22:01
#if 0 //CreateThread代码示例 #include<iostream> #include<windows.h> using namespace std ; DWORD WINAPI ThreadFun(LPVOID lpThreadParameter) { char * str = ( char *)lpThreadParameter; while ( true ) { cout << "线程处理函数中接收到的参数是:" << str << endl; cout << "子线程ID: " << GetCurrentThreadId() << endl; Sleep( 1000 ); } return 0 ; } int main() { DWORD threadId = 0 ; HANDLE hThread = CreateThread( NULL, //设为NULL表示默认安全性 0 , //如果设为0,那么默认将使用与调用该函数的线程相同的栈空间大小 ThreadFun, //线程处理函数,函数名就是函数指针 "hello thread!" , //向线程函数传入的参数 0 , //0表示创建后马上运行 &threadId); if (hThread == NULL){ cout << "线程创建失败,ERROR CODE : " << GetLastError