Compiling real mode asm (rootkit.arsenal) - c

Im stuck on compiling the tsr.asm code provided in the book rootkit arsenal.
I installed open watcom on a XP maschine and the first asm listing was compiled well.
When compiling, it throws the error: "multiple starting address found" (nothing found on google). Can anyone confirm that this code is compilable, and how?
Im thankful for any suggestions.

When you're writing some code, there is a particular address where the execution is to begin (the main function in C for example), but in your code there are more than one starting address, and it crashes when compiling. But without seeing the code I can't tell you more.

Sorry for the late answer, but I was searching for an answer to this and just figured it out - hopefully it'll help someone else Googling around for an answer.
Since you're using OpenWatcom (I'm using version 1.9), I'll assume that you have tsr.asm in its own OpenWatcom 16-bit DOS COM project. In the IDE, go to Targets -> Target Options -> Linker Switches. In the window that appears, select "2. Import, Export and Library Switches" from the drop-down at the top and remove the cstart_t entry under "Library files(,): [libf]".
Recompile, and your TSR COM file should be generated.

Related

CodeBlocks Debugger shows the Breakpoint, but cant go further than that. Cannot find bounds of current function

I have a big problem with CodeBlocks right now.
If I make somewhere a breakpoint, and start the debugger, it will show the code until the breakpoint.
The problem starts here:
If I want to go to the next line for example, it won't work. In the Info Box/Console messages, there is a message called:
"In ?? () () "
"Cannot find bounds of current function"
What could it be?
Furthurmore, I noticed one thing when I compare CodeBlocks on my desktop PC with that on my Virtual Machine (on a Notebook). Is that on the Desktop he goes by a path that includes Python 2.7, while on my Notebook this path is nowhere visible.
I hope somebody can help me out! Thanks for any help!
It is not the first time that I have encountered this problem, mainly your debugger must be hosted in a folder that contains incompatible characters, at least that is the reason I gave it, download MINGW or some debugger of the same style, what I did was create a path without special characters or spaces.
This is how I fixed it, I hope it work for you too.

Lack of debugging information in, well, debugger

Currently I am using Clion IDE plus latest version of Open Watcom v2 windows 32 bit compiler to develop some 16 bit MS-DOS application. The problem I have is I don't see all required debugging information when using watcom windows debugger (wdw.exe).
Being specific, I see global variables, global and any other types of functions, even those imported from asm files. But well, local variables list is empty all the time. But more importantly - the only c-code I can see is little test.c file which contains only main() function and nothing else except for includes.
What do I need to do to finally get c-level debugging for whole project? What am I missing?
I would be grateful for any help.
All source files is located in one directory, so, they all should be visible to debugger. But it sees only main c file.
Of course I am compiling with -d2 switch, as well as -hw. DEBUG WATCOM ALL is also presented in linker config file before any FILE directives. Reading manuals to compiler and linker... Well, it's nice that I've found many interesting things in manuals, but nothing helped with exactly that issue so far :)
List of compiler switches I currently using:
WCC.EXE:
CALL WCC.EXE -dTEST -bt=dos -0 -za99 -wx -we -mc -zp2 -hw -d2
%SRC_FULL_NAME%
WLINK:
CALL WLINK.EXE #..\CC.LK
CC.LK:
SYSTEM DOS
DEBUG WATCOM ALL
FILE TEST.OBJ
FILE LUTILS.OBJ
FILE LGL.OBJ
NAME TEST.EXE
OPTION ELIMINATE
...

Installing codeBlock

This is my first time of trying to develop with C programming language. I tried installing codeblock on my window 8 operating system, but whenever I run the codeblock program I get this error in the image below
I installed codeblock hopping that it would install the compiler alongside, but I was disappointed. I do not know how to install the standalone compiler, I checked it up online, but I really do not know from where to start, and I do not know if the problem is with my system. I would appreciate help on how to make my codeblock work properly or any other suggestions. Thanks all.
When running CB for the first time, you are prompted with a "Compiler auto-detection" dialog/window.
It looks like you chose the WRONG COMPILER -> GCC for MSP430 micro controller!
Correct that to GCC/MinGW
EDIT - 1: Its usually the first option on the "Compiler auto-detection" dialog
EDIT - 2
I think you may also have selected the wrong compiler for your CB project
For C project, Follow these steps:-
Create a new project -> Console application for C/C++,
Skip the first page, click next
Provide a title & path, click next
at compiler selection screen, select "GNU GCC Compiler" instead of "GNU GCC Compiler for MSP430"
The compiler might not be included in the Code::Blocks you downloaded (if you got codeblocks-12.11-setup.exe). There's another downloadable binary (codeblocks-12.11mingw-setup.exe) that includes the MinGW environment with the GNU GCC compiler. You might want to try that one.
Step-1 : Visit www.mingw.org/
Step-2 : Download and install all package.(Specially mark the the file starting from mingw)
Step-3 : Goto to installation and Apply Changes.
Step-4 : Now open your code block
Step-5 : Goto to Setting->Compiler
Step-6 : Now click toolchain executable AND SELECT GNU GCC COMPILER
Step-7: Click autodetect and then OK
I hope this will definitely work out, All the best
Just goto setting > compiler and click on "restore default" . Then yes and ok .Done . I think it will never occur the error.

symbol lookup error on a command

i'm trying to do some code in a keyboard driver, a 3rd party software that looks like this can run the command i'm trying to do in a plugin file that compiles alongside the daemon that the command needs to be sent to. the command looks like this.
g15_send_cmd (g15screen_fd,G15DAEMON_MKEYLEDS,mled_state);
here's the code i'm working with and trying to run the command in (it compiles as a plugin with the daemon. in the uncompiled source it's
"g15daemon/plugin/g15_plugin_uinput.c"
the file that defines the command is in
(link)
"g15daemon/libg15daemon_client/g15daemon_clinet.h"
whereas with the g15macro (3rd software) is run from outside the daemon for various reasons i don't want to (and pretty much can't) use it, one being speed of execution of commands when keys are pressed.
so the program compiles like this without error it seems. but if the code i specified above activates, the driver(daemon) crashes giving
g15daemon: symbol lookup error:
/usr/lib/g15daemon/1.9.5.3/plugins/g15plugin_uinput.so: undefined
symbol: g15_send_cmd
what did i do wrong or what am i missing here? (and i'm sorry if the code in the plugin file is ugly down by that switch command, but i didn't know how to do any better since i don't know C much at all, all i have behind me are Py and C#)
Edit: the solution was given
but i don't know how to add a linker flag, also since it links to a part of the program being compiled will it even work?
You forgot to link your plugin with g15daemon_client library. The simple way to fix it is to add -lg15daemon_client to the linker flags.

CodeBlocks MinGW on XP noob. Is it possible to overwrite the same exe every time I compile? Further explanation inside

I have looked through both the CodeBlocks and MinGW FAQ and wiki to no avail. As stated above I am a noob.
I want CodeBlocks to act like a Unix compiler in that it overwrites a single output file every time it compiles unless told to do otherwise.
In Unix:
[cc example.c] -> [a.out], [cc example2.c] -> [a.out]. If I want to save the output file from being overwritten i just [cc -o newname example3.c] - [newname.out].
If this is possible with CodeBlocks/MinGW on XP I'd like to know how to do it. If not I would appreciate recommendations for another GUI compiler/IDE that could. Any help is appreciated. Thank you.
I want CodeBlocks to act like a Unix
compiler in that it overwrites..
First of all, C::B isn't a compiler -- it's an IDE. Saying you want C::B to act like a compiler makes no more sense then saying you want vim, emacs, or visual studio to 'act' like a compiler.
Second, you change the name of the final executable by right-clicking a project in your workspace. Goto properties->Build targets tab->select which build target you want to change. On the right side of this you'll see Output filename. Enter the executable filename the linker should output here. Alternatively, you can just navigate to the location of your existing executable and just rename it to something else.
And thirdly, chances are you're not even going to be checking back on this site so I'm probably just wasting my time giving an answer to your post.

Resources