low-level

Where can I find a reference for what every bit of the CorFlags value means?

一笑奈何 提交于 2019-12-04 17:49:55
问题 I'm messing around with some rather low level things and trying to determine why I get different outputs with the CorFlags.exe utility. For reference, the outputs are as so: $ corflags test2.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.17929 Copyright (c) Microsoft Corporation. All rights reserved. Version : v4.0.30319 CLR Header: 2.5 PE : PE32 CorFlags : 0x1 ILONLY : 1 32BITREQ : 0 32BITPREF : 0 Signed : 0 $ corflags test.exe Microsoft (R) .NET Framework

Low level C - Display text, pixel by pixel

末鹿安然 提交于 2019-12-04 16:29:52
I am working on a small project where I have to write a low level app. I'd like to display text in that app, and I would even like it to be anti aliased (à la ClearType). No libraries allowed, I have to draw each char pixel by pixel. What is the best way to do this? Can you recommend some known algorithms? How should I store/read the fonts? Thanks! You mean you just want to smooth the edges of an existing bitmapped font? This is easy if your original font is 16x32 and you want to render it at 8x16 or something like that, but if you don't have a higher-resolution bitmap to begin with, smoothing

Android low-level read of SD card greater than 2GB

自闭症网瘾萝莉.ら 提交于 2019-12-04 03:25:23
My Android application attempts to read the physical sectors of the SD card by accessing the actual device (in my case, /dev/block/vold/179:1). (this is on a rooted phone, of course) I'm able to open the device as a FileInputStream , and read data from it. However, I can't seem to read it past the 2GB mark (my memory card is 16GB). Is this because Android doesn't support files greater than 2GB? If that's the case, why do functions like position() and skip() accept long arguments?? Does anyone have advice on how to read from the device past 2GB? try create with a native (jni) lib and call _

What's inside the stack?

守給你的承諾、 提交于 2019-12-04 01:48:21
If I run a program, just like #include <stdio.h> int main(int argc, char *argv[], char *env[]) { printf("My references are at %p, %p, %p\n", &argc, &argv, &env); } We can see that those regions are actually in the stack. But what else is there? If we ran a loop through all the values in Linux 3.5.3 (for example, until segfault) we can see some weird numbers, and kind of two regions, separated by a bunch of zeros, maybe to try to prevent overwriting the environment variables accidentally. Anyway, in the first region there must be a lot of numbers, such as all the frames for each function call.

It is possible to write less than 1 byte to a file

佐手、 提交于 2019-12-04 00:08:28
As far as I know the smallest unit in C is a byte . Where does this constraint comes from? CPU? For example, how can I write a nibble or a single bit to a file? no, you can't... files are organized in bytes, it's the smallest piece of data you can save. And, actually, that 1 byte will occupy more than 1 byte of space, in general. Depending on the OS, the system file type, etc, everything you save as a file will use at least one block. And the block's size varies according to the file system you're using. Then, this 1-bit will be written as 1 - byte and can occupy as much as 4kB of your disk.

Algorithms for downscaling bitmapped fonts

拥有回忆 提交于 2019-12-03 21:08:14
This is a follow-up to this question . I am working on a low level C app where I have to draw text. I have decided to store the font I want to use as an array (black and white, each char 128x256, perhaps), then I'd downscale it to the sizes I need with some algorithm (as grayscale, so I can have some crude font smoothing). Note: this is a toy project, please disregard stuff like doing calculations at runtime or not. Question is, which algorithm? I looked up 2xSaI , but it's rather complicated. I'd like something I can read the description for and work out the code myself (I am a beginner and

Are there any low-level languages that can be used in place of scripts?

拜拜、爱过 提交于 2019-12-03 18:21:04
I am a "high-level" scripting guy. All my code is Class-based PHP or JavaScript. However, I want to know if there is any form of useful interpreter projects for "low-level" compiled languages like C or C++ (strange sounding huh?). This all came about when I stumbled upon http://g-wan.com/ and was fascinated by the fact that you could setup C code to run as server scripts. However, that project is all but useless because it is run by one guy and is closed source. So, is there anything out there for "low-level" languages that would enable them to be easier to run by compiling them at runtime. OR

Can I change a user's keyboard input?

对着背影说爱祢 提交于 2019-12-03 16:41:03
I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx As an overview, I want to have the user press a key, say 'E', and have the keyboard return a different character, 'Z', to whatever app is in focus. The relevant method I changed now looks like: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { //The truely typed character: int vkCode = Marshal.ReadInt32(lParam); Console.WriteLine((Keys)vkCode); KBDLLHOOKSTRUCT replacementKey

Safer Alternatives to the C Standard Library

元气小坏坏 提交于 2019-12-03 16:21:23
问题 The C standard library is notoriously poor when it comes to I/O safety. Many functions have buffer overflows ( gets , scanf ), or can clobber memory if not given proper arguments ( scanf ), and so on. Every once and awhile, I come across an enterprising hacker who has written his own library that lacks these flaws. What are the best of these libraries you have seen? Have you used them in production code, and if so, which held up as more than hobby projects? 回答1: I use GLib library, it has

Compiler-Programming: What are the most fundamental ingredients?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 15:03:24
I am interested in writing a very minimalistic compiler. I want to write a small piece of software (in C/C++) that fulfills the following criteria: output in ELF format (*nix) input is a single textfile C-like grammar and syntax no linker no preprocessor very small (max. 1-2 KLOC) Language features: native data types: char, int and floats arrays (for all native data types) variables control structures (if-else) functions loops (would be nice) simple algebra (div, add, sub, mul, boolean expressions, bit-shift, etc.) inline asm (for system calls) Can anybody tell me how to start? I don't know