Log in

View Full Version : State of a checkbox


javerleo
June 22nd, 2009, 12:49
Hello.

I'm aware a full understanding of dissasembling techniques is a long and painful process, but for now I just need to change the inital state of a checkbox on a compiled program. The checkbox starts as "unchecked" but I need it to be "checked". I'm starting using ollydbg and, as far as I understand, I need to find an API call to user32, maybe GetDlgItem/SendMessageA referencing the correct control ID (I think I can find the control ID with reshacker).
Even supposing I'm rigth so far, I don't Know how to make the changes I need.

Can anybody point me to the right direction? Maybe a URL with further info.

Thanks in advance.

Kayaker
June 22nd, 2009, 13:23
Quick driveby example:

SendDlgItemMessage (hDlg, IDC_CHECK, BM_SETCHECK, BST_CHECKED, 0);
SendDlgItemMessage (hDlg, IDC_CHECK, BM_SETCHECK, BST_UNCHECKED, 0);

You will of course need to read a windows header file to get the constants for the BM_, BST_ values.