今天看了一下反汇编,反编译
无语中。。。。编译方式:本机代码。源代码是 24点那个程序。
源码:
程序代码:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) '全选和复制 If Shift = 2 Then '经测试,Ctrl =2 If KeyCode = vbKeyA Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) ElseIf KeyCode = vbKeyC Then Clipboard.Clear Clipboard.SetText Text1.Text Else KeyCode = 0 End If End If End Sub
反编译后
程序代码:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) '402C00 Dim var_1C As Variant Dim var_20 As TextBox loc_00402C55: If Shift <> 2 Then GoTo loc_00402E97 loc_00402C65: If ecx <> 65 Then GoTo loc_00402D47 loc_00402C88: Text1.SelStart = 0 loc_00402CDA: var_18 = Text1.Text loc_00402D06: Text1.SelLength = Len(var_18) loc_00402D42: GoTo loc_00402E97 loc_00402D47: 'Referenced from: 00402C65 loc_00402D4B: If Len(var_18) <> 67 Then GoTo loc_00402E94 loc_00402D76: var_1C = Global.Clipboard loc_00402DA0: var_eax = Global.Clear loc_00402DE3: var_20 = Global.Clipboard loc_00402E1C: var_18 = Text1.Text loc_00402E5C: var_18 = Text1.ForeColor loc_00402E92: GoTo loc_00402E97 loc_00402E94: 'Referenced from: 00402D4B loc_00402E97: 'Referenced from: 00402C55 loc_00402E9F: GoTo loc_00402EBE loc_00402EBD: Exit Sub loc_00402EBE: 'Referenced from: 00402E9F End Sub
经检查,
1、临时变量类型有误
2、操作剪切板语句有误。
对应的反汇编是:表示完全看不懂
程序代码:
loc_00402C55: jnz 00402E97h loc_00402C5B: mov ecx, arg_C loc_00402C5E: mov ax, [ecx] loc_00402C61: cmp ax, 0041h loc_00402C65: jnz 00402D47h loc_00402C6B: mov eax, [esi] loc_00402C6D: push esi loc_00402C6E: call [eax+00000304h] loc_00402C74: mov ebx, [0040103Ch] ; Set %StkVar1 = %StkVar2 'Ignore this loc_00402C7A: lea ecx, var_1C loc_00402C7D: push eax loc_00402C7E: push ecx loc_00402C7F: call ebx loc_00402C81: mov edi, eax loc_00402C83: push 00000000h loc_00402C85: push edi loc_00402C86: mov edx, [edi] loc_00402C88: call [edx+00000114h] loc_00402C8E: test eax, eax loc_00402C90: fnclex loc_00402C92: jge 00402CA6h loc_00402C94: push 00000114h loc_00402C99: push 00401ED0h loc_00402C9E: push edi loc_00402C9F: push eax loc_00402CA0: call [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402CA6: lea ecx, var_1C loc_00402CA9: call [004010E8h] ; %ecx = "" loc_00402CAF: mov eax, [esi] loc_00402CB1: push esi loc_00402CB2: call [eax+00000304h] loc_00402CB8: lea ecx, var_20 loc_00402CBB: push eax loc_00402CBC: push ecx loc_00402CBD: call ebx loc_00402CBF: mov edx, [esi] loc_00402CC1: push esi loc_00402CC2: mov edi, eax loc_00402CC4: call [edx+00000304h] loc_00402CCA: push eax loc_00402CCB: lea eax, var_1C loc_00402CCE: push eax loc_00402CCF: call ebx loc_00402CD1: mov esi, eax loc_00402CD3: lea edx, var_18 loc_00402CD6: push edx loc_00402CD7: push esi loc_00402CD8: mov ecx, [esi] loc_00402CDA: call [ecx+000000A0h] loc_00402CE0: test eax, eax loc_00402CE2: fnclex loc_00402CE4: jge 00402CF8h loc_00402CE6: push 000000A0h loc_00402CEB: push 00401ED0h loc_00402CF0: push esi loc_00402CF1: push eax loc_00402CF2: call [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402CF8: mov eax, var_18 loc_00402CFB: mov esi, [edi] loc_00402CFD: push eax loc_00402CFE: call [00401010h] ; @Len(%StkVar1) loc_00402D04: push eax loc_00402D05: push edi loc_00402D06: call [esi+0000011Ch] loc_00402D0C: test eax, eax loc_00402D0E: fnclex loc_00402D10: jge 00402D24h loc_00402D12: push 0000011Ch loc_00402D17: push 00401ED0h loc_00402D1C: push edi loc_00402D1D: push eax loc_00402D1E: call [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402D24: lea ecx, var_18 loc_00402D27: call [004010ECh] ; %ecx = "" loc_00402D2D: lea ecx, var_20 loc_00402D30: lea edx, var_1C loc_00402D33: push ecx loc_00402D34: push edx loc_00402D35: push 00000002h loc_00402D37: call [0040101Ch] ; %v = "" loc_00402D3D: add esp, 0000000Ch loc_00402D40: xor ebx, ebx loc_00402D42: jmp 00402E97h loc_00402D47: cmp ax, 0043h loc_00402D4B: jnz 00402E94h loc_00402D51: cmp [00405338h], ebx loc_00402D57: jnz 00402D69h loc_00402D59: push 00405338h ; vbNullString loc_00402D5E: push 00401F98h loc_00402D63: call [004010A8h] ; CreateObject(%StkVar1, %StkVar2) loc_00402D69: mov edi, [00405338h] loc_00402D6F: lea ecx, var_1C loc_00402D72: push ecx loc_00402D73: push edi loc_00402D74: mov eax, [edi] loc_00402D76: call [eax+0000001Ch] loc_00402D79: cmp eax, ebx loc_00402D7B: fnclex loc_00402D7D: jge 00402D92h loc_00402D7F: mov ebx, [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402D85: push 0000001Ch loc_00402D87: push 00401F88h loc_00402D8C: push edi loc_00402D8D: push eax loc_00402D8E: call ebx loc_00402D90: jmp 00402D98h loc_00402D92: mov ebx, [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402D98: mov eax, var_1C loc_00402D9B: push eax loc_00402D9C: mov edi, eax loc_00402D9E: mov edx, [eax] loc_00402DA0: call [edx+00000050h] loc_00402DA3: test eax, eax loc_00402DA5: fnclex loc_00402DA7: jge 00402DB4h loc_00402DA9: push 00000050h loc_00402DAB: push 00401FA8h loc_00402DB0: push edi loc_00402DB1: push eax loc_00402DB2: call ebx loc_00402DB4: lea ecx, var_1C loc_00402DB7: call [004010E8h] ; %ecx = "" loc_00402DBD: mov eax, [00405338h] loc_00402DC2: test eax, eax loc_00402DC4: jnz 00402DD6h loc_00402DC6: push 00405338h ; vbNullString loc_00402DCB: push 00401F98h loc_00402DD0: call [004010A8h] ; CreateObject(%StkVar1, %StkVar2) loc_00402DD6: mov edi, [00405338h] loc_00402DDC: lea ecx, var_20 loc_00402DDF: push ecx loc_00402DE0: push edi loc_00402DE1: mov eax, [edi] loc_00402DE3: call [eax+0000001Ch] loc_00402DE6: test eax, eax loc_00402DE8: fnclex loc_00402DEA: jge 00402DF7h loc_00402DEC: push 0000001Ch loc_00402DEE: push 00401F88h loc_00402DF3: push edi loc_00402DF4: push eax loc_00402DF5: call ebx loc_00402DF7: mov edx, [esi] loc_00402DF9: mov edi, var_20 loc_00402DFC: push esi loc_00402DFD: mov ebx, 80020004h loc_00402E02: call [edx+00000304h] loc_00402E08: push eax loc_00402E09: lea eax, var_1C loc_00402E0C: push eax loc_00402E0D: call [0040103Ch] ; Set %StkVar1 = %StkVar2 'Ignore this loc_00402E13: mov esi, eax loc_00402E15: lea edx, var_18 loc_00402E18: push edx loc_00402E19: push esi loc_00402E1A: mov ecx, [esi] loc_00402E1C: call [ecx+000000A0h] loc_00402E22: test eax, eax loc_00402E24: fnclex loc_00402E26: jge 00402E3Ah loc_00402E28: push 000000A0h loc_00402E2D: push 00401ED0h loc_00402E32: push esi loc_00402E33: push eax loc_00402E34: call [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402E3A: sub esp, 00000010h loc_00402E3D: mov eax, 0000000Ah loc_00402E42: mov edx, esp loc_00402E44: mov ecx, [edi] loc_00402E46: mov [edx], eax loc_00402E48: mov eax, var_2C loc_00402E4B: mov [edx+00000004h], eax loc_00402E4E: mov eax, var_24 loc_00402E51: mov [edx+00000008h], ebx loc_00402E54: mov [edx+0000000Ch], eax loc_00402E57: mov edx, var_18 loc_00402E5A: push edx loc_00402E5B: push edi loc_00402E5C: call [ecx+00000060h] loc_00402E5F: test eax, eax loc_00402E61: fnclex loc_00402E63: jge 00402E74h loc_00402E65: push 00000060h loc_00402E67: push 00401FA8h loc_00402E6C: push edi loc_00402E6D: push eax loc_00402E6E: call [0040102Ch] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4) loc_00402E74: lea ecx, var_18 loc_00402E77: call [004010ECh] ; %ecx = "" loc_00402E7D: lea eax, var_20 loc_00402E80: lea ecx, var_1C loc_00402E83: push eax loc_00402E84: push ecx loc_00402E85: push 00000002h loc_00402E87: call [0040101Ch] ; %v = "" loc_00402E8D: add esp, 0000000Ch loc_00402E90: xor ebx, ebx loc_00402E92: jmp 00402E97h loc_00402E94: mov [ecx], bx loc_00402E97: mov var_4, ebx loc_00402E9A: push 00402EBFh loc_00402E9F: jmp 00402EBEh loc_00402EA1: lea ecx, var_18 loc_00402EA4: call [004010ECh] ; %ecx = "" loc_00402EAA: lea edx, var_20 loc_00402EAD: lea eax, var_1C loc_00402EB0: push edx loc_00402EB1: push eax loc_00402EB2: push 00000002h loc_00402EB4: call [0040101Ch] ; %v = "" loc_00402EBA: add esp, 0000000Ch loc_00402EBD: ret