Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

Kharfax

@Kharfax
About
Posts
124
Topics
34
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Chunked transfer encoding problem
    K Kharfax

    Hi guys, I think I'm going to lose my mind with this, I cant make my chunked transfer manager to work right. The problem I'm having is that reading the amount of data specified in the chunk-size, I end up having the next chunk size inside the body, so, when I call the next getchunksize, it fails. The first call to getChunkSize() works great and I get the size value as expected. The BufferedReader is connected to the sock s = new Socket(connectTo, portNum); sIn = new BufferedReader(new InputStreamReader(s.getInputStream()) ); Thanks a lot guys, I hope any of you understands what's going on... private String processChunked(BufferedReader sIn, String newData) throws IOException { newData += LINEBREAK; // Let's separate header form body int size = 0; String body = new String(); size = getChunkSize(sIn); while(size > 0) { body = getChunkData(sIn, size); size = getChunkSize(sIn); newData += body; body = ""; } return newData; } private String getChunkData(BufferedReader sIn, int lenght) throws IOException { int val = 0; String res = new String(); char chr = ' '; for(int i= 0; i val = sIn.read(); if(val == -1) break; chr = (char)val; res += Character.valueOf(chr).toString(); } return res; } private int getChunkSize(BufferedReader sIn) throws IOException { char chr = ' ', prvChr = ' '; int val = 0; String tmpSize = new String(); int size = 0; int readed = 0; do { //Read chunk size prvChr = chr; val = sIn.read(); if (val == -1) { break; } readed++; chr = (char) val; tmpSize += Character.valueOf(chr).toString(); } while (prvChr != '\r' && chr != '\n'); // calculate chunk size if(tmpSize.indexOf(";") != -1) { //remove chunk extension tmpSize = tmpSize.substring(0, tmpSi

    Java help

  • problem in copying file
    K Kharfax

    Maybe the operation is beign virtualized, thats why you dont get any error, but the file isn't copied. You'll need to elevate your app to copy the file, or find a non protected place to copy your file. Sysinternals haves a free application, process explorer that you can use to see the security attributes of your app, and if is running virtualized. Also I sugest you to include the UAC manifest in your .exe, Vista heuristics are a pain in the ass.

    Windows API help

  • Installers and UAC "heuristics"
    K Kharfax

    My app after beign elevated was running with vitualization turned off. I don't know the difference among a normal elevated app, an unsigned installer and a signed installer. Is pretty obvious there are differences, but people from MS dont want to explain them it seems.

    Windows API question help announcement

  • Installers and UAC "heuristics"
    K Kharfax

    Thanks, I added the manifest and now it seems to work fine. The UAC heuristics was detecting my app as an installer but I don't know why if my app had an "installer name" it failed. Some guy told me that the problem probably was originated by the compatibility heuristics that simulate an older Win version.

    Windows API question help announcement

  • Installers and UAC "heuristics"
    K Kharfax

    yeap, i knew about that, is used to support legacy installers... But the strange thing is that my installer works if the name is different from the "installer keywords" I dont understand...

    Windows API question help announcement

  • Installers and UAC "heuristics"
    K Kharfax

    Check this, I have a custom installer I made, it worked great in all win OSs, until Vista. With Vista, it works great with UAC turned off. If I turn on UAC, the heuristics detects that my program needs elevation, ok I understand that. Now, the big question is, what is the difference between my installer called pete.exe or caller instalar.exe? Well, If my installer is called "instalar" (install in spanish), it hangs up in the middle of the instalation, in different places, like getting an already installed component version, or creating a desktop shortcut. If my installer is called "pete", it works great, I dont see any problem. I dont know what to think... My installer isn't signed. Something is changing depending the .exe name. Anyone saw something like this? Should I use exe names Hax0r style to avoid this? my .exe should be called 1nst4l4r?

    Windows API question help announcement

  • Lowering resource Integrity Level
    K Kharfax

    Didn't work either :S I don't know what else to do. If I open the controller app first, my BHO cant communicate. Worst of all, when I use setsecurityinfo, I get no errors. And my app works, because if I turn off protected mode or open IE before my controller app it works fine. A lot of BHO developers are asking their clients to turn off protected mode in order to use their soft, I think I'll need to do the same :( -- modified at 9:42 Monday 30th April, 2007 I FIXED IT!! Thanks mate, using SE_KERNEL_OBJECT and don't allowing the BHO dll to init if is in the controller app address space it started to work :D

    Windows API question security performance help

  • Lowering resource Integrity Level
    K Kharfax

    Thanks a lot Michael, I'll check it and post the results :D

    Windows API question security performance help

  • Lowering resource Integrity Level
    K Kharfax

    Hi, I'm working in a Single Sign On App, and I need to comunicate a BHO with it's controller App, I'm using a memory mapped file for that. If the BHO is the one who creates the mapped file, everything works fine (The mapped file is LI) If the controller app creates the mapped file, the BHO fails to open the mapped file (The Mapped file is MI ) So I decided to lower the maped file integrity using the code provided by MS in the paper "Understanding and working in protected mode internet explorer". But that code doesnt work, and I have seen in this forum that a lot of people is having problems with that code, and I can't find any documentation about this at MSDN In resume: How can I lower a resource integrity level? Can someone help me or give me a hint? Here is the code I'm using to create the mapped file and lower the it's Integrity level: Notice that I replaced the values SDDL_REVISION_1 by 1 and LABEL_SECURITY_INFORMATION by 0x00000010L because I cant find where are defined. Thanks in advance HANDLE m_hMapVars = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, //&sa, PAGE_READWRITE, 0, 1024, "F31B3896-3455-4d0d-1234-2389346239874"); //Security Descriptor #define LOW_INTEGRITY_SDDL_SACL "S:(ML;;NW;;;LW)" PSECURITY_DESCRIPTOR pSd = NULL; PACL pSacl = NULL; BOOL fSaclPresent = FALSE; BOOL fSaclDefaulted = FALSE; if(ConvertStringSecurityDescriptorToSecurityDescriptor(LOW_INTEGRITY_SDDL_SACL, 1, &pSd , NULL)) { if(GetSecurityDescriptorSacl(pSd, &fSaclPresent, &pSacl, &fSaclDefaulted)) { if(ERROR_SUCCESS != SetSecurityInfo(m_hMapVars, SE_FILE_OBJECT, 0x00000010L , NULL,NULL,NULL, pSacl)) } } }

    Windows API question security performance help

  • On paint calling order
    K Kharfax

    Thanks for the quick reply people :D

    C / C++ / MFC help question

  • PostMessage and Send Message
    K Kharfax

    I think the problem isn't the message you are sending but your painting rutines that maybe are not freeing the allocated resources.

    C / C++ / MFC c++ com json performance question

  • On paint calling order
    K Kharfax

    Hi I have a picture box in my dialog, but I need to write something on top of it. The problem is that the onPaint dialog method is getting called before the control repaints itself, so I can never see the text. Someone knows what can I do to avoid this, and be able to write on top of the picture box? Thanks in advance

    C / C++ / MFC help question

  • Signing executables for Vista
    K Kharfax

    Hi I had made my own installer for my app. The installer needs to rise is rights to administrator, and Vista ask permision to the user. In the dialog shown in that case, how can I do to show the name of my company instead of "Editor no identificado" or "Unknow developer"? (I dont know what does it says in english because i have an Spanish Vista). Thanks

    Windows API question

  • USES_CONVERSION
    K Kharfax

    USES_CONVERSION is a macro that allows to use BSTR string conversion functions like OLE2T and T2OLE, at least thats why I used it, but never gave me any problem... Is defined in atlconv.h #define USES_CONVERSION int _convert = 0; (_convert); UINT _acp = ATL::_AtlGetConversionACP() /*CP_THREAD_ACP*/; (_acp); LPCWSTR _lpw = NULL; (_lpw); LPCSTR _lpa = NULL; (_lpa) I don't know man, no idea what could be the problem

    C / C++ / MFC help adobe debugging tutorial

  • Making strong passwords readeable
    K Kharfax

    Hey thanks a lot for the links :D

    C / C++ / MFC security help question lounge

  • Making strong passwords readeable
    K Kharfax

    noooooooo, I'm not paranoid, I use PGP with 1024 bit keys just to be 133t ;) I just needed something to make easier to the user the task of sharing passwords via phone. Lets supose the pass is "a&RT2"/(=fbTR16bJ" is really hard to say all that by phone, the idea is to transform that in something like "LU8C-RA7Z-12MVR-97YB" thats a lot easier to tell. I already found the answer to my problems, and is called Base32. Thanks a lot for the feedback anyway Maximilien :D

    C / C++ / MFC security help question lounge

  • Making strong passwords readeable
    K Kharfax

    Hi I'm working in a simple mail encryption system with random generated passwords. What I would like is to make some kind of encoding to the password in order to allow the user to share the password via phone. I tried replacing every char in the pass by its hexa ascii code, but the resulting number is too long, I'm using 32 chars keys. Any ideas on how could I solve this problem? Thanks a lot :D

    C / C++ / MFC security help question lounge

  • CreateFile fails to open temp file
    K Kharfax

    Solved Damn!, the path had " at the beginning and in the end, I trimed the " and now is working fine Thanks a lot for the help :D

    C / C++ / MFC help question

  • CreateFile fails to open temp file
    K Kharfax

    OK, I did this, I called shellexecute with notepad, and the file openned. ShellExecute(NULL, "open", "notepad.exe", param, NULL,SW_SHOW); So, I dont know :( Help please :D

    C / C++ / MFC help question

  • CreateFile fails to open temp file
    K Kharfax

    Hi I have a program asociated with a file extension, when I open the file via Outlook, it creates a temp file in: Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio My app receives the path, but CreateFile fails with error 123: File not exist The file exist, but that is a system/hidden folder. Why is failing to open the file?? This is my call to create file: HANDLE hFile = CreateFile(param, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); Thanks in advance :D

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups