Programming and Coding
Programming and coding tips, help and solutions...
1,876 topics in this forum
-
Four Ways to Compile C for Windows
by CodeExplorer- 2 replies
- 4.1k views
Four Ways to Compile C for Windows: https://nullprogram.com/blog/2016/06/13/ Pelles C statement: So that statement is true? Are performances lower if I use Pelles C???
-
Sending email using C++
by malware- 2 replies
- 4k views
How to send email smtp using winsock C++?
-
Easy way to write chars to file?
by CodeExplorer- 1 reply
- 3.8k views
Easy way to write chars to file? Tried http://www.java2s.com/Code/Cpp/File/Writeunsignedchartoafileandreaditback.htm ofstream out("D:\\block1"); out.write((char *) &block1Conv, sizeof block1Conv); out.close(); There is a problem: it will replace 0A with 0D0A How I can avoid the newline stuffs?
-
DrawTextEXT - DrawHTMLCODE and DrawBBCODE
by fearless- 0 replies
- 3.7k views
Mainly for anyone using asm and interested in custom controls or adding more functionality to their projects, I recently began work in porting over, adapting and adding to DrawHTML code from Ukkie9: https://www.codeproject.com/Articles/7936/DrawHTML I created two functions: DrawHTMLCODE and DrawBBCODE that processes html or bbcode tags in a string and adjusts the text and font style accordingly and outputs the result as per DrawText or DrawTextEx win32 api functions, but with the added enhancements. So far some tags are supported, not all. Mainly ones that are more common in use, or made sense to include. Anyhow I have put the code on github for anyone to u…
-
How to decompress CWS files?
by LCF-AT- 10 replies
- 10.3k views
Hi guys, does anyone know how to decompress CWS files to FWS (decompressed) manually or via dll / API xy? My first goal was it to find any internet request paramter what could do decompress directly on fly but I didnt found such command and can only download the CWS file.Now I got this in memory and would like to decompress it now before writing the file.Next I tried to find any way to do this manually but also didnt find a description how to decompress CWS by hand.As next I tried to find any dll / APIs which I could use to decompress the CWS / bytes in memory and just found infos about zlib but also there I found no infos about CWS etc.Now the question is how t…
-
what UI used by professional software?
by malware- 6 replies
- 5.6k views
What UI (user interface) used to develop kesperky antivirus? avat and eset and bitdefder? They have some sick gui. I wanna develop UI like them I guess bitdefender used embedded html and css UI..
-
How to monitor website traffic?
by LCF-AT- 0 replies
- 4k views
Hi guys, so I would like to visit a website as usual in browser (visit site / all links gets loaded / webconsole) but this time I wanna visit it "without using a browser".How can I do this and/or what kind of tools / libs engines etc are already out there I could use for that etc?So my goal is it to get all loading links of a site.So thats diffrent to just call only one website to grab the pagesource and in this new case I need to find some link/s during the site is loading it and which are not present into the main site.Maybe anyone could help with some infos for that etc. Thank you
-
Question on indexing mode in assembly?
by James Taylor- 11 replies
- 4.8k views
i am new to assembly programming. First i thank to member of tuts4you for being helpful in needy times. I am learning assembly from online and books. i am stuck on point. I am having problem using 1. lea eax, [esp-04h*2] 2. mov [ebx-04h], bp ; 3. cmp [esi+eax-06h], 'KCUF' 4. cmp word ptr [ebx+18h], 01h 5. cmp dword ptr [esi], 00455000h or similar code snippet. Thanks, I know this is very basic question to ask but i wanna learn from here as well. Please take some moment and explain what address mode it is and what does the code do. Thanks
-
what is assign to a random offset?
by James Taylor- 5 replies
- 4.3k views
the following cods is generated by IDA pro. I don't understand where and what is assigned to off_40G030? there is no reference in code section. what does the following code mean? what is the clean code of the following code?
-
write program in assembly
by pwnium- 7 replies
- 5.2k views
Hello there ! how to write a program add two numbers and print the result in text box in order to print the result we can use SetDlgItemText Funtion , the problem is i don't know how to add two numbers .. what functions we need ? am using MASM32 , and RadASM IDE Regards,
-
Quotation marks / CreateProcess problems
by LCF-AT- 4 replies
- 4.3k views
Hi guys, I have some trouble again with that quotation marks issues for paths etc.Just wanna ask again how to do it right and how to handle it without to get any errors starting commandline tools with paths and arguments.I get always problems if paths using spaces and if not all works.In this case I try to qms for the path but it also fails. Example: Below without qms for ffmpeg path so I changed the bin folder and added some spaces for testing... cmd.exe /c C:\FFMPEG_Sets\ffmpeg-3.3.4-win32-static\bin 1 2\ffmpeg.exe -i "https:///.....m3u8" -vcodec copy -acodec copy -f mpegts - | "C:\Program Files\VideoLAN\VLC\vlc.exe" - Now in cmd window I get this error…
-
- 6 replies
- 4.1k views
Local variables definition versus class (instance) variable definition speed: int K2[3] = { 0xd76aa478, 0xe8c7b756, 0x242070db}; void Function() { int K1[3] = { 0xd76aa478, 0xe8c7b756, 0x242070db}; int before2 = GetTickCount(); for (int ki2=0;ki2<1000000;ki2++) { for (int j=0;j<3;j++) { int a = K2[j]; } } int after2 = GetTickCount(); int before1 = GetTickCount(); for (int ki1=0;ki1<1000000;ki1++) { for (int j=0;j<3;j++) { int a = K1[j]; } } int after1 = GetTickCount(); // the results: int dif1 = after1-before1; int dif2 = after2-before2; } K1 version (local variable version) speed suppose to be much faster since is defined on stack, …
-
- 4 replies
- 4.7k views
i tried to write a small program that run some useful tools that i need , unfortunately the program run only in my computer how can i fix that problem , another question ... i'm just a beginner so the i've repeated CreateProcess and ResumeThread so many times i guess am doing this wrong ! please correct me i called this small Program EX_Runner the source code , .386 .model flat, stdcall ;32 bit memory model option casemap :none ;case sensitive include EX_Runner.inc include comdlg32.inc includelib comdlg32.lib .const sla db"\",0 FilterStr db "Executable Files","*.exe",0,0 .data olly db "C:\RCE\RAMODBG v1.1\OLLYDBG.EXE",0 IDA db "C:\RCE\Tools\IDA Pro\IDA…
-
How to walk through resource directory? 1 2 3
by LCF-AT- 58 replies
- 18.5k views
Hi guys, I am trying to read the resources directory of any target to read the whole content inside but now I have the problem that I dont understand it yet correctly using the structs for them. Example: Below the structs I found for resources IMAGE_RESOURCE_DIRECTORY STRUCT Characteristics dd ? TimeDateStamp dd ? MajorVersion dw ? MinorVersion dw ? NumberOfNamedEntries dw ? NumberOfIdEntries dw ? IMAGE_RESOURCE_DIRECTORY ENDS IMAGE_RESOURCE_DIRECTORY_ENTRY STRUCT union rName RECORD NameIsString:1,NameOffset:31 Name1 dd ? Id dw ? ends union OffsetToData dd ? …
-
What is the assembly source code of the following C code?
by James Taylor- 4 replies
- 4.1k views
What is the assembly source code of the following C code? line 1 loading address of array from stack. what the 2 and 3 and others line are doing? Thanks
-
Load DLL From Memory not working on Win8 and Win10
by GautamGreat- 3 replies
- 4.2k views
Hi, I'm trying to load a dll from a memory section in a compiled program. I written a MultiASM Assembly (Which works pretty well on Window 7), Everything seems Ok on windows 7, but it does not work on win8 and win10. Since I don't know what is wrong, could someone tell what is wrong? Spoiler Solved Here is my ugly assembly, but it works Edit (13 July 2018) I managed to fix the error, Thanks you guys
-
- 4 replies
- 4.5k views
helloo! may i ask which assembler is better suited for a < 4k intro for a 32 bits windows? = 3 thaanks beforehand! x3
-
add eax edx ?
by James Taylor- 7 replies
- 8.4k views
is the lea edx, [esp+24] start of array ? and eax, [esp+140] index? then whats add eax, edx doing here and this source code mean ? can you please explain
-
- 1 follower
- 1 reply
- 3.7k views
Hii! i've stumbled on PNGlib like it's the only png decoder for masm, it is the only one out there? this is the site of PNGlib http://www.madwizard.org/programming/projects/pnglib while it's considerably small, uPNG on C output is even smaller, counting kb; but some pairs of kb makes the difference on tiny intros may i ask if anyone knows another png decoder for masm? any idea is very welcome! x3
-
Looking for PreciseTimer.zip - Visual C++
by CodeExplorer- 4 replies
- 4.1k views
Looking for PreciseTimer.zip - Visual C++ https://www.codeguru.com/cpp/w-p/system/timers/article.php/c5759/Creating-a-HighPrecision-HighResolution-and-Highly-Reliable-Timer-Utilising-Minimal-CPU-Resources.htm Download links: (can't download if from any of them) http://en.pudn.com/Download/item/id/1109294.html http://www.codeforge.com/article/136174#introduction https://download.csdn.net/download/gddsky/267438 It would be great if someone would share PreciseTimer.zip!
-
- 4 replies
- 4.2k views
i was testing quads using multiple colors (gouraud-shade) and for some reason virtual machines either inverts the quad colors or vertex order here's a screenshot i did a test using the same exe in my host and guest virtual machine, at the left of their screen they are all three triangles, both quads at the right also enumerated the vertex order in which they are drawn in the image, you can notice the quads color or vertex are inverted on the virtual machine i tested on VMware and a friend also tested on VirtualBox, the result is the same on both, may i ask why this happens? attached the exe and source, the assembly source is here if that's better …
-
- 1 reply
- 3.8k views
While looking at Nehe's tutorial for opengl i noticed that they had a masm32 conversion for these examples, the tutorials start here: http://nehe.gamedev.net/tutorial/lessons_01__05/22004/ then quickly realized the links were offline, but fortunately someone made a backup of most examples on github, including masm-converted ones, you can download them from here: https://github.com/gamedev-net/nehe-opengl/ they used some definitions files that weren't included, luckily i found these .def files in the sources of a Northern Dragons' demogroup 4k intro named Trees, it was the only place to get them so i spread them here so you can compile and follow the gr…
-
Attaching Olly to a process created on suspend mode:
by CodeExplorer- 6 replies
- 4.6k views
Visual C++ code: int processflags = 0|CREATE_SUSPENDED; // Create a child process. if (strlen(environmentstr)>2) { fSuccess = CreateProcess(processname, NULL, NULL, NULL, TRUE, processflags, (LPVOID) chNewEnv, // environment NULL, &siStartInfo, &piProcInfo); } else { fSuccess = CreateProcess(processname, NULL, NULL, NULL, TRUE, processflags, NULL, // No environment NULL, &siStartInfo, &piProcInfo); } If I attach with Olly to the new created process I get this: 02980000 CC INT3 02980001 68 7F23BF77 PUSH 0x77BF237F 02980006 C3 RETN INT3 should be there but shouldn't be actually executed…
-
Timer Replacer (Visual C++)
by CodeExplorer- 18 replies
- 7.7k views
Time in milliseconds of a timer: time1 = when timer started time1 = when timer proc ended time1=9182437 time2=9182437 time1=9182452 The difference is big: 15 ms! I know that 1 millisecond is much for computer performance! I've tested some code and the time in ms was not even 1 ms. uElapse [in] Type: UINT The time-out value, in milliseconds. If uElapse is less than USER_TIMER_MINIMUM (0x0000000A), the timeout is set to USER_TIMER_MINIMUM. If uElapse is greater than USER_TIMER_MAXIMUM (0x7FFFFFFF), the timeout is set to USER_TIMER_MAXIMUM. I need something much better then a timer!
-
- 1 reply
- 4.6k views
Hello! i've been looking for a way to add a menu using WinAPI within the same .asm file, without using resource (.rc) files It can be done in C, like explained in this tutorial http://zetcode.com/gui/winapi/menus/ MASM32's User.lib has the same function prototypes in there (CreateMenu, AppendMenuW, SetMenu) This is for two reasons, one is because i'd like them not to be edited/spoted using Resource Editors, the other is that i want to keep everything on one .asm source file (as what i want to do is small enough) I've not seen anyone documenting how to do this before in MASM32 (or even other Win32-targeted compilers) and ran out of ideas trying, any kin…