input stringlengths 16 454k | output stringlengths 13 350k | function_name stringlengths 1 100 | repo_name stringlengths 6 43 | category stringclasses 76
values | sample_id stringlengths 22 88 | decompiler stringclasses 1
value | opt_level stringclasses 1
value |
|---|---|---|---|---|---|---|---|
void fs_nvram_close(fs_nvram_t *fs_0) {
if (fs_0)
free(fs_0);
} | void fs_nvram_close(fs_nvram_t *fs) {
if (fs)
free(fs);
} | fs_nvram_close | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_create(fs_nvram_t *fs_0) {
fs_nvram_clear(fs_0, 0, fs_0->len);
fs_nvram_write16(fs_0, 6u, 0xF0A5u);
fs_nvram_write16(fs_0, 0xCu, 0xFFFFu);
} | static void fs_nvram_create(fs_nvram_t *fs) {
fs_nvram_clear(fs, 0, fs->len);
fs_nvram_write16(fs, offsetof(struct fs_nvram_header, magic),
FS_NVRAM_MAGIC_FILESYSTEM);
fs_nvram_write16(
fs,
sizeof(struct fs_nvram_header) +
offsetof(struct fs_nvram_header_startup_config, ch... | fs_nvram_create | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_memcpy_from(fs_nvram_t *fs_0, u_int offset, u_char *data,
u_int len) {
u_int i;
for (i = 0; i < len; ++i)
*data++ = fs_0->read_byte(fs_0, i + offset);
} | static void fs_nvram_memcpy_from(fs_nvram_t *fs, u_int offset, u_char *data,
u_int len) {
u_int i;
for (i = 0; i < len; i++) {
*data = fs->read_byte(fs, offset + i);
data++;
}
} | fs_nvram_memcpy_from | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_memcpy_to(fs_nvram_t *fs_0, u_int offset, const u_char *data,
u_int len) {
u_int i;
for (i = 0; i < len; ++i)
fs_0->write_byte(fs_0, i + offset, *data++);
} | static void fs_nvram_memcpy_to(fs_nvram_t *fs, u_int offset, const u_char *data,
u_int len) {
u_int i;
for (i = 0; i < len; i++) {
fs->write_byte(fs, offset + i, *data);
data++;
}
} | fs_nvram_memcpy_to | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
size_t fs_nvram_num_sectors(fs_nvram_t *fs_0) {
if (fs_0)
return fs_0->len >> 10;
else
return 0;
} | size_t fs_nvram_num_sectors(fs_nvram_t *fs) {
if (fs == NULL)
return (0);
return (fs->len / FS_NVRAM_SECTOR_SIZE);
} | fs_nvram_num_sectors | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
u_int fs_nvram_offset1_with_backup(fs_nvram_t *fs_0, u_int offset) {
if (offset > 0x1FFFF)
return (offset + 114688) << fs_0->shift;
else
return offset << fs_0->shift;
} | static inline u_int fs_nvram_offset1_with_backup(fs_nvram_t *fs, u_int offset) {
if (offset < FS_NVRAM_NORMAL_FILESYSTEM_BLOCK1)
return (offset << fs->shift);
else
return ((FS_NVRAM_BACKUP_FILESYSTEM_BLOCK1 + offset) << fs->shift);
} | fs_nvram_offset1_with_backup | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
u_int fs_nvram_offset2_with_backup(fs_nvram_t *fs_0, u_int offset) {
size_t v2;
if (offset > 0x1BFFF)
v2 = offset + fs_0->len;
else
v2 = offset + fs_0->backup;
return v2 << fs_0->shift;
} | static inline u_int fs_nvram_offset2_with_backup(fs_nvram_t *fs, u_int offset) {
if (offset < FS_NVRAM_BACKUP_FILESYSTEM_BLOCK1)
return ((fs->backup + offset) << fs->shift);
else
return ((fs->len + offset) << fs->shift);
} | fs_nvram_offset2_with_backup | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
m_uint32_t fs_nvram_offset_of(fs_nvram_t *fs_0, m_uint32_t address) {
if ((fs_0->flags & 0x400) != 0)
return address - fs_0->addr;
else
return address + 8;
} | static inline m_uint32_t fs_nvram_offset_of(fs_nvram_t *fs,
m_uint32_t address) {
if ((fs->flags & FS_NVRAM_FLAG_ADDR_ABSOLUTE))
return (address - fs->addr);
else
return (address + 8);
} | fs_nvram_offset_of | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
fs_nvram_t *fs_nvram_open(u_char *base, size_t len, m_uint32_t addr,
u_int flags) {
int v5;
unsigned long v6;
m_uint8_t (*v7)(fs_nvram_t *, u_int);
void (*v8)(fs_nvram_t *, u_int, m_uint8_t);
size_t len_div;
fs_nvram *fs_0;
len_div = 1;
if ((flags & 0x20) != 0)
len_div = 4... | fs_nvram_t *fs_nvram_open(u_char *base, size_t len, m_uint32_t addr,
u_int flags) {
struct fs_nvram *fs;
size_t len_div = 1;
if ((flags & FS_NVRAM_FLAG_SCALE_4))
len_div *= 4;
if ((flags & FS_NVRAM_FLAG_WITH_BACKUP))
len_div *= 2;
if (base == NULL || len < sizeof(struct fs... | fs_nvram_open | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
u_int fs_nvram_padding_at(fs_nvram_t *fs_0, u_int offset) {
u_int padding;
padding = 0;
if ((offset & 3) != 0)
return fs_0->padding - (offset & 3);
return padding;
} | static inline u_int fs_nvram_padding_at(fs_nvram_t *fs, u_int offset) {
u_int padding = 0;
if (offset % 4 != 0)
padding = fs->padding - offset % 4;
return padding;
} | fs_nvram_padding_at | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
m_uint16_t fs_nvram_read16(fs_nvram_t *fs_0, u_int offset) {
m_uint16_t val;
val = fs_0->read_byte(fs_0, offset) << 8;
return fs_0->read_byte(fs_0, offset + 1) | val;
} | static inline m_uint16_t fs_nvram_read16(fs_nvram_t *fs, u_int offset) {
m_uint16_t val;
val = fs->read_byte(fs, offset) << 8;
val |= fs->read_byte(fs, offset + 1);
return (val);
} | fs_nvram_read16 | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
m_uint32_t fs_nvram_read32(fs_nvram_t *fs_0, u_int offset) {
m_uint32_t val;
m_uint32_t vala;
m_uint32_t valb;
val = fs_0->read_byte(fs_0, offset) << 24;
vala = (fs_0->read_byte(fs_0, offset + 1) << 16) | val;
valb = (fs_0->read_byte(fs_0, offset + 2) << 8) | vala;
return fs_0->read_byte(fs_0, offset + 3... | static m_uint32_t fs_nvram_read32(fs_nvram_t *fs, u_int offset) {
m_uint32_t val;
val = fs->read_byte(fs, offset) << 24;
val |= fs->read_byte(fs, offset + 1) << 16;
val |= fs->read_byte(fs, offset + 2) << 8;
val |= fs->read_byte(fs, offset + 3);
return (val);
} | fs_nvram_read32 | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
m_uint8_t fs_nvram_read_byte(fs_nvram_t *fs_0, u_int offset) {
return fs_0->base[offset << fs_0->shift];
} | static m_uint8_t fs_nvram_read_byte(fs_nvram_t *fs, u_int offset) {
m_uint8_t *ptr;
ptr = (m_uint8_t *)fs->base + (offset << fs->shift);
return (*ptr);
} | fs_nvram_read_byte | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
m_uint8_t fs_nvram_read_byte_with_backup(fs_nvram_t *fs_0, u_int offset) {
u_char *base;
base = fs_0->base;
return base[fs_nvram_offset1_with_backup(fs_0, offset)];
} | static m_uint8_t fs_nvram_read_byte_with_backup(fs_nvram_t *fs, u_int offset) {
m_uint8_t *ptr1;
ptr1 = (m_uint8_t *)fs->base + fs_nvram_offset1_with_backup(fs, offset);
#if DEBUG_BACKUP
{
m_uint8_t *ptr2 =
(m_uint8_t *)fs->base + fs_nvram_offset2_with_backup(fs, offset);
if (*ptr1 != *ptr2)
... | fs_nvram_read_byte_with_backup | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int fs_nvram_read_config(fs_nvram_t *fs_0, u_char **startup_config,
size_t *startup_len, u_char **private_config,
size_t *private_len) {
m_uint32_t v6;
m_uint32_t v7;
m_uint32_t v8;
int err;
size_t off;
m_uint32_t offa;
u_char *buf;
fs_nvram_header_priva... | int fs_nvram_read_config(fs_nvram_t *fs, u_char **startup_config,
size_t *startup_len, u_char **private_config,
size_t *private_len) {
int err;
size_t off;
u_char *buf;
struct fs_nvram_header_startup_config startup_head;
struct fs_nvram_header_private_config p... | fs_nvram_read_config | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
u_char *fs_nvram_read_data(fs_nvram_t *fs_0, u_int offset, u_int len) {
u_char *data;
data = (u_char *)malloc(len + 1);
if (!data)
return 0;
fs_nvram_memcpy_from(fs_0, offset, data, len);
data[len] = 0;
return data;
} | static inline u_char *fs_nvram_read_data(fs_nvram_t *fs, u_int offset,
u_int len) {
u_char *data;
data = (u_char *)malloc(len + 1);
if (data == NULL)
return NULL;
fs_nvram_memcpy_from(fs, offset, data, len);
data[len] = 0;
return data;
} | fs_nvram_read_data | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_update_checksum(fs_nvram_t *fs_0) {
u_int offset;
u_int count;
m_uint32_t sum;
sum = 0;
fs_nvram_write16(fs_0, 0xCu, 0);
offset = 8;
for (count = fs_0->len - 8; count > 1; count -= 2) {
sum += fs_nvram_read16(fs_0, offset);
offset += 2;
}
if (count)
sum += fs_0->read_byte(fs... | static void fs_nvram_update_checksum(fs_nvram_t *fs) {
u_int offset, count;
m_uint32_t sum = 0;
fs_nvram_write16(
fs,
sizeof(struct fs_nvram_header) +
offsetof(struct fs_nvram_header_startup_config, checksum),
0x0000);
offset = sizeof(struct fs_nvram_header);
count = fs->len - of... | fs_nvram_update_checksum | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int fs_nvram_verify(fs_nvram_t *fs_0, u_int what) {
u_char *base;
u_char *v4;
m_uint32_t v5;
m_uint8_t b1;
size_t offset;
size_t offseta;
fs_nvram_header_private_config private_head;
fs_nvram_header_startup_config startup_head;
unsigned long v11;
v11 = __readfsqword(0x28u);
if (!fs_0)
return ... | int fs_nvram_verify(fs_nvram_t *fs, u_int what) {
size_t offset;
if (fs == NULL)
return (EINVAL);
if ((what & FS_NVRAM_VERIFY_BACKUP)) {
if ((fs->flags & FS_NVRAM_FLAG_WITH_BACKUP)) {
for (offset = 0; offset < fs->len; offset++) {
m_uint8_t b1 = fs->base[fs_nvram_offset1_with_backup(fs, of... | fs_nvram_verify | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_write16(fs_nvram_t *fs_0, u_int offset, m_uint16_t val) {
m_uint8_t vala;
vala = val;
fs_0->write_byte(fs_0, offset, HIBYTE(val));
fs_0->write_byte(fs_0, offset + 1, vala);
} | static void fs_nvram_write16(fs_nvram_t *fs, u_int offset, m_uint16_t val) {
fs->write_byte(fs, offset, val >> 8);
fs->write_byte(fs, offset + 1, val & 0xFF);
} | fs_nvram_write16 | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_write32(fs_nvram_t *fs_0, u_int offset, m_uint32_t val) {
fs_0->write_byte(fs_0, offset, HIBYTE(val));
fs_0->write_byte(fs_0, offset + 1, BYTE2(val));
fs_0->write_byte(fs_0, offset + 2, BYTE1(val));
fs_0->write_byte(fs_0, offset + 3, val);
} | _Unused static void fs_nvram_write32(fs_nvram_t *fs, u_int offset,
m_uint32_t val) {
fs->write_byte(fs, offset, val >> 24);
fs->write_byte(fs, offset + 1, val >> 16);
fs->write_byte(fs, offset + 2, val >> 8);
fs->write_byte(fs, offset + 3, val & 0xFF);
} | fs_nvram_write32 | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_write_byte(fs_nvram_t *fs_0, u_int offset, m_uint8_t val) {
fs_0->base[offset << fs_0->shift] = val;
} | static void fs_nvram_write_byte(fs_nvram_t *fs, u_int offset, m_uint8_t val) {
m_uint8_t *ptr;
ptr = (m_uint8_t *)fs->base + (offset << fs->shift);
*ptr = val;
} | fs_nvram_write_byte | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void fs_nvram_write_byte_with_backup(fs_nvram_t *fs_0, u_int offset,
m_uint8_t val) {
u_char *base;
u_char *v4;
u_int v5;
m_uint8_t *ptr1;
base = fs_0->base;
ptr1 = &base[fs_nvram_offset1_with_backup(fs_0, offset)];
v4 = fs_0->base;
v5 = fs_nvram_offset2_with_backup... | static void fs_nvram_write_byte_with_backup(fs_nvram_t *fs, u_int offset,
m_uint8_t val) {
m_uint8_t *ptr1;
m_uint8_t *ptr2;
ptr1 = (m_uint8_t *)fs->base + fs_nvram_offset1_with_backup(fs, offset);
ptr2 = (m_uint8_t *)fs->base + fs_nvram_offset2_with_backup(fs, offse... | fs_nvram_write_byte_with_backup | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int fs_nvram_write_config(fs_nvram_t *fs_0, const u_char *startup_config,
size_t startup_len, const u_char *private_config,
size_t private_len) {
m_uint16_t v6;
unsigned long len;
size_t padding;
size_t offa;
size_t off;
fs_nvram_header_private_config priv... | int fs_nvram_write_config(fs_nvram_t *fs, const u_char *startup_config,
size_t startup_len, const u_char *private_config,
size_t private_len) {
size_t len;
size_t off;
size_t padding;
struct fs_nvram_header_startup_config startup_head;
struct fs_nvram_header... | fs_nvram_write_config | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
const char *private_filename;
nvram_format *fmt;
private_filename = 0;
puts("Cisco NVRAM configuration export.");
puts(aCopyrightC2013);
if (argc <= 2 || argc > 4) {
fprintf(stderr, "Usage: %s nvram_file config_file [private_file]\n", *argv);
... | int main(int argc, char *argv[]) {
const char *nvram_filename;
const char *startup_filename;
const char *private_filename = NULL;
struct nvram_format *fmt;
printf("Cisco NVRAM configuration export.\n");
printf("Copyright (c) 2013 Flávio J. Saraiva.\n\n");
if (argc < 3 || argc > 4) {
fprintf(stderr, ... | main | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void native_to_be16(m_uint16_t *val) {
m_uint16_t u;
LOBYTE(u) = HIBYTE(*val);
HIBYTE(u) = *val;
*val = u;
} | static inline void native_to_be16(m_uint16_t *val) {
union {
m_uint16_t val;
m_uint8_t b[2];
} u;
u.b[0] = (m_uint8_t)(*val >> 8);
u.b[1] = (m_uint8_t)(*val & 0xFF);
*val = u.val;
} | native_to_be16 | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void native_to_be32(m_uint32_t *val) {
m_uint32_t u;
LOBYTE(u) = HIBYTE(*val);
BYTE1(u) = BYTE2(*val);
BYTE2(u) = BYTE1(*val);
HIBYTE(u) = *val;
*val = u;
} | static inline void native_to_be32(m_uint32_t *val) {
union {
m_uint32_t val;
m_uint8_t b[4];
} u;
u.b[0] = (m_uint8_t)(*val >> 24);
u.b[1] = (m_uint8_t)(*val >> 16);
u.b[2] = (m_uint8_t)(*val >> 8);
u.b[3] = (m_uint8_t)(*val & 0xFF);
*val = u.val;
} | native_to_be32 | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void native_to_be_header_private(fs_nvram_header_private_config *head) {
native_to_be16(&head->magic);
native_to_be16(&head->format);
native_to_be32(&head->start);
native_to_be32(&head->end);
native_to_be32(&head->len);
} | static void
native_to_be_header_private(struct fs_nvram_header_private_config *head) {
native_to_be16(&head->magic);
native_to_be16(&head->format);
native_to_be32(&head->start);
native_to_be32(&head->end);
native_to_be32(&head->len);
} | native_to_be_header_private | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
void native_to_be_header_startup(fs_nvram_header_startup_config *head) {
native_to_be16(&head->magic);
native_to_be16(&head->format);
native_to_be16(&head->checksum);
native_to_be16(&head->unk1);
native_to_be32(&head->start);
native_to_be32(&head->end);
native_to_be32(&head->len);
native_to_be32(&head->... | static void
native_to_be_header_startup(struct fs_nvram_header_startup_config *head) {
native_to_be16(&head->magic);
native_to_be16(&head->format);
native_to_be16(&head->checksum);
native_to_be16(&head->unk1);
native_to_be32(&head->start);
native_to_be32(&head->end);
native_to_be32(&head->len);
native_t... | native_to_be_header_startup | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int nvram_export_config(const char *nvram_filename,
const char *startup_filename,
const char *private_filename) {
u_char *data;
u_char *startup_config;
u_char *private_config;
size_t data_len;
size_t startup_len;
size_t private_len;
size_t len;
nvram_forma... | int nvram_export_config(const char *nvram_filename,
const char *startup_filename,
const char *private_filename) {
u_char *data = NULL;
u_char *startup_config = NULL;
u_char *private_config = NULL;
size_t data_len = 0;
size_t startup_len = 0;
size_t private_len... | nvram_export_config | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int read_file(const char *filename, u_char **data, size_t *data_len) {
FILE *fd;
signed long len;
fd = fopen64(filename, "rb");
if (!fd)
return -1;
fseek(fd, 0, 2);
len = ftell(fd);
fseek(fd, 0, 0);
if (len < 0 || ferror(fd)) {
fclose(fd);
return -1;
} else {
if (data_len)
*data... | int read_file(const char *filename, u_char **data, size_t *data_len) {
FILE *fd;
long len;
fd = fopen(filename, "rb");
if (fd == NULL) {
return (-1);
}
fseek(fd, 0, SEEK_END);
len = ftell(fd);
fseek(fd, 0, SEEK_SET);
if (len < 0 || ferror(fd)) {
fclose(fd);
return (-1);
}
if (data_l... | read_file | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int uncompress_LZC(const u_char *in_data, u_int in_len, u_char *out_data,
u_int out_len) {
int v5;
int v6;
int v7;
int v8;
u_int v9;
m_uint32_t v10;
m_uint8_t needPrev;
m_uint8_t blockMode;
int err;
u_int in_pos;
u_int out_pos;
int numBits;
m_uint32_t head;
u_int bitPos;
... | static int uncompress_LZC(const u_char *in_data, u_int in_len, u_char *out_data,
u_int out_len) {
#define LZC_MAGIC_1 0x1F
#define LZC_MAGIC_2 0x9D
#define LZC_NUM_BITS_MASK 0x1F
#define LZC_BLOCK_MODE_MASK 0x80
#define LZC_NUM_BITS_MIN 9
#define LZC_NUM_BITS_MAX 16
m_uint16_t *parents = NUL... | uncompress_LZC | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int write_file(const char *filename, u_char *data, size_t len) {
FILE *fp;
fp = fopen64(filename, "wb+");
if (!fp)
return -1;
if (fwrite(data, len, 1u, fp) == 1) {
fclose(fp);
return 0;
} else {
fclose(fp);
return -1;
}
} | int write_file(const char *filename, u_char *data, size_t len) {
FILE *fp;
fp = fopen(filename, "wb+");
if (fp == NULL) {
return (-1);
}
if (fwrite(data, len, 1, fp) != 1) {
fclose(fp);
return (-1);
}
fclose(fp);
return (0);
} | write_file | dynamips-0.2.21 | app-emulation | O0/app-emulation/dynamips-0.2.21/nvram_export | ida | O0 |
int detokenize(libspectrum_word offset, int length, memory_read_fn get_byte,
void *data) {
char keyword_next;
char quote;
char rem;
bool space;
char nextfirst;
char nextspace;
short first;
int i;
keyword_next = 1;
quote = 0;
rem = 0;
nextfirst = 1;
space = betabasic == 0;
for... | int detokenize(libspectrum_word offset, int length, memory_read_fn get_byte,
void *data) {
int i;
libspectrum_byte b;
char keyword_next = 1, quote = 0, rem = 0;
char space;
char first;
char nextfirst = 1;
static const char keyword[][12] = {
" SPECTRUM ", " PLAY ", "RND", "... | detokenize | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
int extract_basic(libspectrum_word offset, libspectrum_word end,
memory_read_fn get_byte, void *data) {
int v4;
int v5;
libspectrum_word offsetb;
libspectrum_word offsetc;
int line_number;
int line_length;
int error;
while (!end || offset < end) {
v4 = get_byte(offset, data) << 8;... | int extract_basic(libspectrum_word offset, libspectrum_word end,
memory_read_fn get_byte, void *data) {
int line_number, line_length;
int error;
while (!end || offset < end) {
line_number = get_byte(offset, data) << 8 | get_byte(offset + 1, data);
offset += 2;
if (line_number >= 16... | extract_basic | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int i;
const char **argva;
libspectrum_id_t type;
libspectrum_class_t v7;
int error;
int c;
unsigned char *buffer;
size_t length;
option long_options[3];
unsigned long v13;
v13 = __readfsqword(0x28u);
error = 0;
long_options[0].name =... | int main(int argc, char *argv[]) {
unsigned char *buffer;
size_t length;
libspectrum_id_t type;
libspectrum_class_t class;
int c;
int error = 0;
struct option long_options[] = {
{"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {0, 0, 0, 0}};
progname = argv[0];
while ((c = getopt_long(argc... | main | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
int parse_snapshot_file(const unsigned char *buffer, size_t length,
libspectrum_id_t type) {
short snap_memory;
int program_address;
int error;
int errora;
libspectrum_snap *snap;
snap = (libspectrum_snap *)libspectrum_snap_alloc();
error = libspectrum_snap_read(snap, buffer, leng... | int parse_snapshot_file(const unsigned char *buffer, size_t length,
libspectrum_id_t type) {
libspectrum_snap *snap = libspectrum_snap_alloc();
libspectrum_word program_address;
int error;
error = libspectrum_snap_read(snap, buffer, length, type, NULL);
if (error) {
libspectrum_s... | parse_snapshot_file | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
int parse_tape_file(const unsigned char *buffer, size_t length,
libspectrum_id_t type) {
libspectrum_word program_length;
int error;
int errora;
int errorb;
libspectrum_tape_iterator iterator;
libspectrum_tape_block *tape_block;
libspectrum_tape *tape;
libspectrum_byte *data;
unsig... | int parse_tape_file(const unsigned char *buffer, size_t length,
libspectrum_id_t type) {
libspectrum_tape *tape = libspectrum_tape_alloc();
libspectrum_tape_iterator iterator;
libspectrum_tape_block *tape_block;
libspectrum_byte *data;
libspectrum_word program_length;
int error;
erro... | parse_tape_file | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
char print_keyword(const char *keyword, char space) {
if (space || *keyword != 32)
printf("%s", keyword);
else
printf("%s", keyword + 1);
return keyword[strlen(keyword) - 1] != 32;
} | static char print_keyword(const char *keyword, char space) {
char last_char;
if (!space && keyword[0] == ' ') {
printf("%s", keyword + 1);
} else {
printf("%s", keyword);
}
last_char = keyword[strlen(keyword) - 1];
return (last_char != ' ');
} | print_keyword | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
libspectrum_byte read_snap_memory(libspectrum_word address, void *data) {
int v2;
v2 = address >> 14;
if (v2 == 3)
return *(_BYTE *)(libspectrum_snap_pages(data, 0) + (address & 0x3FFF));
if ((unsigned short)(address >> 14) > 3u) {
fprintf(stderr, "%s: attempt to read from address %x\n", progname, addr... | libspectrum_byte read_snap_memory(libspectrum_word address, void *data) {
libspectrum_snap *snap = data;
switch (address >> 14) {
case 0:
fprintf(stderr, "%s: attempt to read from ROM\n", progname);
exit(1);
case 1:
return libspectrum_snap_pages(snap, 5)[address & 0x3fff];
case 2:
return ... | read_snap_memory | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
libspectrum_byte read_tape_block(libspectrum_word offset, void *data) {
if (offset > (unsigned long)libspectrum_tape_block_data_length(data)) {
fprintf(stderr, "%s: attempt to read past end of block\n", progname);
exit(1);
}
return *(_BYTE *)(offset + libspectrum_tape_block_data(data));
} | libspectrum_byte read_tape_block(libspectrum_word offset, void *data) {
libspectrum_tape_block *tape_block = data;
if (offset > libspectrum_tape_block_data_length(tape_block)) {
fprintf(stderr, "%s: attempt to read past end of block\n", progname);
exit(1);
}
return libspectrum_tape_block_data(tape_blo... | read_tape_block | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
void show_help() {
printf(
"Usage: %s [OPTION] <file>\n"
"Extracts the BASIC listing from a ZX Spectrum snapshot or tape file.\n"
"\n"
"Options:\n"
" -b Specifies that the program to list is a Beta BASIC "
"program.\n"
" -h, --help Display this help and exit... | static void show_help(void) {
printf(
"Usage: %s [OPTION] <file>\n"
"Extracts the BASIC listing from a ZX Spectrum snapshot or tape file.\n"
"\n"
"Options:\n"
" -b Specifies that the program to list is a Beta BASIC "
"program.\n"
" -h, --help Display this he... | show_help | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
void show_version() {
puts("listbasic (fuse-utils) 1.4.3\n"
"Copyright (c) 2002 Chris Cowley\n"
"Copyright (c) 2003 Philip Kendall, Darren Salt\n"
"Copyright (c) 2007 Stuart Brady\n"
"License GPLv2+: GNU GPL version 2 or later "
"<http://gnu.org/licenses/gpl.html>\n"
"This is... | static void show_version(void) {
printf(PROGRAM_NAME
" (" PACKAGE ") " PACKAGE_VERSION "\n"
"Copyright (c) 2002 Chris Cowley\n"
"Copyright (c) 2003 Philip Kendall, Darren Salt\n"
"Copyright (c) 2007 Stuart Brady\n"
"License GPLv2+: GNU GPL version 2 or later "
"<h... | show_version | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/listbasic | ida | O0 |
char *compat_basename(char *path) { return __xpg_basename(path); } | char *compat_basename(char *path) { return basename(path); } | compat_basename | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int do_file(const char *filename) {
size_t v2;
size_t v3;
size_t v4;
unsigned char *v5;
size_t v6;
unsigned char *v7;
unsigned char *v8;
libspectrum_dword v9;
unsigned char *v10;
unsigned char id;
int error;
int errora;
unsigned char *buffer;
unsigned char *ptr;
size_t length;
unsigned c... | static int do_file(const char *filename) {
unsigned char *buffer, *ptr, *end;
size_t length;
int error;
printf("Examining file %s\n", filename);
error = read_file(filename, &buffer, &length);
if (error)
return error;
ptr = buffer;
end = buffer + length;
if (end - ptr < (ptrdiff_t)strlen(rzx_si... | do_file | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
char *get_snap_filename(const char *rzx_archive, const char *extension,
size_t number) {
char *buffer;
const char *buffer2;
char *last_dot;
size_t snap_filename_len;
char *snap_filename;
buffer = strdup(rzx_archive);
if (buffer) {
buffer2 = compat_basename(buffer);
last_do... | static char *get_snap_filename(const char *rzx_archive, const char *extension,
size_t number) {
char *buffer, *buffer2, *last_dot, *snap_filename;
size_t snap_filename_len;
buffer = strdup(rzx_archive);
if (!buffer) {
fprintf(stderr, "out of memory at %s:%d", __FILE__, __LINE... | get_snap_filename | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int j;
char **argva;
int argca;
int i;
int error;
int errora;
option long_options[3];
unsigned long v11;
v11 = __readfsqword(0x28u);
error = 0;
long_options[0].name = "help";
long_options[0].has_arg = 0;
long_options[0].flag = 0;
lo... | int main(int argc, char **argv) {
int i, c;
int error = 0;
struct option long_options[] = {
{"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {0, 0, 0, 0}};
progname = argv[0];
while ((c = getopt_long(argc, argv, "shV", long_options, NULL)) != -1) {
switch (c) {
case 's':
dump_snapsh... | main | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
void print_ascii_string(unsigned char *data, size_t length) {
unsigned char c;
unsigned int i;
for (i = 0; length > i; ++i) {
if (data[i] <= 0x1Fu || data[i] > 0x7Eu)
c = 63;
else
c = data[i];
putchar(c);
}
} | static void print_ascii_string(unsigned char *data, size_t length) {
unsigned int i;
for (i = 0; i < length; i++) {
unsigned char c;
if (data[i] >= 32 && data[i] < 127) {
c = data[i];
} else {
c = '?';
}
printf("%c", c);
}
} | print_ascii_string | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
void print_canonical_version(const char *creator,
libspectrum_word major_version,
libspectrum_word minor_version) {
printf(" Creator canonical version: ");
if (!strncmp(creator, "Fuse", 4u) || !strncmp(creator, "rzxtool", 7u)) {
printf("%d.%d.%d.%d\n", ... | static void print_canonical_version(const char *creator,
libspectrum_word major_version,
libspectrum_word minor_version) {
printf(" Creator canonical version: ");
if (!strncmp(creator, "Fuse", strlen("Fuse")) ||
!strncmp(creator, "rzxto... | print_canonical_version | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int read_creator_block(unsigned char **ptr, unsigned char *end) {
libspectrum_word major_version;
libspectrum_word minor_version;
size_t length;
unsigned char *creator;
if (end - *ptr > 27) {
puts("Found a creator block");
length = read_dword(ptr);
printf(" Length: %lu bytes\n", length);
cre... | static int read_creator_block(unsigned char **ptr, unsigned char *end) {
size_t length;
libspectrum_word major_version, minor_version;
unsigned char *creator;
if (end - *ptr < 28) {
fprintf(stderr, "%s: Not enough bytes for creator block\n", progname);
return 1;
}
printf("Found a creator block\n")... | read_creator_block | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
libspectrum_dword read_dword(unsigned char **ptr) {
int v1;
int v2;
v1 = ((*ptr)[2] << 16) + ((*ptr)[1] << 8) + **ptr;
v2 = (*ptr)[3] << 24;
*ptr += 4;
return v1 + v2;
} | libspectrum_dword read_dword(unsigned char **ptr) {
libspectrum_dword result = (*ptr)[0] + (*ptr)[1] * 0x100 +
(*ptr)[2] * 0x10000 + (*ptr)[3] * 0x1000000;
(*ptr) += 4;
return result;
} | read_dword | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int read_input_block(unsigned char **ptr, unsigned char *end) {
unsigned char *v3;
libspectrum_dword dword;
libspectrum_word word;
libspectrum_dword flags;
size_t i;
size_t length;
size_t frames;
signed long count;
if (end - *ptr > 16) {
puts("Found an input recording block");
printf(" Block... | static int read_input_block(unsigned char **ptr, unsigned char *end) {
size_t i, frames, length;
int flags;
if (end - *ptr < 17) {
fprintf(stderr, "%s: Not enough bytes for input recording block\n",
progname);
return 1;
}
printf("Found an input recording block\n");
printf(" Block: %l... | read_input_block | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int read_sign_end_block(unsigned char **ptr, unsigned char *end) {
size_t lengtha;
signed long length;
if (end - *ptr <= 3 ||
(puts("Found a signed data end block"), lengtha = read_dword(ptr),
printf(" Length: %lu bytes\n", lengtha), length = lengtha - 5,
end - *ptr < length)) {
fprintf(... | static int read_sign_end_block(unsigned char **ptr, unsigned char *end) {
size_t length;
#ifdef HAVE_GCRYPT_H
gcry_mpi_t a;
int error;
size_t length2;
unsigned char *buffer;
#endif
if (end - *ptr < 4) {
fprintf(stderr, "%s: not enough bytes for sign end block\n", progname);
return 1;
}
printf(... | read_sign_end_block | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int read_sign_start_block(unsigned char **ptr, unsigned char *end) {
libspectrum_dword dword;
libspectrum_dword v4;
size_t length;
if (end - *ptr > 7) {
puts("Found a signed data start block");
length = read_dword(ptr);
printf(" Length: %lu bytes\n", length);
dword = read_dword(ptr);
print... | static int read_sign_start_block(unsigned char **ptr, unsigned char *end) {
size_t length;
if (end - *ptr < 8) {
fprintf(stderr, "%s: not enough bytes for sign start block\n", progname);
return 1;
}
printf("Found a signed data start block\n");
length = read_dword(ptr);
printf(" Length: %lu byte... | read_sign_start_block | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int read_snapshot_block(unsigned char **ptr, unsigned char *end,
const char *rzx_filename) {
libspectrum_dword dword;
libspectrum_dword v5;
libspectrum_dword flags;
size_t block_length;
char *snap_extension;
char *snap_filename;
if (end - *ptr <= 15)
goto LABEL_2;
puts("Foun... | static int read_snapshot_block(unsigned char **ptr, unsigned char *end,
const char *rzx_filename) {
size_t block_length, path_length;
libspectrum_dword flags;
char *snap_filename, *snap_extension;
if (end - *ptr < 16) {
fprintf(stderr, "%s: Not enough bytes for snapshot block... | read_snapshot_block | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
libspectrum_word read_word(unsigned char **ptr) {
short v1;
short v2;
v1 = **ptr;
v2 = (*ptr)[1] << 8;
*ptr += 2;
return v1 + v2;
} | libspectrum_word read_word(unsigned char **ptr) {
libspectrum_word result = (*ptr)[0] + (*ptr)[1] * 0x100;
(*ptr) += 2;
return result;
} | read_word | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
void show_help() {
printf("Usage: %s [OPTION] <rzxfile>...\n"
"List contents of Sinclair ZX Spectrum input recording files.\n"
"\n"
"Options:\n"
" -s Dump snapshots to files.\n"
" -h, --help Display this help and exit.\n"
" -V, --version Output... | static void show_help(void) {
printf("Usage: %s [OPTION] <rzxfile>...\n"
"List contents of Sinclair ZX Spectrum input recording files.\n"
"\n"
"Options:\n"
" -s Dump snapshots to files.\n"
" -h, --help Display this help and exit.\n"
" -V, --vers... | show_help | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
void show_version() {
puts("rzxdump (fuse-utils) 1.4.3\n"
"Copyright (c) 2002-2014 Philip Kendall\n"
"License GPLv2+: GNU GPL version 2 or later "
"<http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to ... | static void show_version(void) {
printf(PROGRAM_NAME
" (" PACKAGE ") " PACKAGE_VERSION "\n"
"Copyright (c) 2002-2014 Philip Kendall\n"
"License GPLv2+: GNU GPL version 2 or later "
"<http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and re... | show_version | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
void write_snapshot(const char *filename, const unsigned char *buffer,
size_t length, int compressed) {
size_t new_length;
libspectrum_byte *new_buffer[2];
new_buffer[1] = (libspectrum_byte *)__readfsqword(0x28u);
if (compressed) {
new_length = 0;
new_buffer[0] = 0;
if (!(unsign... | static void write_snapshot(const char *filename, const unsigned char *buffer,
size_t length, int compressed) {
libspectrum_error error;
if (!compressed) {
write_file(filename, buffer, length);
} else {
#ifdef LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION
size_t new_length = 0;
lib... | write_snapshot | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/rzxdump | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int v3;
const char **v4;
int v5;
const char **v6;
unsigned int v7;
const char *v8;
char v9;
FILE *v10;
FILE *v12;
long v13;
const char *v14;
ssize_t v15;
long v16;
int *v17;
char *v18;
int *v19;
char *v20;
char *v21;
int *v... | int main(int argc, char *argv[]) {
int i;
int rc;
int level = -1;
int force = 0;
CCKDDASD_DEVHDR cdevhdr;
DEVBLK devblk;
DEVBLK *dev = &devblk;
INITIALIZE_UTILITY("cckdcomp");
for (argc--, argv++; argc > 0; argc--, argv++) {
if (**argv != '-')
break;
switch (argv[0][1]) {
case '0'... | main | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/cckdcomp | ida | O0 |
int syntax() {
fwrite("\n"
"cckdcomp [-v] [-f] [-level] file1 [file2 ... ]\n"
"\n"
" -v display version and exit\n"
"\n"
" -f force check even if OPENED bit is on\n"
"\n"
" chkdsk level is a digit 0 - 3:\n"
" ... | int syntax() {
fprintf(stderr, "\ncckdcomp [-v] [-f] [-level] file1 [file2 ... ]\n"
"\n"
" -v display version and exit\n"
"\n"
" -f force check even if OPENED bit is on\n"
"\n"
" ... | syntax | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/cckdcomp | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int i;
char **argva;
int error;
int errora;
libspectrum_tape *tzx;
option long_options[3];
unsigned long v10;
v10 = __readfsqword(0x28u);
error = 0;
progname = (char *)*argv;
long_options[0].name = "help";
long_options[0].has_arg = 0;
... | int main(int argc, char **argv) {
int c, error = 0;
libspectrum_tape *tzx;
progname = argv[0];
struct option long_options[] = {
{"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {0, 0, 0, 0}};
while ((c = getopt_long(argc, argv, "hV", long_options, NULL)) != -1) {
switch (c) {
case 'h':
... | main | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/tape2pulses | ida | O0 |
int read_tape(char *filename, libspectrum_tape **tape) {
libspectrum_byte *buffer;
size_t length[2];
length[1] = __readfsqword(0x28u);
if (read_file(filename, &buffer, length))
return 1;
*tape = (libspectrum_tape *)libspectrum_tape_alloc();
if ((unsigned int)libspectrum_tape_read(*tape, buffer, length[... | static int read_tape(char *filename, libspectrum_tape **tape) {
libspectrum_byte *buffer;
size_t length;
if (read_file(filename, &buffer, &length))
return 1;
*tape = libspectrum_tape_alloc();
if (libspectrum_tape_read(*tape, buffer, length, LIBSPECTRUM_ID_UNKNOWN,
filename))... | read_tape | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/tape2pulses | ida | O0 |
void show_help() {
printf("Usage: %s [OPTION] <infile> <outfile>\n"
"Dumps the pulse information from ZX Spectrum tape images to text "
"files.\n"
"\n"
"Options:\n"
" -h, --help Display this help and exit.\n"
" -V, --version Output version information and e... | static void show_help(void) {
printf("Usage: %s [OPTION] <infile> <outfile>\n"
"Dumps the pulse information from ZX Spectrum tape images to text "
"files.\n"
"\n"
"Options:\n"
" -h, --help Display this help and exit.\n"
" -V, --version Output version inform... | show_help | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/tape2pulses | ida | O0 |
void show_version() {
puts("tape2pulses (fuse-utils) 1.4.3\n"
"Copyright (c) 2016 Fredrick Meunier\n"
"License GPLv2+: GNU GPL version 2 or later "
"<http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to... | static void show_version(void) {
printf(PROGRAM_NAME
" (" PACKAGE ") " PACKAGE_VERSION "\n"
"Copyright (c) 2016 Fredrick Meunier\n"
"License GPLv2+: GNU GPL version 2 or later "
"<http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redis... | show_version | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/tape2pulses | ida | O0 |
int write_pulses(char *filename, libspectrum_tape *tape) {
int *v2;
char *v3;
short level;
libspectrum_dword pulse_tstates;
int flags;
libspectrum_dword balance_tstates;
FILE *output_file;
unsigned long v11;
v11 = __readfsqword(0x28u);
level = 0;
pulse_tstates = 0;
balance_tstates = 0;
flags ... | static int write_pulses(char *filename, libspectrum_tape *tape) {
libspectrum_error error;
short level = 0;
libspectrum_dword pulse_tstates = 0;
libspectrum_dword balance_tstates = 0;
int flags = 0;
FILE *output_file;
if (strncmp(filename, "-", 1) == 0) {
output_file = stdout;
} else {
output_f... | write_pulses | fuse-utils-1.4.3-r1 | app-emulation | O0/app-emulation/fuse-utils-1.4.3-r1/tape2pulses | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int v3;
const char **v4;
int v5;
const char **v6;
int v7;
long v8;
unsigned int v9;
const char *v10;
char v11;
FILE *v12;
FILE *v14;
long v15;
unsigned int v16;
ssize_t v17;
int *v18;
char *v19;
int *v20;
char *v21;
char *v... | int main(int argc, char *argv[]) {
int i;
int rc;
int level = 1;
int ro = 0;
int force = 0;
CCKDDASD_DEVHDR cdevhdr;
DEVBLK devblk;
DEVBLK *dev = &devblk;
INITIALIZE_UTILITY("cckdcdsk");
for (argc--, argv++; argc > 0; argc--, argv++) {
if (**argv != '-')
break;
switch (argv[0][1]) {... | main | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/cckdcdsk | ida | O0 |
int syntax() {
fwrite(
"\n"
"cckdcdsk [-v] [-f] [-level] [-ro] file1 [file2 ...]\n"
"\n"
" -v display version and exit\n"
"\n"
" -f force check even if OPENED bit is on\n"
"\n"
" level is a digit 0 - 4:\n"
" -0 -- minimal checking (hd... | int syntax() {
fprintf(stderr,
_("\ncckdcdsk [-v] [-f] [-level] [-ro] file1 [file2 ...]\n"
"\n"
" -v display version and exit\n"
"\n"
" -f force check even if OPENED bit is on\n"
"\n"
" level is a digit 0 - 4:\n"
... | syntax | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/cckdcdsk | ida | O0 |
void AddFile() {
FileDetails *f;
f = (FileDetails *)calloc(1u, 0x50u);
if (!f)
Error((STRPTR) "Out of memory (AddFile)", 0);
strcpy((char *)f, (const char *)FName);
f->In = In;
f->LineNo = LineNo;
f->Prev = Fd;
Fd = f;
} | VOID AddFile() {
struct FileDetails *f;
f = (struct FileDetails *)calloc(1, sizeof(struct FileDetails));
if (!f)
Error("Out of memory (AddFile)", FALSE);
strcpy(f->FName, FName);
f->In = In;
f->LineNo = LineNo;
f->Prev = Fd;
Fd = f;
} | AddFile | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
SymTab AddSymbol(STRPTR Sym, ULONG Val, BOOL SetUp) {
SymTabType *ST;
SymTab S;
ST = SymBase;
S = (SymTab)calloc(1u, 0x60u);
if (!S)
Error((STRPTR) "Out of memory (AddSymbol)", 0);
strcpy((char *)S, (const char *)Sym);
if (SetUp) {
S->Val = Val;
S->SetUp = 1;
}
if (Debug)
printf("\t\t... | SymTab AddSymbol(STRPTR Sym, ULONG Val, BOOL SetUp) {
SymTab ST, S;
ST = SymBase;
S = (SymTab)calloc(1, sizeof(struct SymTabType));
if (!S)
Error("Out of memory (AddSymbol)", FALSE);
strcpy(S->Name, Sym);
if (SetUp) {
S->Val = Val;
S->SetUp = TRUE;
}
if (Debug)
printf("\t\t\tAddSymb... | AddSymbol | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void Assemble() {
unsigned int v0;
WORD Count;
BOOL Loop;
WORD Opcode;
Count = 0;
WasSym = 0;
do {
Opcode = LookForOp();
if (Opcode) {
if (++Count == 1)
ProcessOpcode(Opcode);
Loop = 0;
} else {
WasSym = 0;
v0 = *ptr;
Loop = (v0 > 0x3B || ((1LL << v0) & 0... | VOID Assemble() {
WORD Opcode, Count = 0;
BOOL Loop = TRUE;
WasSym = FALSE;
do {
Opcode = LookForOp();
if (Opcode) {
if (++Count == 1)
ProcessOpcode(Opcode);
Loop = FALSE;
} else {
WasSym = FALSE;
switch (*ptr) {
case ';':
case '\n':
case 0:
... | Assemble | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
BOOL CheckReg(ULONG *Val) {
unsigned int v1;
BOOL Reg;
unsigned long Ind;
Reg = 0;
v1 = *ptr - 70;
if (v1 <= 0x2D && ((1LL << v1) & 0x300100003001LL) != 0 &&
((*__ctype_b_loc())[ptr[1]] & 0x800) != 0) {
Ind = atol((const char *)ptr + 1);
if (Ind <= 0x1F) {
Reg = 1;
*Val = Ind;
... | BOOL CheckReg(ULONG *Val) {
BOOL Reg = FALSE;
ULONG Ind;
switch (*ptr) {
case 'r':
case 'R':
case 'f':
case 'F':
case 's':
case 'S':
if (isdigit(*(ptr + 1))) {
Ind = atol(ptr + 1);
if (Ind < 32) {
Reg = TRUE;
*Val = Ind;
}
}
}
return Reg;
} | CheckReg | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
STRPTR CollectSym(STRPTR p, STRPTR Str) {
WORD v2;
WORD i;
BOOL Loop;
i = 0;
Loop = 1;
do {
switch (*p) {
case 9u:
case 0xAu:
case 0x20u:
case 0x21u:
case 0x22u:
case 0x26u:
case 0x27u:
case 0x28u:
case 0x29u:
case 0x2Au:
case 0x2Bu:
case 0x2Cu:
case ... | STRPTR CollectSym(STRPTR p, STRPTR Str) {
WORD i = 0;
BOOL Loop = TRUE;
do {
switch (*p) {
case ' ':
case ',':
case '\t':
case ';':
case '*':
case '+':
case '\n':
case '-':
case '/':
case '&':
case '!':
case '=':
case ')':
case '(':
case ':':
ca... | CollectSym | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void Control(ULONG Pseudo) {
STRPTR v1;
size_t v2;
BOOL InQuote;
int j;
int ja;
int jb;
LONG Val;
unsigned long Vala;
unsigned long Valb;
LONG Valc;
LONG Vald;
char Txt[88];
unsigned long v13;
v13 = __readfsqword(0x28u);
if (Debug)
printf("\t\t\tPseudo %ld >%s<\n", Pseudo, (const char... | VOID Control(ULONG Pseudo) {
int j;
UBYTE Txt[80];
ULONG Val;
BOOL InQuote;
if (Debug)
printf("\t\t\tPseudo %ld >%s<\n", Pseudo, ptr);
switch (Pseudo) {
case PSEUDO_DCB:
case PSEUDO_DCH:
case PSEUDO_DCW:
InQuote = FALSE;
if (Listing) {
fprintf(Lst, "%08lX : ", Addr);
LCol = ... | Control | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void CopyMacro(SymTab S) {
BOOL First;
WORD l;
Macro M2;
Macro M;
M2 = 0;
First = 1;
S->Mac = 1;
S->Val = 0;
while (1) {
GetLine();
if (!strncasecmp((const char *)ptr, "ENDM", 4u))
break;
++S->Val;
M = (Macro)calloc(1u, 0x10u);
if (!M)
Error((STRPTR) "Out of memory (Co... | VOID CopyMacro(SymTab S) {
Macro M, M2 = (Macro)NULL;
WORD l;
BOOL First = TRUE;
S->Mac = TRUE;
S->Val = 0;
while (1) {
GetLine();
if (strnicmp(ptr, "ENDM", 4) == 0)
return;
S->Val++;
M = (Macro)calloc(1, sizeof(struct MacroType));
if (!M)
Error("Out of memory (CopyMacr... | CopyMacro | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void DelMacro(Macro M) {
if (M->NextM)
DelMacro(M->NextM);
free(M->Line);
free(M);
} | VOID DelMacro(Macro M) {
if (M->NextM)
DelMacro(M->NextM);
free(M->Line);
free(M);
} | DelMacro | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void DelSTab(SymTab S) {
if (S) {
DelSTab(S->Left);
DelSTab(S->Right);
if (S->M)
DelMacro(S->M);
free(S);
}
} | VOID DelSTab(SymTab S) {
if (S) {
DelSTab(S->Left);
DelSTab(S->Right);
if (S->M)
DelMacro(S->M);
free(S);
}
} | DelSTab | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void DoPad(ULONG Val) {
do {
if (Val > 1)
OutputByte(0);
if ((Addr & 3) != 0) {
if (Listing) {
fprintf(Lst, "%08lX : ", Addr);
LCol = 11;
}
while ((Addr & 3) != 0) {
OutputByte(0);
if (Listing) {
fwrite("00 ", 1u, 3u, Lst);
LCol += 3;... | VOID DoPad(ULONG Val) {
ULONG Count = Val;
do {
if (Count > 1)
OutputByte(0);
if (Addr % 4 != 0) {
if (Listing) {
fprintf(Lst, "%08lX : ", Addr);
LCol = 11;
}
while (Addr % 4 != 0) {
OutputByte(0);
if (Listing) {
fprintf(Lst, "00 ");
... | DoPad | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void EndFile() {
FileDetails *f;
if (Fd) {
fclose(In);
strcpy((char *)FName, (const char *)Fd);
In = Fd->In;
LineNo = Fd->LineNo;
f = Fd;
Fd = Fd->Prev;
free(f);
} else {
MainLoop = 0;
}
} | VOID EndFile() {
struct FileDetails *f;
if (Fd) {
fclose(In);
strcpy(FName, Fd->FName);
In = Fd->In;
LineNo = Fd->LineNo;
f = Fd;
Fd = Fd->Prev;
free(f);
} else
MainLoop = FALSE;
} | EndFile | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void Error(STRPTR Msg, BOOL PrintLine) {
FileDetails *f;
if (PrintLine) {
fputs((const char *)Line, stderr);
fprintf(stderr, "Error: Line %d ", LineNo);
}
fprintf(stderr, "%s\n", (const char *)Msg);
if (ErrorSym) {
puts("\nSymbol table");
DisplaySymbolTable(0);
}
DeleteSymbolTable();
fc... | VOID Error(STRPTR Msg, BOOL PrintLine) {
struct FileDetails *f;
if (PrintLine) {
fprintf(stderr, "%s", Line);
fprintf(stderr, "Error: Line %d ", LineNo);
}
fprintf(stderr, "%s\n", Msg);
if (ErrorSym) {
printf("\nSymbol table\n");
DisplaySymbolTable(FALSE);
}
DeleteSymbolTable();
fclo... | Error | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void ExpandMacro(SymTab ST) {
WORD v1;
UBYTE *v2;
WORD v3;
unsigned int v4;
WORD PCount;
WORD i;
WORD ia;
WORD j;
WORD k;
Macro M;
UBYTE Params[15][20];
char Txt[56];
unsigned long v13;
long savedregs;
v13 = __readfsqword(0x28u);
PCount = 0;
i = 0;
while (*ptr != 10 && *ptr != 32 &&... | VOID ExpandMacro(SymTab ST) {
UBYTE Params[MAXMACROPARAMS][20], Txt[50];
WORD PCount = 0, i = 0, j, k;
Macro M;
while (*ptr != '\n' && *ptr != ' ' && *ptr != '\t' &&
PCount < MAXMACROPARAMS) {
if (*ptr == ',') {
Params[PCount][i] = 0;
if (Debug)
printf("1Found macro parameter ... | ExpandMacro | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
SymTab FSymbol(SymTab ST, STRPTR Name) {
WORD cmp;
if (!ST)
return 0;
cmp = strcmp((const char *)Name, (const char *)ST);
if (!cmp)
return ST;
if (cmp >= 0)
return FSymbol(ST->Right, Name);
return FSymbol(ST->Left, Name);
} | SymTab FSymbol(SymTab ST, STRPTR Name) {
WORD cmp;
if (!ST)
return (SymTab)NULL;
cmp = strcmp(Name, ST->Name);
if (cmp == 0)
return ST;
if (cmp < 0)
return FSymbol(ST->Left, Name);
return FSymbol(ST->Right, Name);
} | FSymbol | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
SymTab FindSymbol(STRPTR Sym) {
if (Debug)
printf("\t\t\tFindSymbol '%s'\n", (const char *)Sym);
return FSymbol(SymBase, Sym);
} | SymTab FindSymbol(STRPTR Sym) {
if (Debug)
printf("\t\t\tFindSymbol '%s'\n", Sym);
return FSymbol(SymBase, Sym);
} | FindSymbol | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void GenIncHeader() {
time_t tt;
tm *T;
unsigned long v2;
v2 = __readfsqword(0x28u);
fprintf(stderr, "Creating auto-include file %s\n", (const char *)GName);
fprintf(GI, "; Auto-generated include file for %s\n", (const char *)FName);
time(&tt);
T = localtime(&tt);
fprintf(GI, "; Created: %d %s %4d\n\... | VOID GenIncHeader() {
struct tm *T;
time_t tt;
fprintf(stderr, "Creating auto-include file %s\n", GName);
fprintf(GI, "; Auto-generated include file for %s\n", FName);
time(&tt);
T = localtime(&tt);
fprintf(GI, "; Created: %d %s %4d\n\n", T->tm_mday, Months[T->tm_mon],
T->tm_year + 1900);
... | GenIncHeader | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void GetAddr() {
unsigned long Adr;
char Txt[88];
unsigned long v2;
v2 = __readfsqword(0x28u);
ListLine();
++ptr;
SkipWhitespace();
if (*ptr != 61) {
sprintf(Txt, "Unexpected character '%c'", *ptr);
Error((STRPTR)Txt, 1);
}
++ptr;
Adr = GetExprValue(&ptr);
if (CodeGen && Addr && Adr < A... | VOID GetAddr() {
ULONG Adr;
UBYTE Txt[80];
ListLine();
ptr++;
SkipWhitespace();
if (*ptr != '=') {
sprintf(Txt, "Unexpected character '%c'", *ptr);
Error(Txt, TRUE);
}
ptr++;
Adr = GetExprValue(&ptr);
if (CodeGen && Addr && Adr < Addr) {
sprintf(Txt, "Error: New addr < Old (%08lX/... | GetAddr | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
LONG GetExprValue(STRPTR *p) {
int v1;
UBYTE LastOp;
BOOL Loop;
BOOL Lower;
BOOL Upper;
long Val;
long V;
Val = 0;
Loop = 1;
LastOp = 43;
SkipWhitespace();
do {
Lower = 0;
Upper = 0;
v1 = **p;
if (v1 == 60) {
Lower = 1;
++*p;
} else if (v1 == 62) {
Upper = ... | LONG GetExprValue(STRPTR *p) {
LONG Val = 0, V;
BOOL Loop = TRUE, Lower, Upper;
UBYTE LastOp = '+';
SkipWhitespace();
do {
Lower = FALSE;
Upper = FALSE;
switch (**p) {
case '<':
Lower = TRUE;
(*p)++;
break;
case '>':
Upper = TRUE;
(*p)++;
}
V = Ge... | GetExprValue | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
UBYTE GetLine() {
unsigned int v1;
BOOL NotGot;
do {
NotGot = 1;
++LineNo;
fgets((char *)Line, 130, In);
if (feof(In)) {
EndFile();
if (!MainLoop)
return 0;
} else {
NotGot = 0;
}
} while (NotGot);
if (Debug)
printf("%08lX: %s", Addr, (const char *)Line)... | UBYTE GetLine() {
BOOL NotGot;
do {
NotGot = TRUE;
LineNo++;
fgets(Line, LINELEN, In);
if (feof(In)) {
EndFile();
if (!MainLoop)
return COMMENT;
} else
NotGot = FALSE;
} while (NotGot);
if (Debug)
printf("%08lX: %s", Addr, Line);
ptr = &Line[0];
Skip... | GetLine | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
UBYTE GetOperand(ULONG *Val) {
int v2;
UBYTE Type;
Type = 32;
if (Debug)
printf("\t\t\tGetOperand at >%s<\n", (const char *)ptr);
*Val = 0;
if (!*ptr || *ptr == 10)
return 32;
if (*ptr == 44)
++ptr;
if (CheckReg(Val)) {
Type = *ptr;
if (((*__ctype_b_loc())[Type] & 0x200) != 0)
... | UBYTE GetOperand(ULONG *Val) {
UBYTE Type = ' ';
if (Debug)
printf("\t\t\tGetOperand at >%s<\n", ptr);
*Val = 0;
if (*ptr == 0 || *ptr == '\n')
return ' ';
if (*ptr == ',')
ptr++;
if (CheckReg(Val)) {
Type = *ptr;
if (islower(Type))
Type = toupper(Type);
} else if (isalnum(... | GetOperand | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
LONG GetValue(STRPTR *p) {
UBYTE c;
UBYTE ca;
BOOL Neg;
long Val;
SymTab ST;
unsigned char Sym[40];
unsigned long v8;
v8 = __readfsqword(0x28u);
Val = 0;
Neg = 0;
if (**p == 45) {
Neg = 1;
++*p;
}
switch (**p) {
case '\'':
if (*++*p != 10 && **p)
Val = **p;
else
... | LONG GetValue(STRPTR *p) {
UBYTE c, Sym[30];
LONG Val = 0;
BOOL Neg = FALSE;
SymTab ST;
if (**p == '-') {
Neg = TRUE;
(*p)++;
}
if (**p == 0x27) {
(*p)++;
if (**p == '\n' || **p == 0)
Val = ' ';
else
Val = **p;
(*p)++;
if (**p == 0x27)
(*p)++;
} else if... | GetValue | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
BOOL HandleSymbol() {
SymTab ST;
SymTab STa;
UBYTE Sym[32];
char Txt[88];
unsigned long v5;
v5 = __readfsqword(0x28u);
CollectSym(ptr, Sym);
ST = FindSymbol(Sym);
SkipToWhitespace();
if (*ptr == 58)
++ptr;
SkipWhitespace();
WasSym = 1;
if (ST) {
LastST = ST;
if (ST->Mac) {
i... | BOOL HandleSymbol() {
SymTab ST;
UBYTE Txt[80], Sym[STABNAMESIZE];
STRPTR p;
p = ptr;
p = CollectSym(p, Sym);
#ifdef DOLOCAL
if (CheckLocalSymbol(Sym))
;
else {
#endif
ST = FindSymbol(Sym);
#ifdef DOLOCAL
}
#endif
SkipToWhitespace();
if (*ptr == ':')
ptr++;
SkipWhitespace();
... | HandleSymbol | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void IncLine() {
if (++LLine > 0x3Au)
ListHeader();
LCol = 0;
} | VOID IncLine() {
if (++LLine > LPAGELEN)
ListHeader();
LCol = 0;
} | IncLine | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void ListHeader() {
int v0;
int v1;
int v2;
if (LPage)
fputc(12, Lst);
v0 = ++LPage;
v1 = strlen((const char *)LTitle);
v2 = strlen((const char *)FName);
fprintf(Lst, "<<<< (%s) %s%*d >>>>\n\n", (const char *)FName,
(const char *)LTitle, 65 - (v1 + v2), v0);
LLine = 0;
} | VOID ListHeader() {
if (LPage)
fputc(12, Lst);
fprintf(Lst, "<<<< (%s) %s%*d >>>>\n\n", FName, LTitle,
65 - (strlen(LTitle) + strlen(FName)), ++LPage);
LLine = 0;
} | ListHeader | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void ListLine() {
if (Listing) {
if (!LPage)
ListHeader();
fprintf(Lst, "%08lX :\t\t %s", Addr, (const char *)Line);
IncLine();
}
} | VOID ListLine() {
if (Listing) {
if (LPage == 0)
ListHeader();
fprintf(Lst, "%08lX : %s", Addr, Line);
IncLine();
}
} | ListLine | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
int LookForOp() {
long v1;
unsigned short v2;
_BYTE c[3];
UWORD i;
UWORD j;
UWORD k;
UWORD l;
STRPTR p;
UBYTE Op[12];
unsigned long v10;
v10 = __readfsqword(0x28u);
c[2] = 0;
p = ptr;
*(_WORD *)c = *ptr;
if (((*__ctype_b_loc())[c[0]] & 0x200) != 0)
c[0] = toupper(c[0]);
if (c[0] > 0... | int LookForOp() {
UBYTE c, Op[12];
UWORD i = 0, j, k, l;
STRPTR p = ptr;
c = *ptr;
if (islower(c))
c = toupper(c);
if (c < 'A' || c > 'Z') {
if (Debug)
printf("\t\t\tLookForOp - First chr not A-Z\n");
return 0;
}
j = c - 'A';
k = Offsets[j][0];
l = Offsets[j][1];
if (!l) {
... | LookForOp | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void OutputByte(UBYTE b) {
WORD i;
if (Pass == 2) {
if (CodeGen) {
if (!DoAddr && Addr2 < Addr) {
for (i = Addr2; i < Addr; ++i)
fputc(0, Op);
}
} else {
CodeGen = 1;
DoAddr = 1;
OutputLong(Addr);
DoAddr = 0;
}
fputc(b, Op);
}
if (!DoAddr)
... | VOID OutputByte(UBYTE b) {
WORD i;
if (Pass == 2) {
if (!CodeGen) {
CodeGen = TRUE;
DoAddr = TRUE;
OutputLong(Addr);
DoAddr = FALSE;
} else if (!DoAddr && Addr2 < Addr) {
for (i = Addr2; i < Addr; i++)
fputc(0, Op);
}
fputc(b, Op);
}
if (!DoAddr)
Addr... | OutputByte | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void OutputLong(ULONG l) {
if (LittleEndian) {
OutputByte(BYTE3(l));
OutputByte(BYTE2(l));
OutputByte(BYTE1(l));
OutputByte(l);
} else {
OutputByte(l);
OutputByte(BYTE1(l));
OutputByte(BYTE2(l));
OutputByte(BYTE3(l));
}
} | VOID OutputLong(ULONG l) {
UBYTE L[4];
memcpy(L, &l, 4);
if (LittleEndian) {
OutputByte(L[3]);
OutputByte(L[2]);
OutputByte(L[1]);
OutputByte(L[0]);
} else {
OutputByte(L[0]);
OutputByte(L[1]);
OutputByte(L[2]);
OutputByte(L[3]);
}
} | OutputLong | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void OutputWord(UWORD w) {
if (LittleEndian) {
OutputByte(HIBYTE(w));
OutputByte(w);
} else {
OutputByte(w);
OutputByte(HIBYTE(w));
}
} | VOID OutputWord(UWORD w) {
UBYTE W[2];
memcpy(W, &w, 2);
if (LittleEndian) {
OutputByte(W[1]);
OutputByte(W[0]);
} else {
OutputByte(W[0]);
OutputByte(W[1]);
}
} | OutputWord | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void ProcessFile(STRPTR File, BOOL List) {
UBYTE Line;
WORD l;
WORD la;
WORD i;
BOOL Found;
Found = 0;
strcpy((char *)FName, (const char *)File);
l = strlen((const char *)FName);
for (i = 0; i < l; ++i) {
if (FName[i] == 46)
Found = 1;
}
if (!Found)
strcpy((char *)&FName[strlen((con... | VOID ProcessFile(STRPTR File, BOOL List) {
WORD l, i;
BOOL Found = FALSE;
strcpy(FName, File);
l = strlen(FName);
for (i = 0; i < l; i++)
if (FName[i] == '.')
Found = TRUE;
if (!Found)
strcat(FName, ".a");
fprintf(stderr, "Processing %s\n", FName);
strcpy(OName, FName);
strcpy(GName... | ProcessFile | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void ProcessOpcode(WORD Opcode) {
int v1;
int v2;
int v3;
WORD Opcodea;
WORD i;
WORD ia;
ULONG Instr;
ULONG adr;
ULONG v[3];
UBYTE Type[4];
char Txt[88];
unsigned long v12;
v12 = __readfsqword(0x28u);
adr = Addr;
Opcodea = Opcode - 1;
SkipToWhitespace();
SkipWhitespace();
if (OpCode... | VOID ProcessOpcode(WORD Opcode) {
WORD i;
ULONG v[3], Instr;
UBYTE Type[4], Txt[80];
LONG Offset;
ULONG adr = Addr;
Opcode--;
SkipToWhitespace();
SkipWhitespace();
if (OpCodes[Opcode].Type == 'P') {
Control(OpCodes[Opcode].OpCode);
return;
}
DoPad(1);
if (adr != Addr && WasSym) {
... | ProcessOpcode | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void SDisplay(SymTab ST, BOOL NotFound) {
Macro M;
if (ST) {
SDisplay(ST->Left, NotFound);
if (NotFound && DoTitle && !ST->SetUp) {
DoTitle = 0;
puts("\nUnresolved symbols");
}
if (!NotFound || !ST->SetUp) {
if (ST->Mac) {
printf("%-13s = MACRO (%s/%d)\n", (const char ... | VOID SDisplay(SymTab ST, BOOL NotFound) {
Macro M;
if (!ST)
return;
SDisplay(ST->Left, NotFound);
if (NotFound && DoTitle && !ST->SetUp) {
DoTitle = FALSE;
printf("\nUnresolved symbols\n");
}
if (!NotFound || !ST->SetUp) {
if (ST->Mac) {
printf("%-13s = MACRO (%s/%d)\n", ST->Na... | SDisplay | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
void SetOffsets() {
UBYTE Last;
WORD i;
WORD j;
UBYTE Count;
i = 0;
j = 0;
Count = 0;
Last = 65;
memset(Offsets, 0, sizeof(Offsets));
while (OpCodes[i].Op[0] > 0x20u) {
if (Last == OpCodes[i].Op[0]) {
++Count;
} else {
Offsets[j][1] = Count;
Count = 1;
Last = OpCodes... | VOID SetOffsets() {
WORD i = 0, j = 0, Count = 0;
UBYTE Last = 'A';
memset(Offsets, 0, sizeof(Offsets));
while (OpCodes[i].Op[0] > ' ') {
if (OpCodes[i].Op[0] == Last)
Count++;
else {
Offsets[j][1] = Count;
Count = 1;
Last = OpCodes[i].Op[0];
j = Last - 'A';
Offsets... | SetOffsets | dlx-1.5.20 | app-emulation | O0/app-emulation/dlx-1.5.20/dasm | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.