# LDE32 -- Length-Disassembler Engine

## User's Manual

[Русский] [English]

LDE32 is a library which may be used to determine length of any x86 instructiion, i.e. to provide partial disassembling.

LDE32 has only two subroutines.

1. `void pascal disasm_init(void* tableptr);`

This subroutine used to build internal data table of 2048 byte length.

2. `int pascal disasm_main(void* opcodeptr, void* tableptr);`

This subroutine used to disassemble one instruction. It returns length of instruction in bytes, or -1 if an error occured.

Subroutines preserves all registers; code is offset-independent; no data used except 2k at *tableptr.

To include LDE32 into your source you should add the following line:

`include lde32bin.inc`

example
                    push    offset tbl      ; build disasm flag tables
                    call    disasm_init

                    mov     ebx, 401000h
    cycle:
                    push    ebx             ; disasm offset
                    push    offset tbl      ; internal disasm table
                    call    disasm_main

                    add     ebx, eax

                    cmp     eax, -1         ; error?
                    jne     cycle

    include         lde32bin.inc            ; LDE32 code

    tbl             db      2048 dup (?)    ; internal LDE32 data

programmed in 1999 by Z0MBiE, z0mbie.cjb.net