摘自百度百科:

LanSet是LanStar的设置程序

界面:

逆它的原因是这个程序可以结束LanStar程序,我要获得这个方法。

什么是LanStar

LanStar 多媒体教学网络系统,是一套多媒体教学平台,包含影音广播,教学辅助,教学监控,系统管理四大工具群。用户可以透过LanStar 教学平台同时对数百位同学进行多媒体互动教学,从而大幅提高教学成效。

也就是我们学校至善楼xp机用的教学系统啦

找关键代码:

点登陆提示失败

一个信息框,多年来混迹黑暗领域的Cracker,嘴角露出了微笑......

很容易的找到了关键代码:

我把这个函数命名为g_test_password

.text:004054F0 ; int __thiscall g_test_password(CWnd *this)
.text:004054F0 g_test_password proc near               ; DATA XREF: .rdata:00407E04

来看下汇编代码:

.text:004054F0 ; int __thiscall g_test_password(CWnd *this)
.text:004054F0 g_test_password proc near               ; DATA XREF: .rdata:00407E04
.text:004054F0                 push    esi
.text:004054F1                 mov     esi, ecx
.text:004054F3                 push    1               ; int
.text:004054F5                 call    ?UpdateData@CWnd@@QAEHH@Z ; 控件内容装入控件变量
.text:004054FA                 mov     eax, [esi+68h]  ; 比较字符串,一个是我们输入的,那么这个是什么?你猜
.text:004054FD                 mov     ecx, [esi+60h]  ; 我们输入的内容
.text:00405500                 push    eax             ; unsigned __int8 *push 正确密码lanstar
.text:00405501                 push    ecx             ; unsigned __int8 *push 我们输入的密码
.text:00405502                 call    ds:_mbscmp       ;call strcmp
.text:00405508                 add     esp, 8       ;esp + 8
.text:0040550B                 test    eax, eax        ; strcmp返回结果 相同=0 否则!=0
.text:0040550D                 jz      short loc_40555A ; 根据结果决定是否跳 相同就跳走 跳走正确 否则出错
.text:0040550F                 push    0FFFFFFFFh      ; unsigned int
.text:00405511                 push    10h             ; unsigned int
.text:00405513                 push    801Fh           ; unsigned int
.text:00405518                 call    ?AfxMessageBox@@YGHIII@Z ; 弹错误框啦
.text:0040551D                 mov     cl, [esi+64h]
.text:00405520                 inc     cl
.text:00405522                 mov     al, cl
.text:00405524                 mov     [esi+64h], cl
.text:00405527                 cmp     al, 2
.text:00405529                 jbe     short loc_405545
.text:0040552B                 push    0FFFFFFFFh      ; unsigned int
.text:0040552D                 push    10h             ; unsigned int
.text:0040552F                 push    8020h           ; unsigned int
.text:00405534                 call    ?AfxMessageBox@@YGHIII@Z ; 也弹错误框 这个带路径的
.text:00405539                 mov     eax, [esi]
.text:0040553B                 mov     ecx, esi
.text:0040553D                 call    dword ptr [eax+0D0h]
.text:00405543                 pop     esi
.text:00405544                 retn
.text:00405545 ; ---------------------------------------------------------------------------
.text:00405545
.text:00405545 loc_405545:                             ; CODE XREF: g_test_password+39j
.text:00405545                 push    408h            ; int
.text:0040554A                 mov     ecx, esi        ; this
.text:0040554C                 call    ?GetDlgItem@CWnd@@QBEPAV1@H@Z ; CWnd::GetDlgItem(int)
.text:00405551                 mov     ecx, eax        ; this
.text:00405553                 call    ?SetFocus@CWnd@@QAEPAV1@XZ ; CWnd::SetFocus(void)
.text:00405558                 pop     esi
.text:00405559                 retn
.text:0040555A ; ---------------------------------------------------------------------------
.text:0040555A//跳到这就成功啦
.text:0040555A loc_40555A:                             ; CODE XREF: g_test_password+1Dj
.text:0040555A                 mov     ecx, esi        ; this
.text:0040555C                 call    ?OnOK@CDialog@@MAEXXZ ; 返回ok
.text:00405561                 pop     esi
.text:00405562                 retn
.text:00405562 g_test_password endp

这个函数的做的事情就是把用户输入的密码跟“lanstar”比较 相同就通过 否则~

伪代码:

void __thiscall g_test_password(CWnd *this)
{CWnd *m_Cw_edit; //用于记录输入框控件对象//int m_error_count = 0;//这个是成员变量 记录出错次数CWnd::UpdateData(this, 1);if(mbscmp("lanstar",m_input_user)){AfxMessageBox("密码错误!");m_error_count ++;if(m_error_count  <= 2){m_Cw_edit = CWnd::GetDlgItem(this, 1032);//1032应该是输入框的控件IDCWnd::SetFocus(m_Cw_edit);//设置焦点}else{AfxMessageBox("连续3次输入错误 ! 程序即将退出!");ExitProcess(0);}}else{CDialog::OnOK(this);}
}

下面是找第二个界面中的确定键干了什么

这个键下面有我想要的信息,它怎么结束lanstar的

找关键代码:

看到界面上这么多输入控件,多年来混迹黑暗领域的Cracker,嘴角露出了微笑......

我把这个函数命名为g_set_config

.text:00403C20 ; int __thiscall g_set_config(CWnd *this)
.text:00403C20 g_set_config    proc near               ; DATA XREF: .rdata:00407B64o
.text:00403C20

来看下汇编代码:

中间有一部分都在写注册表 就省略了

.text:00403C20 ; int __thiscall g_set_config(CWnd *this)
.text:00403C20 g_set_config    proc near               ; DATA XREF: .rdata:00407B64o
.text:00403C20
.text:00403C20 phkResult       = dword ptr -430h
.text:00403C20 var_42C         = dword ptr -42Ch
.text:00403C20 var_428         = dword ptr -428h
.text:00403C20 lpWindowName    = dword ptr -424h
.text:00403C20 Data            = byte ptr -420h
.text:00403C20 in              = in_addr ptr -41Ch
.text:00403C20 Drive           = byte ptr -418h
.text:00403C20 var_414         = byte ptr -414h
.text:00403C20 Filename        = byte ptr -410h
.text:00403C20 Dir             = byte ptr -30Ch
.text:00403C20 Ext             = byte ptr -20Ch
.text:00403C20 var_10C         = byte ptr -10Ch
.text:00403C20 var_C           = dword ptr -0Ch
.text:00403C20 var_4           = dword ptr -4
.text:00403C20
.text:00403C20                 push    0FFFFFFFFh
.text:00403C22                 push    offset SEH_403C20
.text:00403C27                 mov     eax, large fs:0
.text:00403C2D                 push    eax
.text:00403C2E                 mov     large fs:0, esp
.text:00403C35                 sub     esp, 424h
.text:00403C3B                 push    ebx
.text:00403C3C                 push    ebp
.text:00403C3D                 mov     ebp, 1
.text:00403C42                 push    esi
.text:00403C43                 mov     esi, ecx
.text:00403C45                 push    ebp             ; int
.text:00403C46                 call    ?UpdateData@CWnd@@QAEHH@Z ; 更新内容到变量
.text:00403C4B                 lea     ecx, [esp+43Ch+var_428]
.text:00403C4F                 call    ??0CString@@QAE@XZ ; 初始化一个空的cstring
.text:00403C54                 lea     ecx, [esp+43Ch+var_42C]
.text:00403C58                 mov     [esp+43Ch+var_4], 0
.text:00403C63                 call    ??0CString@@QAE@XZ ; CString::CString(void)
.text:00403C68                 push    66h             ; unsigned int
.text:00403C6A                 lea     ecx, [esp+440h+var_42C] ; this
.text:00403C6E                 mov     byte ptr [esp+440h+var_4], 1
.text:00403C76                 call    ?LoadStringA@CString@@QAEHI@Z ; CString::LoadStringA(uint)
.text:00403C7B                 mov     eax, [esi+12Ch]
.text:00403C81                 mov     ebx, ds:_mbscmp ; 获得mbscmp地址?
.text:00403C87                 cmp     eax, ebp
.text:00403C89                 jnz     short loc_403CD0 ; 地址不对就跳走
.text:00403C8B                 mov     eax, [esi+128h] ; 指定ip字符串 另外一个字符串为空
.text:00403C91                 push    offset byte_40A898 ; unsigned __int8 *
.text:00403C96                 push    eax             ; unsigned __int8 *
.text:00403C97                 call    ebx ; _mbscmp   ; 判断指定ip是否为空
.text:00403C99                 add     esp, 8
.text:00403C9C                 test    eax, eax        ; 相同为0 否则 !=0
.text:00403C9E                 jnz     short loc_403CD0 ; 指定ip字符串不为空 跳走
.text:00403CA0                 push    67h             ; unsigned int
.text:00403CA2                 lea     ecx, [esp+440h+var_428] ; this
.text:00403CA6                 call    ?LoadStringA@CString@@QAEHI@Z ; CString::LoadStringA(uint)
.text:00403CAB                 mov     eax, [esp+43Ch+var_428] ; ip地址不能为空
.text:00403CAF                 push    30h             ; unsigned int
.text:00403CB1                 push    0               ; char *
.text:00403CB3                 push    eax             ; char *
.text:00403CB4                 mov     ecx, esi        ; this
.text:00403CB6                 call    ?MessageBoxA@CWnd@@QAEHPBD0I@Z ; 弹框 ip地址不能为空
.text:00403CBB                 push    3FDh            ; int
.text:00403CC0                 mov     ecx, esi        ; this
.text:00403CC2                 call    ?GetDlgItem@CWnd@@QBEPAV1@H@Z ; 获取指定ip输入框对象
.text:00403CC7                 mov     ecx, eax        ; this
.text:00403CC9                 call    ?SetFocus@CWnd@@QAEPAV1@XZ ; 设置焦点
.text:00403CCE                 jmp     short loc_403CF0 ; jmp end~
.text:00403CD0 ; ---------------------------------------------------------------------------
.text:00403CD0
.text:00403CD0 loc_403CD0:                             ; CODE XREF: g_set_config+69j
.text:00403CD0                                         ; g_set_config+7Ej
.text:00403CD0                 lea     ecx, [esp+43Ch+phkResult]
.text:00403CD4                 push    ecx             ; pHandle
.text:00403CD5                 push    2001Fh          ; Access = KEY_QUERY_VALUE|KEY_SET_VALUE|KEY_CREATE_SUB_KEY|KEY_ENUMERATE_SUB_KEYS|KEY_NOTIFT|20000
.text:00403CDA                 push    0               ; 0
.text:00403CDC                 push    offset SubKey   ; "SOFTWARE\\GoldenSoft\\LanStar 2000 VC\\Client"
.text:00403CE1                 push    80000002h       ; HKEY_LOCAL_MACHINE
.text:00403CE6                 call    ds:RegOpenKeyExA
.text:00403CEC                 test    eax, eax        ; 返回0成功 否则失败
.text:00403CEE                 jz      short loc_403D1A ; 0则跳 否则结束
.text:00403CF0
.text:00403CF0 loc_403CF0:                             ; CODE XREF: g_set_config+AEj
.text:00403CF0                 lea     ecx, [esp+43Ch+var_42C] ; this
.text:00403CF4                 mov     byte ptr [esp+43Ch+var_4], 0
.text:00403CFC                 call    ??1CString@@QAE@XZ ; CString::~CString(void)
.text:00403D01                 lea     ecx, [esp+43Ch+var_428] ; this
.text:00403D05                 mov     [esp+43Ch+var_4], 0FFFFFFFFh
.text:00403D10                 call    ??1CString@@QAE@XZ ; CString::~CString(void)
.text:00403D15                 jmp     loc_404224
.text:00403D1A ; ---------------------------------------------------------------------------
.text:00403D1A
.text:00403D1A loc_403D1A:                             ; CODE XREF: g_set_config+CEj
.text:00403D1A                 mov     eax, [esi+12Ch] ; 无用数据
.text:00403D20                 mov     ecx, [esp+43Ch+phkResult] ; 获取hkey
.text:00403D24                 xor     edx, edx
.text:00403D26                 push    edi
.text:00403D27                 mov     edi, ds:RegSetValueExA ; 获取设置注册函数地址
.text:00403D2D                 push    4               ; 数据大小4
.text:00403D2F                 test    eax, eax
.text:00403D31                 lea     eax, [esp+444h+Data]
.text:00403D35                 push    eax             ; 数据
.text:00403D36                 push    4               ; 数据类型4 REG_DWORD
.text:00403D38                 push    0               ; 常年为0
.text:00403D3A                 push    offset ValueName ; "AutoLogin"
.text:00403D3F                 setz    dl
.text:00403D42                 push    ecx             ; hKey
.text:00403D43                 mov     dword ptr [esp+458h+Data], edx
.text:00403D47                 call    edi ; RegSetValueExA ; 设置注册表 在上面得到的那边路径中应该有一项Autologin 类型为整型 将它设为0
.text:00403D49                 cmp     [esi+12Ch], ebp ; 如果ip格式不对?
.text:00403D4F                 jnz     short loc_403D7B ; 跳走 将ip地址对应的十六进制赋0
.text:00403D51                 lea     ebp, [esi+128h]
.text:00403D57                 push    100h            ; int
.text:00403D5C                 mov     ecx, ebp        ; this
.text:00403D5E                 call    ?GetBuffer@CString@@QAEPADH@Z ; CString::GetBuffer(int)
.text:00403D63                 push    eax             ; 指定ip地址字符串192.168.1.1
.text:00403D64                 call    ds:inet_addr    ; 转到到十六进制
.text:00403D6A                 push    0FFFFFFFFh      ; int
.text:00403D6C                 mov     ecx, ebp        ; this
.text:00403D6E                 mov     [esi+168h], eax ; 0x0101a8c0
.text:00403D74                 call    ?ReleaseBuffer@CString@@QAEXH@Z ; CString::ReleaseBuffer(int)
.text:00403D79                 jmp     short loc_403D85
.text:00403D7B ; ---------------------------------------------------------------------------
.text:00403D7B
.text:00403D7B loc_403D7B:                             ; CODE XREF: g_set_config+12Fj
.text:00403D7B                 mov     dword ptr [esi+168h], 0 ; 将ip地址对应的十六进制赋0
.text:00403D85
.text:00403D85 loc_403D85:                             ; CODE XREF: g_set_config+159j
.text:00403D85                 mov     eax, [esi+130h]
.text:00403D8B                 lea     ebp, [esi+130h]
.text:00403D91                 mov     edx, [esp+440h+phkResult]
.text:00403D95                 dec     eax
.text:00403D96                 mov     [ebp+0], eax
.text:00403D99                 lea     eax, [esi+168h]
.text:00403D9F                 push    4               ; cbData
.text:00403DA1                 push    eax             ; lpData
.text:00403DA2                 push    4               ; dwType
.text:00403DA4                 push    0               ; Reserved
.text:00403DA6                 push    offset aTeacherip ; "TeacherIP"
.text:00403DAB                 push    edx             ; hKey
.text:00403DAC                 call    edi ; RegSetValueExA
.text:00403DAE                 mov     eax, [esp+440h+phkResult]
.text:00403DB2                 push    4               ; cbData
.text:00403DB4                 push    ebp             ; lpData
.text:00403DB5                 push    4               ; dwType
.text:00403DB7                 push    0               ; Reserved
.text:00403DB9                 push    offset aCommindex ; "CommIndex"
.text:00403DBE                 push    eax             ; hKey
.text:00403DBF                 call    edi ; RegSetValueExA
.text:00403DC1                 mov     eax, [esi+154h]
.text:00403DC7                 lea     edx, [esp+440h+var_414]
.text:00403DCB                 push    4               ; cbData
.text:00403DCD                 push    edx             ; lpData
.text:00403DCE                 lea     eax, [eax+eax*4]
.text:00403DD1                 push    4               ; dwType
.text:00403DD3                 push    0               ; Reserved
.text:00403DD5                 push    offset aBeginsleep ; "BeginSleep"
.text:00403DDA                 lea     eax, [eax+eax*4]
.text:00403DDD                 lea     ecx, [eax+eax*4]
.text:00403DE0                 mov     eax, [esp+454h+phkResult]
.text:00403DE4                 shl     ecx, 3
.text:00403DE7                 push    eax             ; hKey
.text:00403DE8                 mov     dword ptr [esp+458h+var_414], ecx
.text:00403DEC                 call    edi ; RegSetValueExA
///
大量相同代码
///
.text:0040401E                 mov     eax, [esp+440h+phkResult]
.text:00404022                 mov     ecx, [esi+60h]
.text:00404025                 lea     edx, [esp+440h+Data]
.text:00404029                 push    4               ; cbData
.text:0040402B                 push    edx             ; lpData
.text:0040402C                 push    4               ; dwType
.text:0040402E                 push    0               ; Reserved
.text:00404030                 push    offset aCaudiorender ; "CaudioRender"
.text:00404035                 push    eax             ; hKey
.text:00404036                 mov     dword ptr [esp+458h+Data], ecx
.text:0040403A                 call    edi ; RegSetValueExA
.text:0040403C                 mov     ecx, [esp+440h+phkResult]
.text:00404040                 mov     ebx, ds:RegCloseKey
.text:00404046                 push    ecx             ; hKey
.text:00404047                 call    ebx ; RegCloseKey
.text:00404049                 lea     edx, [esp+440h+phkResult]
.text:0040404D                 push    edx             ; phkResult
.text:0040404E                 push    20019h          ; samDesired
.text:00404053                 push    0               ; ulOptions
.text:00404055                 push    offset aSoftwareGold_0 ; "SOFTWARE\\GoldenSoft\\LanStar Settings"
.text:0040405A                 push    80000002h       ; hKey
.text:0040405F                 call    ds:RegOpenKeyExA
.text:00404065                 mov     ecx, [esp+440h+phkResult]
.text:00404069                 lea     eax, [esi+150h]
.text:0040406F                 push    4               ; cbData
.text:00404071                 push    eax             ; lpData
.text:00404072                 push    4               ; dwType
.text:00404074                 push    0               ; Reserved
.text:00404076                 push    offset aSoundrender ; "SoundRender"
.text:0040407B                 push    ecx             ; hKey
.text:0040407C                 call    edi ; RegSetValueExA
.text:0040407E                 mov     edx, [esp+440h+phkResult]
.text:00404082                 push    edx             ; hKey
.text:00404083                 call    ebx ; RegCloseKey
.text:00404085                 mov     eax, [esi+0C8h]
.text:0040408B                 mov     edi, ds:SendMessageA
.text:00404091                 push    0               ; lParam
.text:00404093                 push    0               ; wParam
.text:00404095                 push    147h            ; Msg
.text:0040409A                 push    eax             ; hWnd
.text:0040409B                 call    edi ; SendMessageA
.text:0040409D                 mov     ecx, [esi+0C8h]
.text:004040A3                 push    0               ; lParam
.text:004040A5                 push    eax             ; wParam
.text:004040A6                 push    150h            ; Msg
.text:004040AB                 push    ecx             ; hWnd
.text:004040AC                 call    edi ; SendMessageA
.text:004040AE                 cmp     eax, 0FFFFFFFFh
.text:004040B1                 mov     dword ptr [esp+440h+in.S_un], eax
.text:004040B5                 jnz     short loc_4040C5
.text:004040B7                 lea     edx, [esp+440h+in]
.text:004040BB                 push    0
.text:004040BD                 push    edx
.text:004040BE                 mov     ecx, esi
.text:004040C0                 call    sub_405230
.text:004040C5
.text:004040C5 loc_4040C5:                             ; CODE XREF: g_set_config+495j
.text:004040C5                 mov     eax, dword ptr [esp+440h+in.S_un]
.text:004040C9                 push    eax             ; in
.text:004040CA                 call    ds:inet_ntoa
.text:004040D0                 mov     edx, eax
.text:004040D2                 or      ecx, 0FFFFFFFFh
.text:004040D5                 mov     edi, edx
.text:004040D7                 xor     eax, eax
.text:004040D9                 repne scasb
.text:004040DB                 not     ecx
.text:004040DD                 dec     ecx
.text:004040DE                 push    ecx
.text:004040DF                 push    edx             ; 本机IP
.text:004040E0                 push    offset aHostip  ; "HostIP"
.text:004040E5                 push    offset aSoftwareGold_0 ; "SOFTWARE\\GoldenSoft\\LanStar Settings"
.text:004040EA                 push    80000002h
.text:004040EF                 call    ds:RegWriteString ; 也是写键的一种方法
.text:004040F5                 mov     eax, [esi+160h]
.text:004040FB                 add     esp, 14h
.text:004040FE                 test    eax, eax
.text:00404100                 jz      loc_4041F7      ; 没写入成功就跳走
.text:00404106                 lea     ecx, [esp+440h+lpWindowName]
.text:0040410A                 call    ??0CString@@QAE@XZ ; CString::CString(void)
.text:0040410F                 push    73h             ; unsigned int
.text:00404111                 lea     ecx, [esp+444h+lpWindowName] ; this
.text:00404115                 mov     byte ptr [esp+444h+var_4], 2
.text:0040411D                 call    ?LoadStringA@CString@@QAEHI@Z ; CString::LoadStringA(uint)
.text:00404122                 mov     ecx, [esp+440h+lpWindowName]
.text:00404126                 push    ecx             ; LanStar 21st Version 5.0
.text:00404127                 push    0               ; lpClassName
.text:00404129                 call    ds:FindWindowA  ; 找有没有这个窗口 找学生端程序
.text:0040412F                 test    eax, eax
.text:00404131                 jz      loc_4041E6      ; 没找到 跳走结束
.text:00404137                 push    0               ; lParam
.text:00404139                 push    0               ; wParam
.text:0040413B                 push    4E6h            ; 关键所在向lanstar发送0x4e6消息 0x4e6消息在windows里面是没有定义的 最大0x400,那这个就是自定义消息 干什么的 很明确了
.text:00404140                 push    eax             ; hWnd
.text:00404141                 call    ds:PostMessageA
.text:00404147                 push    0               ; int
.text:00404149                 mov     ecx, esi        ; this
.text:0040414B                 call    ?ShowWindow@CWnd@@QAEHH@Z ; CWnd::ShowWindow(int)
.text:00404150                 push    0BB8h           ; dwMilliseconds
.text:00404155                 call    ds:Sleep        ; 等待0xbb8毫秒
.text:0040415B                 call    ?AfxGetModuleState@@YGPAVAFX_MODULE_STATE@@XZ ; AfxGetModuleState(void)
.text:00404160                 mov     eax, [eax+8]
.text:00404163                 lea     edx, [esp+440h+Filename]
.text:00404167                 push    104h            ; nSize
.text:0040416C                 push    edx             ; lpFilename
.text:0040416D                 push    eax             ; hModule
.text:0040416E                 call    ds:GetModuleFileNameA ; 获得当前进程路径
.text:00404174                 lea     eax, [esp+440h+Ext]
.text:0040417B                 lea     ecx, [esp+440h+var_10C]
.text:00404182                 push    eax             ; Ext
.text:00404183                 lea     edx, [esp+444h+Dir]
.text:0040418A                 push    ecx             ; Filename
.text:0040418B                 lea     eax, [esp+448h+Drive]
.text:0040418F                 push    edx             ; Dir
.text:00404190                 lea     ecx, [esp+44Ch+Filename]
.text:00404194                 push    eax             ; Drive
.text:00404195                 push    ecx             ; FullPath
.text:00404196                 call    ds:_splitpath   ; 分解一个路径 可以的到后缀名 文件名,目录,分区,完整路径
.text:0040419C                 mov     ecx, 41h
.text:004041A1                 xor     eax, eax
.text:004041A3                 lea     edi, [esp+454h+Filename]
.text:004041A7                 push    offset Ext      ; "exe"
.text:004041AC                 rep stosd
.text:004041AE                 lea     edx, [esp+458h+Dir]
.text:004041B5                 push    offset Filename ; "lanclt"
.text:004041BA                 lea     eax, [esp+45Ch+Drive]
.text:004041BE                 push    edx             ; Dir
.text:004041BF                 lea     ecx, [esp+460h+Filename]
.text:004041C3                 push    eax             ; Drive
.text:004041C4                 push    ecx             ; Path
.text:004041C5                 call    ds:_makepath    ; 组成一个完整路径 上面的代码将路径的文件名改为了lanstar
.text:004041CB                 add     esp, 28h
.text:004041CE                 lea     edx, [esp+440h+Filename]
.text:004041D2                 push    5               ; nShowCmd
.text:004041D4                 push    0               ; lpDirectory
.text:004041D6                 push    0               ; lpParameters
.text:004041D8                 push    edx             ; 也就是C:\Program Files\GoldenSoft\LanStar 8.0\lanclt.exe
.text:004041D9                 push    offset Operation ; "open"
.text:004041DE                 push    0               ; hwnd
.text:004041E0                 call    ds:ShellExecuteA ; 执行这个程序 下面就是释放一些资源
.text:004041E6
.text:004041E6 loc_4041E6:                             ; CODE XREF: g_set_config+511j
.text:004041E6                 lea     ecx, [esp+440h+lpWindowName] ; this
.text:004041EA                 mov     byte ptr [esp+440h+var_4], 1
.text:004041F2                 call    ??1CString@@QAE@XZ ; CString::~CString(void)
.text:004041F7
.text:004041F7 loc_4041F7:                             ; CODE XREF: g_set_config+4E0j
.text:004041F7                 mov     ecx, esi        ; this
.text:004041F9                 call    ?OnOK@CDialog@@MAEXXZ ; CDialog::OnOK(void)
.text:004041FE                 lea     ecx, [esp+440h+var_42C] ; this
.text:00404202                 mov     byte ptr [esp+440h+var_4], 0
.text:0040420A                 call    ??1CString@@QAE@XZ ; CString::~CString(void)
.text:0040420F                 lea     ecx, [esp+440h+var_428] ; this
.text:00404213                 mov     [esp+440h+var_4], 0FFFFFFFFh
.text:0040421E                 call    ??1CString@@QAE@XZ ; CString::~CString(void)
.text:00404223                 pop     edi
.text:00404224
.text:00404224 loc_404224:                             ; CODE XREF: g_set_config+F5j
.text:00404224                 mov     ecx, [esp+43Ch+var_C]
.text:0040422B                 pop     esi
.text:0040422C                 pop     ebp
.text:0040422D                 pop     ebx
.text:0040422E                 mov     large fs:0, ecx
.text:00404235                 add     esp, 430h
.text:0040423B                 retn
.text:0040423B g_set_config    endp

1.做的事情是将用户输入的信息写入注册表

2.向学生端发送一个0x4e6自定义消息关闭它

3.执行学生端(使配置生效)

伪代码:

int __thiscall g_set_config(CWnd *this)
{CWnd::UpdateData(this, 1);//说下m_auto_login 这个用于保存是否自动登录 //不知道写这个代码的人怎么想的,为1是 指定ip地址登录 不太好理解if ( m_auto_login == 1 && !mbscmp(m_student_ip, "") )//如果 是指定ip登陆 但 ip地址为空 出错{AfxMessageBox("ip地址不能为空!")CWnd* m_edit_sdt_ip = CWnd::GetDlgItem(this, 1021);//1021应该是指定ip地址框的控件IDCWnd::SetFocus(m_edit_sdt_ip);//设置焦点return 0;}if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\GoldenSoft\\LanStar 2000 VC\\Client" ,0,KEY_QUERY_VALUE|KEY_SET_VALUE|KEY_CREATE_SUB_KEY|KEY_ENUMERATE_SUB_KEYS|KEY_NOTIFT|20000, &phkResult) ){//如果打开失败 直接返回return 0;}//注册表中的AutoLogin项记录了是自动登录还是指定ip登录//这里是写入这个值Data = m_auto_login ;RegSetValueExA(phkResult, "AutoLogin" 0, 4, Data, 4);//如果是指定IP地址登陆 将内容转换为十六进制 否则为0if ( m_auto_login == 1 ){CWnd *tmp_ed_sdt_ip = CString::GetBuffer((CWnd *)(m_edit_sdt_ip), 256);//m_dw_student_ip是用于保存指定ip地址转换后的十六进制m_dw_student_ip = inet_addr(tmp_ed_sdt_ip);}else{m_dw_student_ip = 0;}RegSetValueExA(phkResult, "TeacherIp", 0, 4,m_dw_student_ip, 4);RegSetValueExA(phkResult, "CommIndex", 0, 4, 0, 4);RegSetValueExA(phkResult, "BeginSleep", 0, 4, 0, 4);//...........................................................//...........省略大量相同代码................//...........................................................//获取Combo Box 当前选中列  CB_GETCURSEL 147DWORD cm_cur_sel = SendMessageA(m_CommboBox_host, 0x147, 0, 0);//CB_GETITEMDATA 150 //获取列表项的附加数据DWORD host_ip = (struct in_addr)SendMessageA(m_CommboBox_host, 0x150, cm_cur_sel , 0);if ( host_ip == -1 )//Combo Box没有选中 就由程序自己获取本机IP{GetHostIp(&host_ip, 0);//这个未实现,功能是获取本机IP地址}CString str_host_ip = inet_ntoa(host_ip);RegWriteString(0x80000002, "SOFTWARE\\GoldenSoft\\LanStar Settings", "HostIp", str_host_ip, strlen(str_host_ip));if ( UnKnow )//这个判断暂时不清楚,不过常年为1{DWORD hwnd_lanstar = FindWindowA(0, "LanStar 21st Version 5.0");if ( hwnd_lanstar  ){//先关闭学生端//关键所在:向lanstar.exe发送0x4e6消息 0x4e6消息在windows里面是没有定义的 最大0x400,那这个就是自定义消息 干什么的 很明确了PostMessageA(hwnd_lanstar , 0x4E6, 0, 0);CWnd::ShowWindow(this, 0);Sleep(3000);//获取当前路径  C:\Program Files\GoldenSoft\LanStar 8.0\LanSet.exeCWnd* m_pModuleState = AfxGetModuleState();GetModuleFileNameA(*((HMODULE *)m_pModuleState + 2), &Filename, 0x104);//拼接C:\Program Files\GoldenSoft\LanStar 8.0\lanclt.exesplitpath(&Filename, &Drive, &Dir, &v42, &Ext);memset(&Filename, 0, 0x104);//得到C:\Program Files\GoldenSoft\LanStar 8.0\lanclt.exemakepath(&Filename, &Drive, &Dir, ::Filename, ::Ext);//执行C:\Program Files\GoldenSoft\LanStar 8.0\lanclt.exeShellExecuteA(0, Operation, &Filename, 0, 0, 5);}}return CDialog::OnOK(this);
}

这个学生端关闭的方法太多

我本计划使用一些进程保护的方法来保护它,现在看来,得增加一些措施了.

菊花太大啊~~~

#include <stdio.h>
#include <Windows.h>void main()
{//LanStar 21st Version 5.0HWND hwnd = FindWindowA(NULL,"LanStar 21st Version 5.0");if(hwnd){printf("input any key kill LanStar!\n");getchar();PostMessageA(hwnd,0x4e6,0,0);printf("Kill LanStar Success!\n");Sleep(1000);}else{printf("No_Found_LanStar!\n");getchar();}
}

这么一来 也可以使用消息洪水攻击...哎

逆---LanSet.exe相关推荐

  1. 蓝帽杯2021初赛 writeup+赛后复现(misc123+pwn2+web1)

    蓝帽越来越离谱 争分夺秒,101分排到前70 Ball_sigin + slient + 冬奥会_is_coming + 复现I_will_but_not_quite + 根据T佬复现嫌疑人x的硬盘整 ...

  2. 八、逆波兰计算器的分析与实现

    逆波兰计算器的分析与实现 一.案例 1.输入一个逆波兰表达式(后缀表达式),使用栈(Stack), 计算其结果 2.例如: (3+4)×5-6 对应的后缀表达式就是 3 4 + 5 × 6 - , 针 ...

  3. python程序打包成exe可执行文件,亲测可行(pyinstaller教程)

    python程序打包成exe可执行文件,亲测可行(pyinstaller教程)(11-20190214) 文章目录: 有些程序你不想让别人看到,由此程序你想做成绿色软件普惠大众,有些..., 然而你只 ...

  4. Http Server : 一个差生的逆袭

    我刚毕业那会儿,国家还是包分配工作的, 我的死党小明被分配到了一个叫数据库的大城市,天天都可以坐在高端大气上档次的机房里, 在那里专门执行SQL查询优化 , 工作稳定又舒适: 隔壁宿舍的小白被送到了编 ...

  5. 运维如何逆袭?月薪30K的牛逼运维需要的知识,全在这里了

    上次写了运维,反响很大,我的粉丝是不是都喜欢看这种逆袭的故事? 运维工程师是从一个呆逼进化为苦逼再成长为牛逼的过程,干的好,月薪30K没有问题,干得不好,删库跑路也可以理解.前提在于你要能忍能干能拼, ...

  6. 小O地图EXE版V0.9.5.5 - 功能总览

    小O地图EXE版功能总览 小O地图EXE版主要提供地理数据处理.地图数据搜索.地理分析.地理计算.地图可视化等功能. 以地图任务形式执行,遵循以下步骤: 1.新建任务,设置任务条件及保存路径,任务文件 ...

  7. python计算机器人运动学分析_V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)...

    机器人运动学逆解的问题经常出现在动画仿真和工业机器人的轨迹规划中:We want to know how the upper joints of the hierarchy would rotate ...

  8. 数组逆序重放c语言,计算概论(A)/基础编程练习2(8题)/6:数组逆序重放

    #include int main() { // 输入n个整数 int n,array[n],count=-; scanf("%d", &n); // 循环读入元素 whi ...

  9. 木马逆名欺骗:利用unicode控制符RLO

    逆名欺骗木马在文件名中插入控RLO制符,来使文件名逆序显示,达到欺骗的目的. 首先Windows系统在解析文件名时,当遇到unicode控制符时,会改变文件名的显示方式.利用这一特性,可以将exe,s ...

最新文章

  1. Firefox 与 IE 已死?Chrome 一统天下!
  2. 特斯拉 model3 没有信号_Model 3在北京失控撞人,特斯拉:未发现任何系统故障
  3. Repository模式与UnitOfWorks模式的运用
  4. Taro+react开发(15)--对应文件编译
  5. java 创建线程的三种方法_java 创建线程的几种方式
  6. 阿里为什么禁用Executors创建线程池?
  7. Web应用运行在pywebview在窗口
  8. AMD 证实停止向中国提供 x86 新技术授权!
  9. 为什么别人一周搞定Linux,而你却做不到
  10. SQL2000系統表的應用
  11. 企业常用的站内收索、QQ群、在线客服
  12. c语言汉诺塔问题详解
  13. 同步发电机转子的转动惯量与运动方程(一) 基本物理概念
  14. php递归算法-无限极分类
  15. 量子密码(二)——经典的希特勒密码、紫色密码、乘数密码以及量子密码、量子纠缠初探
  16. CentOS7安装Chrome浏览器
  17. oracle数据库运行脚本 error reading files,Oracle数据库的故障解决
  18. 100万人同时抢1万张火车票,12306抢票,极限并发带来的思考?
  19. Qt编写自定义控件37-发光按钮(会呼吸的痛)
  20. python入门(三)--文件处理

热门文章

  1. python给女友一个小惊喜——桌面宠物【DIY版】
  2. 小米电视不同清晰度图片对比效果
  3. ubuntu中用vscode编译调试C\C++
  4. 凝思mysql服务器搭建_部署阿里云服务器全过程——详细篇
  5. 毕业设计之路(6)——uip
  6. 几款常用LED显示屏驱动芯片介绍及选择VK1624
  7. 苹果手机防盗软件_苹果手机更好用的笔记软件是哪款?
  8. 卡片的sak为不支持的类型_泛微OA系统为大型制造业打造内外一体的移动报修平台...
  9. 删除的监控视频怎么恢复?用数据恢复软件解决
  10. Android 静音检测