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

  
Телефон +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
Мова: 
Українська
Оцінка: 

    line := 0;

        i := 0;
        codeofs := entry;
        while line < numlines do
        begin
          if bytes_per_line^[i] > 0 then
          begin
            write(startline+line:6,':',hexword(codeofs):4);
            inc(column);
            if column = 7 then
            begin
              column := 0;
              writeln;
            end;
            if bytes_per_line^[i] >= $80 then
            begin
              inc(codeofs,$100*(bytes_per_line^[i]-$80)
                               +bytes_per_line^[i+1]);
              inc(i);
            end
            else
              inc(codeofs,bytes_per_line^[i]);
          end;
          inc(line);
          inc(i);
        end;
        inc(ofs,sizeof(thisrec^)+i);
      end;
      if column <> 0 then
        writeln;
    end;
  end;
end;
procedure print_browser;
var
  br_item:browser_ptr;
  i,i2,line:word;
  obj:obj_ptr;
  base,ofs,limit:word;
  block : unit_block_ptr;
  buf : byte_array_ptr;
  unit_ptr:unit_list_ptr;
begin
{$IFNDEF UNIT60}
  writeln;
  writeln('Browser information');
  if header^.browser_size = 0 then
  begin
    writeln('(none)');
    exit;
  end;
  i:=0;
  line:=0;
  write('    Line Declared symbols');
  while i<header^.br_defs_end do
  begin
    br_item:=add_only_offset(browser_buf,i);
    if br_item^.line<>line then
    begin
      Writeln;
      line:=br_item^.line;
      Write(line:8);
    end;
    obj:=add_only_offset(buffer,br_item^.ofs);
    write(' ',obj^.name);
    inc(i,sizeof(br_item^));
  end;
  writeln;
  ofs := 0;
  base := header^.ofs_unit_list;
  limit := header^.ofs_src_name;
  i2:=0;
  while base+ofs < limit do
  begin
    block := add_only_offset(buffer,base+ofs);
    with block^ do
    begin
      Writeln;
      Write('    Line Referenced symbols from unit ',name);
      unit_ptr:=get_unit_by_name(name);
      if (unit_ptr<>nil) and (unit_ptr^.buffer<>nil) then
      begin
        buf:=unit_ptr^.buffer;
        i:=0;
        line:=0;
        while i<refcount do
        begin
          br_item:=add_only_offset(browser_buf,i+i2+header^.br_defs_end);
          if br_item^.line<>line then
          begin
            Writeln;
            line:=br_item^.line;
            Write(line:8);
          end;
          obj:=add_only_offset(buf,br_item^.ofs);
          write(' ',obj^.name);
          inc(i,sizeof(br_item^));
        end;
      end;
      Inc(i2,refcount);
      Inc(ofs,5 + length(name));
      writeln;
    end;
  end;
{$ENDIF}
end;
 
 
end.
 
Code.pas
 
unit code;
{$I SWITCHES.INC}
interface
 
procedure print_dump(seg:byte);
 
implementation
 
uses globals,head,blocks,reloc,dump,util,loader;
 
procedure print_dump(seg:byte);
var
  codebase,codeofs,codelimit,
  base,ofs,limit : word;
  code_block : block_ptr;
  block : byte_array_ptr;
begin
  case seg of
  code_seg : begin
        if header^.code_size = 0 then
          exit;
        writeln;
        writeln('Emitted code');
        codebase :=header^.ofs_code_blocks;
        codelimit := header^.ofs_const_blocks-codebase;
     end;
 
  const_seg : begin
        if header^.const_size = 0 then
          exit;
        writeln;
        writeln('Emitted consts');
        codebase :=header^.ofs_const_blocks;
        codelimit := header^.ofs_var_blocks-codebase;
     end;
Фото Капча