This is part of a source code for an MSN client I'm writing:
Code:
int CALLBACK dlg_login(int hwndDlg, int Msg, int wParam, int lParam) {
int a,hinternet,hurl;
char b[4096];
char c[512];
char d[256];
char pploginurl[64];
switch(Msg) {
case WM_COMMAND:
switch(wParam) {
case 1: case 2:
case 1001:
EndDialog(hwndDlg,0);
break;
case 1000: /* login */
EnableWindow(GetDlgItem(hwndDlg,1002),0);
EnableWindow(GetDlgItem(hwndDlg,1003),0);
EnableWindow(GetDlgItem(hwndDlg,1000),0);
GetDlgItemText(hwndDlg,1002,&username,64);
GetDlgItemText(hwndDlg,1003,&password,16);
if((ns_ip=inet_addr(&ns_name))==-1) {
wsprintf(b,"Resolving %s...",ns_name);
Here's what REC21 thinks of the same code:
Code:
L004026d9(A8, Ac, A10, A14, A16)
struct HWND__ * A8; /* totally failed to identify local variables correctly */
/* unknown */ void Ac;
/* unknown */ void A10;
char * A14;
/* unknown */ void A16;
{
eax = 0x1340;
L00404DB0();
(save)ebx;
(save)esi;
(save)edi;
if(!(eax = Ac - 0x110)) {
if(!(eax = eax - 1)) { /* ... WTF? */
if(!(eax = eax - 32495)) {
if(eax = eax - 1) {
goto L00402f18;
}
eax = A14 >> 0x10;
A14 = eax;
== ? L00402744 : ; /* this is not even valid C */
...and here is the actual code for the two switch() cases above:
Code:
if(eax > 0) {
if(eax > 2) {
if(eax != 0x3e8) {
if(eax == 0x3e9) {
goto L00402ee1;
}
} else {
esi = __imp__GetDlgItem; /* it recognised this ... */
(save)ebx; /* ... this is supposed to be a parameter, so it resulted in */
EnableWindow(GetDlgItem(A8, 0x3ea)); /* ...WRONG number of parameters */
(save)ebx;
(save)0x3eb;
EnableWindow( *esi(), A8); /* ...then failed to see what esi is even though it recognised it above */
(save)ebx;
(save)0x3e8;
EnableWindow( *esi(), A8);
edi = A8;
GetDlgItemTextA(edi, 0x3ea, 4228736, 0x40);
GetDlgItemTextA(edi, 0x3eb, 4228256, 0x10);
esi = 0x40112c;
(save)0x40112c;
eax = L00404D4E();
M00408660 = eax;
if(eax == -1) {
wsprintfA(ebp + -4672, "Resolving %s...", esi); /* this is almost acceptable. */
SetDlgItemTextA(edi, 0x3ec, ebp + -4672);
(save)0x400;
(save)4228896;
(save)esi;
(save)32768;
(save)edi;
L00404D48();
} else {
SendMessageA(edi, 32768, ebx, ebx); /* Registers in function calls? I thought this was supposed to be C. */
}
- can't identify switch() properly
- function parameters are completely absent except for a few cases...
- ...same goes for register value retention within the same continous block
- code is laced with gotos even when there were no jumps in the Asm (?)
- lack of back/forward buttons.
For some reason Exe2c seems to pagefault with every EXE I give it...