Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 27 Feb 2009
Offline Last Active Mar 07 2015 12:32 AM

Topics I've Started

A Rose by Any Other Name...

14 May 2014 - 10:42 PM

I figure, it's my turn to try my hand at a coding horror. This one had me stumped for a couple better-spent-elsewhere hours:

	mov edx, OFFSET menu	; print menu of operations
	call WriteString
	call ReadChar
	call WriteChar
	call Crlf

	cmp al, 'p' ; If 'p' was entered...
	je print    ; ...print nodes


	mov edx, OFFSET error	; Print invalid option message
	call WriteString
	jmp menu_prompt

	push cur
	push head
	call Print

	jmp menu_prompt
	call WaitMsg	; hold display window open
main ENDP

Print PROC
Print ENDP

I was trying to figure out how the values of the cur and head pointers weren't being stored on the stack before the call to the Print procedure; the program repeatedly generated a memory access violation when it tried to dereference the pointer, and I'd be sitting there rooting around the stack frame, and the values are nowhere to be found, like they've never been pushed on the stack before the call. Huh. Visual inspection of the code provided no answers. If you see it already, you're better read than I am on this assembler.
The answer? (MASM transforms all identifiers to uppercase by default, for case-insensitivity! Thus, my jmp statement was just jumping to the Print procedure, without pushing its parameters on the stack, instead of jumping to the print label. I have no idea why the assembler wouldn't raise an error or a warning for that, but I've learned my lesson [just started using MASM, in particular, not long ago].)

Bug in Posting New Topic

04 May 2014 - 06:41 PM

I was making a new topic in the Lounge, and as I was clicking Submit, I noticed a PHP warning at the bottom of the page, so I managed to copy it before the browser navigated away:


Warning: include_once(RContent/redis.php): failed to open stream: No such file or directory in /var/www/gamedev/admin/applications_addon/ips/ccs/sources/pages.php(458) : eval()'d code on line 4899 Warning: include_once(): Failed opening 'RContent/redis.php' for inclusion (include_path='/var/www/gamedev/ips_kernel/PEAR/Net_IDNA2/') in /var/www/gamedev/admin/applications_addon/ips/ccs/sources/pages.php(458) : eval()'d code on line 4899

Building Communication Skills

04 May 2014 - 06:27 PM

I'm making an effort to build inter-personal communication skills. No matter where or what I post, it seems that my actual intentions never make it to the other participants. Usually, it ends up in a complete misunderstanding/flame war, and I become frustrated, because I try to help and give back to the communities, but it usually winds up backfiring as I find everyone (including the OP, sometimes) turning on me. One time, I posted a request for a particular arcade machine part on a buy/sell/trade group on Facebook, and surprisingly, someone immediately started making fun of me, received six likes in an hour, and after that, everyone refused to help me, following my posts with more insults from group to group. All I did was make one post, didn't even comment. To this day, no idea what the heck happened.


I've been on other forums where people were less than kind. The first time that I tried posting in someone's thread on a particular site, apparently, I gave too much of the solution when explaining how to do something (I guess it was homework), and one of the moderators came in, edited my post, gave a rude remark, and renamed the thread to something degrading. Well, so much for that forum.


Basically, about anything I post that either asks for help, or gives help, results in something somewhere somehow causing it to detonate, and it discourages me from ever posting; there are a lot of times where someone needs help, and I have an answer, but I refuse to post because someone's going to come regurgitate my answer for double reputation points, vote down, and chastise me.


It becomes particularly frustrating when someone's misconception of me causes them to start condescending, basically doing the equivalent of explaining to me how the industry in which I work functions, handing me a beginner's programming book, and at times, even just insulting my intelligence and putting words in my mouth.


Some of you may be familiar with my posts (likely as a novelty), and need no more explanation. I try to be articulate and grammatically correct, I proofread my posts when I remember, and I try to give all of the needed information. Though, I usually find that I don't give enough information; rather than ask for more, responses usually pick a direction and run, and it takes me all thread to get back to actually approaching the question, while I'm navigating a hail of down-votes. (I've tried asking the down-voters why they did so, so that I could try to learn from it. It often turns out that they just skimmed the thread, saw me disagreeing, and penalized me for not accepting the help that didn't actually solve my problem.)




So, I turn to the community for advice. Please don't interpret this as some sort of venting session; I'm legitimately asking for advice on how to better my communication skills. How can I ask better questions that won't result in me losing reputation just for having a tough question, and how can I offer better advice that won't result in the others turning on me for some reason and penalizing me for trying to help someone else? I'm doing the rational thing and assuming it's something about me, since it happens no matter where I go.

Passing and Returning Arrays of Bytes

14 April 2014 - 04:22 PM

I have an object that maintains three arbitrary precision (AP) integer keys. The caller may supply any of the keys by passing a pointer and a length; as the AP keys are of a templated type, they may change depending on the most optimal integer size, making passing arrays of bytes through an interface the only reasonable option that is agnostic of how it will be represented inside the AP integer.


So, there are two constructors: One that accepts up to three pointer-length pairs, and one that accepts parameters to generate the keys.


The biggest question is how the keys should be made accessible to the caller. It seems irrational to make the caller guess how big the buffer would be. My goal in asking is not really to find out how it is possible (I can think of a few ways), but to ask what would be most convenient and expected as a caller, as well as what is most likely to require the least amount of transformation into the desired format after retrieving it, like writing it to a file, or putting it in a vector.


If you were a caller, and had to get a yet unknown number of bytes from an object, how would you prefer that this interface be designed?

AES Encryption

30 March 2014 - 06:30 PM

I'm writing an implementation of the AES cipher, and while I have 128, 192, and 256 bit encryption working, only 256 bit decryption is working.

One of the biggest roadblocks in seeking out reference implementations is that I generate the key expansion sequence incrementally, to reduce memory constraints, rather than generate the whole sequence from the start.
I managed to fix my 192 bit encryption with the aid of this site, which has example key expansions for 128, 192, and 256 bit encryption keys. As it stands now, the most I know is that the decryption process fails tests on its output, but I have no tests for its inner workings like the key expansion to know which parts are working.


Can anyone output their decryption key expansion for the 128 bit key 2b7e151628aed2a6abf7158809cf4f3c and the 192 bit key 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b?

If anyone has a solid understanding of the Rijndael cipher, I can post code, but it isn't likely to make any sense because I, myself, have a flimsy understanding, and I'm doing it in a low-resource way.