📄 instructiongenerator2.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Finding Classes</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" text="#000000" link="#0000FF" vlink="#0000CC" alink="#6666FF">
<h1><img alt="" src="findClasses.gif" width="32" height="32">Generating instructions.
Part 2.</h1>
<h2>Real Pascal.</h2>
<h3><A HREF="index.html"><img alt="" src="revendepro.gif" width="16" height="16" border="0">Revendepro page.</A></h3>
<p>Now that we have the procedure converted to a list of ret, assign instructions,
it might be nice, if we convert this to real pascal code.</p>
<p>First some requirements for the proc:</p>
<ul>
<li>The proc must be only assign instructions, except the last one which must
be a ret instruction.</li>
<li>The procedure is not virtual or dynamic, and it is not an finalization or
initialization procedure.</li>
<li>The procedure does not already have some requirements for the procedure
or function.</li>
</ul>
<p>First we will generate a list of register which is read before they are set,
and a list of register which is used.</p>
<p>Then we also require that only eax, ecx and edx are used.</p>
<p>If ecx is read before set eax, edx and ecx are params, if edx is read before
set eax, edx are params, if eax is read before set eax is the only param, otherwise
there are no params.</p>
<p> If ecx is used ecx, edx and eax are params if edx is used edx and eax are
params, if eax is used eax is the only param, otherwise if eax is totally not
used, then eax is a param otherwise there are no params.</p>
<p>We create vars for all registers which are used but are not params.</p>
<p>Now that every used register has a parameter or var, we convert every assign
instruction into pascal using the names of the parameter or var and we have
to find a pascal equivalents for every other operations/instructions (const,
pointer, *, div, etc).</p>
<p>Therefor we also require that there is not a address value references which
is also fixup</p>
<hr>
<a href="http://www.puthoon.com" target="_top"><img alt="" src="puthoonMini.gif" width=20 height=20 border=0></A><FONT Face="Symbol,fantasy">Puqwn</FONT><BR>
E-mail: <a href="MAILTO:puthoon@puthoon.com">puthoon@puthoon.com</a>
<HR>
Copyright © 1999, 2000 Puthoon. All rights reserved
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -