MosaicFuneral 812 Nearly a Posting Virtuoso

A quick way of spying inside of a process. You could also turn this into something like a disassemble, pretty easy, if you wanted too.

Quick Notes:
The inline assembly is GCC dependent(quick fix for other compilers), and in MinGW you need to link th32 and gid32.

The code flow might be lacking a bit since this was initial just a small test program that I just kept adding to, but I have cleaned it up quite a bit. Still might be an unnecessary variable or two floating around.

Let me know what you think.

MosaicFuneral 812 Nearly a Posting Virtuoso

After flipping through some organic chemistry books I had, I found a interesting little table of basic hydrocarbons. I decided it would be nice to play around with it, by putting together something that could to some accuracy generate them.

I am by no means a chemist. You don't even want to know my grade...

Anyway, I had fun with it, while I had a cold.

MosaicFuneral 812 Nearly a Posting Virtuoso

Could blurry vision, runny nose, and half a bottle of cough syrup be an excuse?! lmfo

Well, I've also been told if possible stick to a single data type, preferably that of your target architecture. Mostly as a fall back if you want to do future optimizations.

MosaicFuneral 812 Nearly a Posting Virtuoso

I decided to find a use for the STL map, and this is what I decided would be cool to practice with.

Just have three placed in the code. Could use a function to load the requested elements from a file.

MosaicFuneral 812 Nearly a Posting Virtuoso

Interesting, I'll try this out.

MosaicFuneral 812 Nearly a Posting Virtuoso

The extra loop is actually just a place holder for something else I plan on doing, latter.
This technically a prototype and only works in linear fashion, I have alot of code to go still, but it demonstrates the point of the function. I also have a lot of other functions half finished in my program right now.
Next weekend I plan on adding more passes, and pattern detections of sentences for less guessing, till then I have school to worry about.

MosaicFuneral 812 Nearly a Posting Virtuoso

Oh yeah, it's pretty easy to incorporate different incremental XOR'ing(or detect it), but not spastic patternized values(that's hard to undo).

MosaicFuneral 812 Nearly a Posting Virtuoso

From part of a cryptanalysis tool I was writing, the other day.
A way of obtaining possible XOR'ed string values.

If you ever get to the point in the analysis that you can simply XOR the string to get closer towards your goal, of finding a weakness, this might be what you need for the job.

Assuming that the value that was XOR'ed was an ASCII value 32-254(typical range),
all we have to do is loop about XOR'ing, and checking if it's in that range.
Of course.... there's still probably more work to do; even, after you create a list of possible XOR values, but it's a step closer.

Note: Small input such as, "stuff", will create over a hundred possible values, but input such as, "Stuff.", will generate a nice concise list.

Hope this helps you in analyzing, and strengthening your next encryption algorithm.

MosaicFuneral 812 Nearly a Posting Virtuoso

The char string method is cool, I just used the current position of the string as the XOR value, after some other ciphering, then inflating the string with gibberish to avoid them from knowing the size to reverse it, et al.; but I might try this technique out, since it's more compact, and not as analyzable by finding value averages.
Only bad part is that the XOR trick can be deciphered with loops(and other tricks), in seconds. :(

Good work, five stars!

MosaicFuneral 812 Nearly a Posting Virtuoso

To many branches using 'switch', you should have used a function to calculate the pitches based on the current octave. Note how C grows by the power-of-two, but has a gain added each time(16, 33, 65, etc.).

Plus Beep, and "pause" are not portable. Try including cstdlib, and use _beep(), and getchar().
Your variables should be in main(), not global.

edit:
Hope that helps you a bit, in simplifying it, and making it easier on yourself; instead of manually typing all of those pitch tables out.

MosaicFuneral 812 Nearly a Posting Virtuoso

Occasionally there's times when you want to shift a bit over, but you would like to preserve the end of it, for one reason or another.
Such as with say you have: 10000001 but you would like: 00000011 then latter on back to: 10000001 Or in Dec 129-into-3, and 3-into-129.

On x86's there is an instruction for it, but I doubt if it's portable.
So how to do it with just the basic bit operators? Here's how to c-shift one bit left, with an 8-bit unsigned char:

unsigned char c = value; /*0-255*/
unsigned char d = c >> 7;
c <<= 1;
c |= d;

Yep, just three simple bit-operations.
The temporary('d') holds the left-most bit, the value('c') is shifted over, then the left-most bit that was OR'ed onto the end-bit.
(Warning: I might be thinking backwards, and explaining this a bit wrong.)

Below I have a 8-bit value that circular-shifts a 9 times around, then 9 times back; and a 32-bit value that cirular-shifts around 65 times, then 65 back.
You may want to find the Dec-Bin funtion and print that, so you can view it a little more easily.

For future reference, you may wish to use a value return instead of an address, also perhaps an overloaded version that takes an extra parameter for looping the shift; instead of manually doing it:

unsigned char Left(unsigned char c, int shift)
{
    unsigned char d;

     for(int i = …
MosaicFuneral 812 Nearly a Posting Virtuoso

Try the constant 1.8 , instead of the fraction.

MosaicFuneral 812 Nearly a Posting Virtuoso

There's also the FPU-machine instruction: fistp Probably not portable to every platform, but simple. Agner Fog has an example of it in his Asmlib, and a bunch of other cool asm-to-C++ functions.

MosaicFuneral 812 Nearly a Posting Virtuoso

Actually I have a simple library I wrote for executing machine code off an executable page.

The basis of it all for single page without a pointer(to arguments pushed on the stack) is simply:

  • typedef int (*fp)();
  • fp *code = new fp [original.size()];
  • memmove((void*)code, original.data(), original.size());
  • In a wrapper function, return ((fp)code)();
  • delete [] code;

Argument support is mind-numbingly easy.

I was working on an experimental metamophic engine, and assembler for it around the begining of summer, but sort of gave up when a bug with literals had me grinding my teeth.

MosaicFuneral 812 Nearly a Posting Virtuoso

more than 30 round fired (one clips worth??)

Thirty hand loaded shots, six clips(5rnd.), three clips(10rnd.), two clips(15rnd.), one clip(30rnd.), 3/4 of a clip(40rnd.). Combination of the above.

MosaicFuneral 812 Nearly a Posting Virtuoso

5. One PDA, two laptops, and two desktops.

I was installing and setting-up W2K on the laptops for my father and his boss.

MosaicFuneral 812 Nearly a Posting Virtuoso

You can probably go to the post you want to move and click the Flag Bad Post link to report it. That will get the moderators' attention, and because it was an accident and you reported it yourself, they should not give you a warning.

You still get the auto-send message, even if you report your own self.

Hitting the submit button a couple times, in the lag, isn't something to cry over.

MosaicFuneral 812 Nearly a Posting Virtuoso

uhhmmm..... A hell of allot more then you're currently displaying.

You're not going to make much of an impression at an interview(or even consideration for one, through your résumé), if don't have clear communication skills.

MosaicFuneral 812 Nearly a Posting Virtuoso

By the way, if you've ever aspired to playing like him, Someone has gone to great lengths to teach you how: http://www.youtube.com/watch?v=8VG1_Jxz0Yg
;P

He forgot to mention how to do the slow songs. And the prescription for that is: rip off Morbid Angel, or old doom bands everyone's forgotten about.

MosaicFuneral 812 Nearly a Posting Virtuoso

http://www.guitarcenter.com/Search/Default.aspx?internal=1&src=kerry+king&Search.x=0&Search.y=0&Search=Go

Two on that page, are a thousand.

See they don't have his little practice amp stocked anymore.

MosaicFuneral 812 Nearly a Posting Virtuoso

While their did you buy one of his $1k guitars, and $2k amp heads?

MosaicFuneral 812 Nearly a Posting Virtuoso

You made your opinion clear at post 35. No need to repeat yourself. You have the choice of unsubscribing from it, and I bet nobody is going to even notice it.

And your 30+ posts haven't followed a motif?: Setup trap, attack, defend with excuse, repeat.

MosaicFuneral 812 Nearly a Posting Virtuoso

With the 9/11 trump card played, how do we sink this thread any lower?

Ass dance!

Or would that add a little class? You pull out something like 9/11 and an entire site becomes worthless.

Turn on some crappy talk radio station if you want to hear 9/11 still being bombarded at you as an excuse. Or consult this old strip.

MosaicFuneral 812 Nearly a Posting Virtuoso

Where's the particle bonanza, eyecandy overload, and cute to till you puke stuff?

Disregard everything you wrote, and focus on what I wrote. For it is the secret to suckering in a cult following, which means a guaranteed audience for all following releases. At least eight dozen!

MosaicFuneral 812 Nearly a Posting Virtuoso

CS threads need to be locked after a set period of about eight weeks when there's no activity.

To prevent "I need this too!" posts and the "E-mail me for my patented works!" types, from reviving whatever random post they think suites their needs.

Someone should also really tell them that the OP flunked several years ago, according to the post date.
Which should be indicated by a new thread symbol.
I propose this symbol should be an animation of flaming kittens chasing butterflies(crossed with wasp).

MosaicFuneral 812 Nearly a Posting Virtuoso

Because they require a const char* not a std::string. Try string.c_str()

And remove that system() call at the end.

MosaicFuneral 812 Nearly a Posting Virtuoso

Why not just a vector of vectors?

MosaicFuneral 812 Nearly a Posting Virtuoso

Meaning if it was not misused there is no issue?

The only times it should ever be used are of the most rarest situations.
So don't get any ideals about using in substitution of well planned logic.

no1zson commented: helpful +3
MosaicFuneral 812 Nearly a Posting Virtuoso

You don't need to cast your call.

You should be extremely wary of ever using system(), in fact it should just be avoided. Else risk being ridiculed or angry e-mails when something goes wrong.

Why did you use the std:: namespace if you're just using C headers, and no STL?

MosaicFuneral 812 Nearly a Posting Virtuoso

Is the post number how many times over someone is a loser?

MosaicFuneral 812 Nearly a Posting Virtuoso

My favorite:

org 0

label:
jmp label

times 510-($-$$) db 0
dw 0AA55h

Pure poetry.

MosaicFuneral 812 Nearly a Posting Virtuoso

just make your own strcpy. Its not hard

//copy string 2 into string 1
 bool stringCopy(std::string* str1, std::string* str2)
{
   if(!str2[0]) return false;

  for(int i = 0; i < str2.size; i++)
       str1[i] = str2[i]; 

  return true;
}

Why not just str1 = str2;

MosaicFuneral 812 Nearly a Posting Virtuoso
string temp;
...
    getline(infile, temp);
    pic_links.push_back(temp);
...

Most of your code is unnecessary, since most of it is already provided.

MosaicFuneral 812 Nearly a Posting Virtuoso

Try private: vector<string> varible_name; Vector is dynamic and you can kill off unused strings, unlike a constant array.


Oh yeah, std::string is different from a C-string(char pointers/arrays) don't mix them up.

MosaicFuneral 812 Nearly a Posting Virtuoso

Assuming you're on Windows: ShellExecute()

MosaicFuneral 812 Nearly a Posting Virtuoso
MosaicFuneral 812 Nearly a Posting Virtuoso

Audiere

And if you can't use that, you may want to take a class or two on programming...

MosaicFuneral 812 Nearly a Posting Virtuoso

I wanted to do an evolving cell AI simulation once, but I forgot some of my biology lessons about related topics and was to lazy to walk over and pick up my books on it. :icon_rolleyes:

If you ever get around to writing something like this, let me know I'd optimize it till it could run on a 4004(yes, I'm insane).

MosaicFuneral 812 Nearly a Posting Virtuoso

Don't use goto, try a function. You already have a switch in an if statement, don't make it any more complex.

Avoid fflush() and look into a replacement of scanf()

no1zson commented: thanks for the effort +3
MosaicFuneral 812 Nearly a Posting Virtuoso

Why the hell is anyone replying still? There isn't even an "argument" to advance or defend, anymore.

It's all useless mud being flung in here.

Ancient Dragon commented: yes +36
MosaicFuneral 812 Nearly a Posting Virtuoso

*applauds*

Well why wasn't there a party or something? Lets get blitzed and announce ~s.o.s~'s new power on the news, while so!

MosaicFuneral 812 Nearly a Posting Virtuoso

There is this for_each(), but I think you're confused with foreach from another language like C#, PHP, or something.

Wrong section perhaps?

MosaicFuneral 812 Nearly a Posting Virtuoso

Stuff is stuff. (It took me all day to write that. *nods head*)

MosaicFuneral 812 Nearly a Posting Virtuoso

Why are you talking like this?

MosaicFuneral 812 Nearly a Posting Virtuoso

Perhaps simplify:

for(int i = 0; i < 100; i++)

Works out as:

int i  = 0;
while(i < 100)
  i++;
MosaicFuneral 812 Nearly a Posting Virtuoso

Have you tried <algorithm>'s remove?

Something like:

string.erase(remove(string.begin(), string.end(), "-."), string.end());

By the way, you don't need Boost.

MosaicFuneral 812 Nearly a Posting Virtuoso

So from this quick sample are josh2 and sturm speaking from the same ***hole? connected at the hips? just 2 sets of legs connected at the hips - nothing goes in and only bile comes out?

They're puppet accounts, from hell.

MosaicFuneral 812 Nearly a Posting Virtuoso

Or don't use exit() at all, unless there's some sort of critical lockup that keeps your program from going any further.

Generally good error handling will lead you to the end of main, with just a return/break or two and with virtually no overhead.

MosaicFuneral 812 Nearly a Posting Virtuoso

Local colleges usually have classes you can enroll in. You can usually even use it as credit, if you go to college, latter on.

Truthfully, you can learn C languages at home easy enough.

MosaicFuneral 812 Nearly a Posting Virtuoso

Well kick your computer; determine if the case is plastic or aluminum. If you have a metal one, then you can: mint your own coins, set a currency value on your coins, buy a new computer, install FF.

Repeat above if FF conks-out, again.