Fixes to libdisasm, also use it a bit more
This commit is contained in:
@@ -13,16 +13,15 @@ int proc_2 (long arg0, long arg1)
|
||||
*/
|
||||
{
|
||||
char loc1; /* al */
|
||||
int loc2; /* al */
|
||||
int loc3; /* bx */
|
||||
int loc2; /* bx */
|
||||
|
||||
do {
|
||||
arg0 = (arg0 + 1);
|
||||
loc1 = es[bx];
|
||||
arg1 = (arg1 + 1);
|
||||
es[bx] = loc1;
|
||||
} while ((loc2 != 0));
|
||||
return (loc3);
|
||||
} while ((loc1 != 0));
|
||||
return (loc2);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +34,6 @@ int proc_3 (long arg0, long arg1)
|
||||
int loc1; /* ax */
|
||||
|
||||
while ((es[bx] == es[bx])) {
|
||||
|
||||
if (es[bx] == 0) {
|
||||
loc1 = 0;
|
||||
return (loc1);
|
||||
@@ -57,9 +55,9 @@ int proc_1 (int arg0, int arg1, int arg2, int arg3)
|
||||
{
|
||||
int loc1; /* si */
|
||||
int loc2; /* di */
|
||||
|
||||
loc1 = 0;
|
||||
loc2 = 0;
|
||||
|
||||
while ((loc1 < 0x2328)) {
|
||||
proc_2 (arg1, arg0, 311);
|
||||
proc_2 (arg3, arg2, 328);
|
||||
@@ -79,13 +77,12 @@ int loc1;
|
||||
int loc2;
|
||||
int loc3;
|
||||
int loc4;
|
||||
loc3 = 0;
|
||||
|
||||
loc3 = 0;
|
||||
while ((loc3 < 0x3e8)) {
|
||||
loc1 = 0;
|
||||
loc4 = 0;
|
||||
loc2 = 1;
|
||||
|
||||
while ((loc4 < 179)) {
|
||||
loc1 = (loc1 + loc2);
|
||||
loc2 = (loc2 + 2);
|
||||
@@ -105,8 +102,8 @@ int proc_5 (int arg0)
|
||||
{
|
||||
int loc1; /* si */
|
||||
int loc2; /* ax */
|
||||
loc1 = arg0;
|
||||
|
||||
loc1 = arg0;
|
||||
if (loc1 > 2) {
|
||||
loc2 = (proc_5 ((loc1 - 1)) + proc_5 ((loc1 + 0xfffe)));
|
||||
}
|
||||
@@ -179,7 +176,7 @@ void proc_8 (int arg0)
|
||||
}
|
||||
|
||||
|
||||
proc_7 (int arg0, int arg1, int arg2, int arg3)
|
||||
void proc_7 (int arg0, int arg1, int arg2, int arg3)
|
||||
/* Takes 8 bytes of parameters.
|
||||
* High-level language prologue code.
|
||||
* Untranslatable routine. Assembler provided.
|
||||
@@ -245,7 +242,7 @@ void proc_8 (int arg0)
|
||||
}
|
||||
|
||||
|
||||
proc_9 (int arg0)
|
||||
void proc_9 (int arg0)
|
||||
/* Takes 8 bytes of parameters.
|
||||
* High-level language prologue code.
|
||||
* C calling convention.
|
||||
@@ -256,106 +253,62 @@ void proc_8 (int arg0)
|
||||
int loc1;
|
||||
int loc2;
|
||||
int loc3; /* ax */
|
||||
|
||||
loc2 = 100;
|
||||
loc3 = loc2;
|
||||
loc2 = (loc2 - 1);
|
||||
|
||||
while (((loc3 | loc3) != 0)) {
|
||||
loc3 = loc2;
|
||||
loc2 = (loc2 - 1);
|
||||
} /* end of while */
|
||||
return (var06278);
|
||||
}
|
||||
|
||||
|
||||
int proc_10 ()
|
||||
/* Takes no parameters.
|
||||
* High-level language prologue code.
|
||||
* Untranslatable routine. Assembler provided.
|
||||
* Return value in register ax.
|
||||
* Contains instructions not normally used by compilers.
|
||||
*/
|
||||
{
|
||||
PUSH bp
|
||||
MOV bp, sp
|
||||
SUB sp, 68h
|
||||
PUSH si
|
||||
PUSH di
|
||||
PUSH ds
|
||||
MOV ax, 159h
|
||||
PUSH ax
|
||||
PUSH ss
|
||||
LEA ax, [bp-64h]
|
||||
PUSH ax
|
||||
PUSH cs
|
||||
CALL near ptr proc_2
|
||||
ADD sp, 8
|
||||
PUSH ds
|
||||
MOV ax, 170h
|
||||
PUSH ax
|
||||
PUSH ds
|
||||
MOV ax, 167h
|
||||
PUSH ax
|
||||
CALL far ptr fopen
|
||||
ADD sp, 8
|
||||
MOV [bp-66h], dx
|
||||
MOV [bp-68h], ax
|
||||
OR dx, ax
|
||||
JNE L1
|
||||
PUSH ds
|
||||
MOV ax, 172h
|
||||
PUSH ax
|
||||
CALL far ptr printf
|
||||
POP cx
|
||||
POP cx
|
||||
MOV ax, 0FFFFh
|
||||
PUSH ax
|
||||
CALL far ptr exit
|
||||
POP cx
|
||||
int loc1;
|
||||
int loc2;
|
||||
int loc3;
|
||||
int loc4;
|
||||
int loc5;
|
||||
int loc6; /* bx */
|
||||
int loc7; /* dx */
|
||||
int loc8; /* ax */
|
||||
loc6 = proc_2 (&loc1, 345, , );
|
||||
fopen ("zyxw.vut", 368);
|
||||
loc2 = loc7;
|
||||
loc3 = loc8;
|
||||
|
||||
L1: XOR di, 0
|
||||
if ((loc7 | loc8) == 0) {
|
||||
printf ("Cannot open file");
|
||||
exit (0xffff);
|
||||
}
|
||||
l1:
|
||||
if (++loc5 >= 0x3e8) {
|
||||
fclose (loc3, loc2);
|
||||
return (loc5);
|
||||
}
|
||||
else {
|
||||
loc4 = 0;
|
||||
|
||||
L2: INC di
|
||||
MOV ax, di
|
||||
CMP ax, 3E8h
|
||||
JL L3
|
||||
PUSH word ptr [bp-66h]
|
||||
PUSH word ptr [bp-68h]
|
||||
CALL far ptr fclose
|
||||
POP cx
|
||||
POP cx
|
||||
MOV ax, di
|
||||
POP di
|
||||
POP si
|
||||
MOV sp, bp
|
||||
POP bp
|
||||
RETF
|
||||
while ((ss[bp+si-0x64] != 0)) {
|
||||
|
||||
L3: XOR si, 0
|
||||
|
||||
L4: CMP byte ptr ss:[bp+si-64h], 0
|
||||
JNE L5
|
||||
|
||||
L5: LES bx, dword ptr[bp-68h]
|
||||
INC word ptr es:[bx]
|
||||
JGE L6
|
||||
MOV al, ss:[bp+si-64h]
|
||||
LES bx, dword ptr[bp-68h]
|
||||
INC word ptr es:[bx+0Ch]
|
||||
LES bx, dword ptres:[bx+0Ch]
|
||||
DEC bx
|
||||
MOV es:[bx], al
|
||||
MOV ah, 0
|
||||
|
||||
L7: INC si
|
||||
JMP L4 ;Synthetic inst
|
||||
|
||||
L6: PUSH word ptr [bp-66h]
|
||||
PUSH word ptr [bp-68h]
|
||||
PUSH word ptr ss:[bp+si-64h]
|
||||
CALL far ptr _fputc
|
||||
ADD sp, 6
|
||||
JMP L7 ;Synthetic inst
|
||||
if (++es[bx] < 0) {
|
||||
es[bx+0xc] = (es[bx+0xc] + 1);
|
||||
loc6 = (loc6 - 1);
|
||||
es[bx] = ss[bp+si-0x64];
|
||||
}
|
||||
else {
|
||||
_fputc (ss[bp+si-0x64], loc3, loc2);
|
||||
}
|
||||
loc4 = (loc4 + 1);
|
||||
} /* end of while */
|
||||
goto L1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -379,11 +332,11 @@ int loc10;
|
||||
int loc11;
|
||||
int loc12; /* ax */
|
||||
int loc13; /* bx */
|
||||
printf ("Start...%c\n\n", 7);
|
||||
|
||||
loc11 = 0;
|
||||
printf ("Start...%c\n\n", 7);
|
||||
while ((loc11 < 6)) {
|
||||
loc12 = loc11;
|
||||
|
||||
if (loc12 <= 5) {
|
||||
loc13 = (loc12 << 1);
|
||||
var06278 = proc_1 (&loc2, &loc1, , );
|
||||
|
||||
@@ -15,30 +15,32 @@ long LXMUL@ (long arg0, long arg1)
|
||||
{
|
||||
int loc1;
|
||||
int loc2; /* tmp */
|
||||
|
||||
loc2 = LO(arg0);
|
||||
LO(arg0) = loc1;
|
||||
loc1 = loc2;
|
||||
loc2 = LO(arg0);
|
||||
LO(arg0) = HI(arg0);
|
||||
|
||||
if ((LO(arg0) & LO(arg0)) != 0) {
|
||||
LO(arg0) = (LO(arg0) * LO(arg1));
|
||||
}
|
||||
loc2 = LO(arg0);
|
||||
LO(arg0) = HI(arg1);
|
||||
HI(arg1) = loc2;
|
||||
|
||||
if ((LO(arg0) & LO(arg0)) != 0) {
|
||||
LO(arg0) = (LO(arg0) * loc1);
|
||||
HI(arg1) = (HI(arg1) + LO(arg0));
|
||||
}
|
||||
loc2 = LO(arg0);
|
||||
arg0 = (loc1 * LO(arg1));
|
||||
LO(arg0) = loc1;
|
||||
loc1 = loc2;
|
||||
arg0 = (LO(arg0) * LO(arg1));
|
||||
HI(arg0) = (HI(arg0) + HI(arg1));
|
||||
return (arg0);
|
||||
}
|
||||
|
||||
|
||||
long LDIV@ (long arg0, int arg3)
|
||||
long LDIV@ (long arg0, long arg2)
|
||||
/* Takes 8 bytes of parameters.
|
||||
* Runtime support routine of the compiler.
|
||||
* High-level language prologue code.
|
||||
@@ -131,7 +133,7 @@ long LDIV@ (long arg0, int arg3)
|
||||
}
|
||||
|
||||
|
||||
long LMOD@ (long arg0, int arg3)
|
||||
long LMOD@ (long arg0, long arg2)
|
||||
/* Takes 8 bytes of parameters.
|
||||
* Runtime support routine of the compiler.
|
||||
* High-level language prologue code.
|
||||
@@ -280,6 +282,7 @@ void main ()
|
||||
{
|
||||
long loc1;
|
||||
long loc2;
|
||||
|
||||
loc2 = 255;
|
||||
loc1 = 143;
|
||||
loc1 = (loc2 + loc1);
|
||||
|
||||
@@ -15,16 +15,14 @@ void proc_1 (int arg0, int arg1, int arg2)
|
||||
int loc1;
|
||||
int loc2;
|
||||
int loc3;
|
||||
loc2 = 0;
|
||||
|
||||
loc2 = 0;
|
||||
while ((loc2 < 5)) {
|
||||
loc3 = 0;
|
||||
|
||||
while ((loc3 < 4)) {
|
||||
loc1 = 0;
|
||||
|
||||
while ((loc1 < 4)) {
|
||||
*((((loc2 * 10) + arg2) + (loc3 << 1))) = ((*(((((loc2 << 3) << 1) + arg0) + (loc1 << 1))) * *((((loc1 * 10) + arg1) + (loc3 << 1)))) + *((((loc2 * 10) + arg2) + (loc3 << 1))));
|
||||
*((((loc2 * 10) + arg2) + (loc3 << 1))) = ((*((((loc2 << 3) + arg0) + (loc1 << 1))) * *((((loc1 * 10) + arg1) + (loc3 << 1)))) + *((((loc2 * 10) + arg2) + (loc3 << 1))));
|
||||
loc1 = (loc1 + 1);
|
||||
} /* end of while */
|
||||
loc3 = (loc3 + 1);
|
||||
@@ -42,6 +40,7 @@ void main ()
|
||||
int loc1;
|
||||
int loc2;
|
||||
int loc3;
|
||||
|
||||
proc_1 (&loc3, &loc2, &loc1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user