2016-01-15 02:05:51 +03:00
|
|
|
#ifndef INCLUDE_DEBUG_H
|
|
|
|
#define INCLUDE_DEBUG_H
|
|
|
|
|
|
|
|
#ifndef INCLUDE_STRING_H
|
|
|
|
#include "../lib/strings.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline fastcall void debugch( ECX)
|
|
|
|
{
|
|
|
|
$push eax
|
|
|
|
$push ebx
|
|
|
|
$mov eax,63
|
|
|
|
$mov ebx,1
|
|
|
|
$int 0x40
|
|
|
|
$pop ebx
|
|
|
|
$pop eax
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall void debug( EDX)
|
|
|
|
{
|
|
|
|
$push eax
|
|
|
|
$push ebx
|
|
|
|
$push ecx
|
|
|
|
$mov eax, 63
|
|
|
|
$mov ebx, 1
|
|
|
|
NEXT_CHAR:
|
|
|
|
$mov ecx, DSDWORD[edx]
|
|
|
|
$or cl, cl
|
|
|
|
$jz DONE
|
|
|
|
$int 0x40
|
|
|
|
$inc edx
|
|
|
|
$jmp NEXT_CHAR
|
|
|
|
DONE:
|
|
|
|
$pop ecx
|
|
|
|
$pop ebx
|
|
|
|
$pop eax
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall void debugln( EDX)
|
|
|
|
{
|
|
|
|
debug( EDX);
|
2016-02-07 01:48:51 +03:00
|
|
|
debugch(10);
|
2016-01-15 02:05:51 +03:00
|
|
|
}
|
|
|
|
|
2020-05-11 17:11:23 +03:00
|
|
|
inline fastcall void debugcls()
|
|
|
|
{
|
|
|
|
char i;
|
|
|
|
for (i=0;i<70;i++) debugch(10);
|
|
|
|
}
|
|
|
|
|
2016-02-22 00:57:22 +03:00
|
|
|
:void debugval(dword text,number)
|
|
|
|
{
|
2020-03-22 22:50:16 +03:00
|
|
|
char tmpch[12];
|
2016-02-22 00:57:22 +03:00
|
|
|
debug(text);
|
|
|
|
debug(": ");
|
2020-03-22 22:50:16 +03:00
|
|
|
itoa_(#tmpch, number);
|
|
|
|
debugln(#tmpch);
|
2016-02-22 00:57:22 +03:00
|
|
|
}
|
|
|
|
|
2020-04-10 19:19:52 +03:00
|
|
|
:void debug_n(dword _text, _size)
|
|
|
|
{
|
|
|
|
dword res_text = malloc(_size);
|
|
|
|
strncpy(res_text, _text, _size-1);
|
|
|
|
debugln(res_text);
|
|
|
|
free(res_text);
|
|
|
|
}
|
|
|
|
|
2016-01-15 02:05:51 +03:00
|
|
|
#endif
|