0

I lost my source code, I have vb6 exe, I decompile exe, then I get decompile codes like below given. Now I want to convert this codes into vb6 source code or readable format.

Decompile code: want to convert into vb6 format

'N 004048D0 55                   push ebp
'N 004048D1 8BEC                 mov ebp, esp
'N 004048D3 83EC0C               sub esp, 0Ch
'N 004048D6 6806114000           push L00401106
'N                               * ref: __vbaExceptHandler
'N 004048DB 64A100000000         mov eax, dword ptr fs:[L00000000]
'N 004048E1 50                   push eax
'N 004048E2 64892500000000       mov dword ptr fs:[L00000000], esp
'N 004048E9 83EC08               sub esp, 8
'N 004048EC 53                   push ebx
'N 004048ED 56                   push esi
'N 004048EE 57                   push edi
'N 004048EF 8965F4               mov dword ptr [ebp-0Ch], esp
'N 004048F2 C745F8C0104000       mov dword ptr [ebp-8], L004010C0
'N 004048F9 8B4508               mov eax, dword ptr [ebp+8]
'N 004048FC 8BC8                 mov ecx, eax
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
YogStack
  • 1
  • 1
  • 1
  • 2
    Good luck. Next time, use source control and backups. – John Saunders Dec 26 '10 at 12:13
  • 2
    Compiled VB is quite difficult to disassamble, and probably impossible to reassemble. Maybe this kind of tool could help: http://www.vb-decompiler.org/ – Simon Mourier Dec 26 '10 at 14:00
  • 2
    Similar to [this question](http://stackoverflow.com/questions/1406015/decompiler-for-visual-basic-6-program) - noone could help there, either :( – MarkJ Dec 26 '10 at 16:23
  • This asm doesn't do anything beyond load some args at the start of a function, and save some call-preserved registers. I guess you could make get a function signature from that. (IDK what it's doing with `fs:`, maybe some kind of exception-handling thing with a chain of stack frames?) – Peter Cordes Jul 15 '18 at 12:27

1 Answers1

2
  • Step 1: Learn assembly
  • Step 2: Translate assembly in VB
  • Step 3: Back up your code

Alternately:

  • Step 1: Rewrite VB code from scratch
  • Step 2: Back up your code
Sparafusile
  • 4,696
  • 7
  • 34
  • 57