Портал освітньо-інформаційних послуг «Студентська консультація»

  
Телефон +3 8(066) 185-39-18
Телефон +3 8(093) 202-63-01
 (093) 202-63-01
 studscon@gmail.com
 facebook.com/studcons

<script>

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

 

  ga('create', 'UA-53007750-1', 'auto');

  ga('send', 'pageview');

 

</script>

Дизасемблювання TPU, TPP, TPW модулів, написаних на Паскалі

Тип роботи: 
Курсова робота
К-сть сторінок: 
82
Мова: 
Українська
Оцінка: 

writeln;

  writeln(blocktype,' blocks');
  if base >= limit then
    writeln('(none)')
  else
  begin
    if blocktype='Code' then
      writeln('Blocknum   Bytes  Relocrecs Lineinfo Owner')
    else
      writeln('Blocknum   Bytes  Relocrecs  Owner');
    ofs := 0;
    while base+ofs < limit do
    begin
      block := add_only_offset(buffer,base+ofs);
      with block^ do
      begin
        write(hexwordblank(ofs):8,hexwordblank(size):8,
              hexwordblank(relocbytes):8,hexwordblank(owner):8,'     ');
        if blocktype = 'Code' then
          write_code_block_name(unit_list[1],ofs)
        else if blocktype = 'Const' then
          write_const_block_name(owner);
        if w1 <> 0 then
          write(' w1 = ',hexword(w1));
        writeln;
      end;
      inc(ofs,sizeof(block_rec));
    end;
  end;
end;
 
procedure print_code_blocks;
var
  base,limit:word;
begin
  base := header^.ofs_code_blocks;
  limit := header^.ofs_const_blocks;
  print_blocks('Code',base,limit);
end;
 
procedure print_const_blocks;
var
  base,limit:word;
begin
  base := header^.ofs_const_blocks;
  limit := header^.ofs_var_blocks;
  print_blocks('Const',base,limit);
end;
 
procedure print_var_blocks;
var
  base,limit:word;
begin
  base := header^.ofs_var_blocks;
  limit := header^.ofs_dll_list;
  print_blocks('Var',base,limit);
end;
 
procedure print_dll_blocks;
var
  base,ofs,limit:word;
  block : dll_block_ptr;
begin
  writeln;
  writeln('DLL exported names list');
  base := header^.ofs_dll_list;
  limit := header^.ofs_unit_list;
  if base >= limit then
    writeln('(none)')
  else
  begin
    writeln(' Offset    Name');
    ofs := 0;
    while base+ofs < limit do
    begin
      block := add_only_offset(buffer,base+ofs);
      with block^ do
      begin
        write(hexwordblank(ofs):8,'  ',name);
        if w1 <> 0 then
          write(' w1= ',hexword(w1));
        if w2 <> 0 then
          write(' w2= ',hexword(w2));
        writeln;
        ofs := ofs + 5 + length(name);
      end;
    end;
  end;
end;
 
procedure print_unit_blocks;
var
  base,ofs,limit:word;
  block60 : unit_block60_ptr;
  block : unit_block_ptr;
  li:integer;
begin
  writeln;
  writeln('Unit list');
  base := header^.ofs_unit_list;
  limit := header^.ofs_src_name;
  if base >= limit then
    writeln('(none)')
  else
  begin
    write(' Offset    Name');
{$IFNDEF UNIT60}
      write('     References');
{$ENDIF}
    writeln;
    ofs := 0;
    while base+ofs < limit do
    begin
      block := add_only_offset(buffer,base+ofs);
{$IFDEF UNIT60}
        with unit_block60_ptr(block)^ do
        begin
          write(hexwordblank(ofs):8,'  ',name);
          if w1 <> 0 then
            write(' w1 = ',hexword(w1));
          writeln;
          Inc(ofs, 3 + length(name));
        end
{$ELSE}
        with block^ do
        begin
          write(hexwordblank(ofs):8,'  ',name);
          write('':8-length(name)+4,HexWordAsm(refcount div 4):5);
          if refcount mod 4<>0 then
            WriteError('unit references not multiple 4 '+HexWord(refcount));
          if w1 <> 0 then
            write(' w1 = ',hexword(w1));
          writeln;
          Inc(ofs,5 + length(name));
        end;
{$ENDIF}
    end;
  end;
end;
 
function unit_name(ofs:word):string;
begin
  unit_name := unit_block_ptr(
                add_only_offset(buffer,header^.ofs_unit_list+ofs))^.name;
end;
 
function dll_name(ofs:word):string;
begin
  dll_name := dll_block_ptr(
                add_only_offset(buffer,header^.ofs_dll_list+ofs))^.name;
end;
 
function ref_type(rtype:byte):byte;
begin
  ref_type := (rtype shr 4) and 3;
end;
 
Фото Капча