mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
Add honeybadger to ape.S
This commit is contained in:
parent
e55e71ab48
commit
1a08594f95
2 changed files with 35 additions and 10 deletions
38
ape/ape.S
38
ape/ape.S
|
@ -1393,15 +1393,45 @@ long: push $GDT_LONG_DATA
|
|||
call __map_phdrs
|
||||
push $0x037f
|
||||
fldcw (%rsp)
|
||||
movabs $1f,%rax
|
||||
movabs $kernel,%rax
|
||||
jmp *%rax
|
||||
1: movabs $ape_stack_vaddr,%rsp
|
||||
.endfn long
|
||||
|
||||
/* ▄▄▒▀▀▀▀▒▒▄░
|
||||
█████▓▓▄░░░░ ▒▒▄░
|
||||
▐█▓▓█▓▄█████▓░ ▀▒▄
|
||||
▓█▓▓▓▓▓▓▓▓▓█▓ ░▀▒░
|
||||
░▀▀▓█▓▓▓▓▓▓█▓ ░▀▒▄▄▒▄▄▄▒▒▒▀▀▀▀▀▀▀▀▀▀▀▀▀▀▒▒▄▒
|
||||
░▀▓▓█▓▓▓▓▓▄ ░ ░▀▒▄▄ ▄
|
||||
░▀█▓▓▓▓▓▄░ ░▀▒░ ▄▓▌
|
||||
▀█▓▓▓▓▓█▓░ ░▀▄░ ░▄▓██░
|
||||
░▀█▓▓▓▓▓█▄ ░▀▒▄▄▄▄▄▄▄▄▒▀▓█▓█▓░
|
||||
░▀█▓▓▓▓█▓░ ░▄▓█▓▓█▓▄▌
|
||||
░▀█▓▓▓▓▓▄ ▄▄▄▓▓██▓▓▒▒░ ▒▒▄▓█▓▓▓▓█▓
|
||||
▀█▓▓▓▓▓▓▄▄░ ░▄▄▓██▓▓▓▓▓██████████████▓▓▓▓▓▓█▀
|
||||
▐█▓▓▓▓▓▓▓██▓▓▄▄▄▄▄▄▄▄▄▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████▓▓▀░
|
||||
▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█░ ░░░░░░
|
||||
▄░▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
|
||||
█▓▄▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▀▀▀▀▀▀▀▓█▓▓▓▓▓▓▓▓▓▓▓▓
|
||||
▐█▓█▓░▓█▓▓▓▓▓▓▓█▀▀▀▀▒░ ▐▓▓▓▓▓▓▄▒▀▓█▓▓▓▓▓▓▓▓█▌
|
||||
▐█▓▓▓█▒▀█▓▓▓▓▓▓█▌ ▀█▓▓▓▓▓█▄░▀▓▓█▓▓▓▓▓▓█░
|
||||
█▓▓▓▓▓█░▐█▓▓▓▓▓█▌ ▀▓█▓▓▓▓█▌ ░▀█▓▓▓▓▓█▄
|
||||
█▓▓▓▓█▌ ░█▓▓▓▓▓█░ ▓█▓▓▓▓▓░ ▒█▓▓▓▓▓█░
|
||||
█▓▓▓▓█░ █▓▓▓▓▓█░ █▓▓▓▓▓█░ ▐█▓▓▓▓█▌
|
||||
▐█▓▓▓▓▓▄ █▓▓▓▓▓█ ░▄▄▓█▓▓▓▓▓█░ ▐█▓▓▓▓█░
|
||||
▓█▓▓▓█▓▐█▓▓▓▓█▌ ▓██▓▓▓▓▓▓█▀ ▓█▓▓▓▓█
|
||||
▀▓██▒▄█▓▓▓▓▓█░ ░█▓▓▓▓▓██▀░ ░▓█▓▓▓▓█▌
|
||||
░░█▓▓▓▓▓█▓ ░▀▀▀▀▀▀ ▓█▓▓▓▓▓▓
|
||||
╔───────────────────────────────────────────────────────────▀▀▀▀▀▀───────────│─╗
|
||||
│ αcτµαlly pδrταblε εxεcµταblε § cosmopolitan libc runtime runtime ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
kernel: movabs $ape_stack_vaddr,%rsp
|
||||
add $ape_stack_memsz,%rsp
|
||||
movl $0,0x7b000 # unmap null 2mb
|
||||
#if USE_SYMBOL_HACK
|
||||
.byte 0x0f,0x1f,0207 # nop rdi binbase
|
||||
.long (IMAGE_BASE_VIRTUAL-IMAGE_BASE_REAL)/512
|
||||
#endif
|
||||
movl $0,0x7b000 # unmap null 2mb
|
||||
.weak __hostos
|
||||
ezlea __hostos,ax
|
||||
test %rax,%rax
|
||||
|
@ -1426,7 +1456,7 @@ long: push $GDT_LONG_DATA
|
|||
push $.Larg0 # argv[0]
|
||||
push $1 # argc
|
||||
jmp _start
|
||||
.endfn long
|
||||
.endfn kernel
|
||||
|
||||
.rodata
|
||||
.Larg0: .asciz "ape.com"
|
||||
|
|
|
@ -183,13 +183,8 @@ static void GetOpts(int *argc, char *argv[]) {
|
|||
ttyquantsetup(g_flags.quant, kTtyQuantRgb, g_flags.blocks);
|
||||
}
|
||||
|
||||
static unsigned char ChessBoard(unsigned y, unsigned x, unsigned char a,
|
||||
unsigned char b) {
|
||||
return !((y ^ x) & (1u << 2)) ? a : b;
|
||||
}
|
||||
|
||||
static unsigned char AlphaBackground(unsigned y, unsigned x) {
|
||||
return ChessBoard(y, x, 255, 200);
|
||||
return 255;
|
||||
}
|
||||
|
||||
static void *Deblinterlace(long dyn, long dxn, unsigned char dst[3][dyn][dxn],
|
||||
|
|
Loading…
Reference in a new issue