wjcsharp / codeword Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/codeword
License: GNU General Public License v3.0
Automatically exported from code.google.com/p/codeword
License: GNU General Public License v3.0
Visit the tool's website at http://www.code-word.org ----------------------------------------------------------- Primary authors: Aaron LeMasters (sippy) - [email protected] | https://sippysworld.org/wordpress Michael Davis - http://www.whatevercompliance.com/ Contributers: Your name here!
N/A
Original issue reported on code.google.com by [email protected]
on 5 Nov 2009 at 1:49
The if...else if... else stuff in the main.c file was pissing me off. Ioctl
is a ULONG and so you should be able to use a switch on it. I didn't
compile to see if it worked but it should. Here is what I changed main.c to:
btw I despise gotos... they are the bane of my existence.
// from CwDispatchHandlerIoControl():
//--------------------
// PRELIM VALIDATION
//--------------------
//determine required sizes for in/out bufs
// use a switch wtf... it's a ulong, switch is valid on numeric types.
switch(Ioctl)
{
case IOCTL_SSDT_DETECT_HOOKS:
RequiredOutputBufferSize = sizeof(HOOKED_SSDT_TABLE);
RequiredInputBufferSize = 0; //no input buf needed
break;
case IOCTL_SSDT_DETECT_DETOURS:
RequiredOutputBufferSize = sizeof(DETOURED_SSDT_TABLE);
RequiredInputBufferSize = 0; //no input buf needed
break;
case IOCTL_WIN32API_DETOUR_DETECTION:
RequiredOutputBufferSize = sizeof(WIN32API_DETOUR_TABLE);
RequiredInputBufferSize = 0; //input buf needed but not checked
break;
case IOCTL_IRP_HOOK_DETECTION:
RequiredOutputBufferSize = sizeof(HOOKED_DISPATCH_FUNCTIONS_TABLE);
RequiredInputBufferSize = sizeof(DRIVER_CHECK_INFO);
break;
case IOCTL_IRP_DETOUR_DETECTION:
RequiredOutputBufferSize = sizeof(DETOURED_DISPATCH_FUNCTIONS_TABLE);
RequiredInputBufferSize = sizeof(DRIVER_CHECK_INFO);
break;
case IOCTL_GET_PROCESS_LISTING_ZWQ:
RequiredOutputBufferSize = sizeof(PROCESS_LISTING_ZWQ);
RequiredInputBufferSize = 0; //no inbuf needed
break;
case IOCTL_GET_PROCESS_LISTING_PSP:
RequiredOutputBufferSize = sizeof(UINT)*256;
RequiredInputBufferSize = 0; //no inbuf needed
break;
default: //unrecognized IOCTL. bail now.
Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
Irp->IoStatus.Information = 0;
DbgPrint("CwDispatchHandlerIoControl(): Received unrecognized IOCTL
code 0x%08x",Ioctl);
goto End; // WHO THE FUCK STILL USES GOTO? THIS IS C GOD DAMNIT, NOT
ASSEMBLY!
// Goto should be avoided it gets in the way of debugging and is bad
// style because it creates spaghetti code. the code structure should
// be in a way such that you don't need goto.
break;
}
Original issue reported on code.google.com by [email protected]
on 3 Nov 2009 at 4:49
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.