flat assembler
Message board for the users of flat assembler.
Index
> Linux > fasm elf64 - ncurses colour help |
Author |
|
revolution 06 Dec 2024, 16:52
Code: BLACK_ON_YELLOW_PAIR = BLACK_ON_YELLOW shl 8 ;... mov esi, BLACK_ON_YELLOW_PAIR ;... |
|||
06 Dec 2024, 16:52 |
|
duanebonas6822 06 Dec 2024, 16:55
Anybody who reads, what im trying to do is run FASM remotely as exploit and use ncurses to display differant windows that i could revert and connect to forkpty and openpty, I already have execve bash working with a pty through child, im just trying to get ncurses colour to work and it just seems like the C syntax isnt going to work, all my other C libs like scanf all work but like stated above NCURSES has syntax via define that wont work with FASM , if anyone knows what i mean or knows how to get ncurses working with colour that is direxctly in ncurses not some old dos format, my program is huge to upload all its just the basic colour help i need. thanks if anyone reading
|
|||
06 Dec 2024, 16:55 |
|
duanebonas6822 06 Dec 2024, 17:01
ok ill have a look soon, report if get this working
|
|||
06 Dec 2024, 17:01 |
|
revolution 06 Dec 2024, 17:43
fasm doesn't have inline macros (aka functions). Making a macro might be useful to you.
Code: macro PAIR colour { colour#_PAIR = colour shl 8 } PAIR BLACK_ON_YELLOW ;... mov esi, BLACK_ON_YELLOW_PAIR ;... |
|||
06 Dec 2024, 17:43 |
|
duanebonas6822 06 Dec 2024, 18:03
I still cant get it to work what i need is the total equivilant of:
;define COLOR_PAIR(n) ((n) << () NASM needs the COLOR_PAIR specific keyword to work, i just get confused how C header which is the exactly as above gets mapped to my fully statically PIC manually configured FASM binary, so what would it look like when i call; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mov rsi, COLOR_PAIR(BLACK_ON_YELLOW) mov rdi, [hWindow] call wattron ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ or ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mov rsi, COLOR_PAIR(BLACK_ON_YELLOW) mov rdi,[hWindow] call wbkgd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; I know this confusing on FASM my background just goes yellow with wbkgd but fasm needs this COLOR_PAIR macro, its not a function so doesnt gets called just anyone knows, its only summet simple i think |
|||
06 Dec 2024, 18:03 |
|
duanebonas6822 06 Dec 2024, 18:19
yeah i think a macro might be the way, its just figuring out how to get this macro to convert to FASM, as im not moving to NASM, FASM is the only way i can build a exploit binary that is PIE OR PIC when u run readelf, This matters a lot like, i can remotely just connect to any machine and launch SUID ROOT commands, Also i think if a binary is PIE or PIC commands can just be run which doesnt even matter if they have NULLS, There is loads of other C like commands i need to convert like this, Im gonna have a look into macros in bit, But can you just confirm that i should be able to get these NCURSES colors working by messing on with what im going on about, people don't realize how stress full it is writing exploits , especially in assembley as everybody writes in different ways, i like structure to my code, like my code readable but assembly rocks the amount of memory unsafe commands i am able to launch from these FASM suid binary's is unbelievable, once my binary is remote its just a matter of breaking the shell out of the environment, that's why ncurses is needed can run commands in different windows for different output, thats my plan , thanks for anybody tho that knows what im on bout
|
|||
06 Dec 2024, 18:19 |
|
revolution 06 Dec 2024, 18:29
You can try to make COLOR_PAIR an equate
Code: COLOR_PAIR equ 256 * Code: mov rsi, 256 * (BLACK_ON_YELLOW) |
|||
06 Dec 2024, 18:29 |
|
duanebonas6822 06 Dec 2024, 18:41
yeah im gonna have a look at some macros and that later, yeah i think the equ just makes it equal to whatever, i know when i set pty values i just do this like or:
or dword [c_cc], VEOL + VEOL2 + VREPRINT + VSWTC + VERASE + VWERASE + VLNEXT mov rdi, 7 mov rsi, 0x5402 mov rdx, termios mov rax, 0x10 maybe i can or together values i dunno gonna read over macros later, but for any TUI programs color support is essential |
|||
06 Dec 2024, 18:41 |
|
duanebonas6822 06 Dec 2024, 19:09
; ANYONE NCURSES NOTE
You have to use attr_on or attr_set if you want to use a color pair number greater than 255, and you must not use the COLOR_PAIR macro (because that will mask the color pair number to 8 bits) This is somewhat explained in the attron/attr_on manpage but not very well Still finding info but not sure the COLOR_PAIR macro is even needed, i will post once i get colours working, just know a few ppl might be messing on with TUI apps, little things like this come in handy.. |
|||
06 Dec 2024, 19:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.