Hello,All the attachment txt is the dasm of a exe file. How I translate it into a source code? give me some methods 1. How i distinguish the Local var and Global var? 2. How i distinguish the independence var and struct var? 332477811__scr_2.txt
Local variales are put in stack and they are usually accessed by offset to 'EBP' or 'ESP' registers. Global variables are usually put in '.data' segment (or some others) and can be accessed directly by these address. Код (Text): ... sub_4012E0 proc near ; DATA XREF: DialogFunc+46o FileName = byte ptr -148h var_44 = dword ptr -44h ... lea eax, [ebp+FileName] ... push [ebp+var_44] ; HDC ... 'FileName' and 'var_44' are local variables and Код (Text): ... mov dword_4032E4, eax mov dword_4032E8, eax ... 'dword_4032E4' and 'dword_4032E8' are global variables. So if (for example) you call 'sub_4012E0' recursively you will have many _different_ sets of local variables but all instances will use the same variable dword_4032E4. I think it's impossible without some additional information. For example IDA (and you too) can recognize structure by API prototype: Код (Text): ... lea eax, [ebp+Paint] push eax ; lpPaint push [ebp+hDlg] ; hWnd call BeginPaint push offset stru_4032F8 ; lpRect push [ebp+hDlg] ; hWnd call GetClientRect push [ebp+Paint.hdc] ; HDC call CreateCompatibleDC ... When during program analysis you realize than some variables compose a structure you can tell IDA and the next time you will see not anonymous Код (Text): ... push [ebp+var_40] ... but Код (Text): ... push [ebp+Paint.hdc] ...
Thanks you who responsed the topic. it's a lot of usefully information. I forgot the rc file. regards _1775922375__rsrc.rc
rmn я делал это несколько раз , причём однажды это была большая досовская программа она не работала потом как положено , но скомпилялась с полпинка