Function at 0x40c260
Capabilities:
Create new key via cryptacquirecontext
Generate random numbers via winapi
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5fc
mov eax, dword [0x4138d0]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 0xc]
cmp esi, 2
mov dword [esp + 0x600], eax
push edi
jne 0x40c293
cmp ebx, 0x80
jb 0x40c293
mov ebx, 0x7f
mov eax, dword [0x413af8]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp + 8]
lea ecx, [esp + 0x18]
push ecx
push esi
push edx
call fcn.0040c0b0
mov ecx, 0x95
mov esi, 0x4130d8
lea edi, [esp + 0x1b4]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp + 0x14]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
lea edi, [esp + 0x1c8]
rep movsd dword es:[edi], dword [esi]
add esp, 0xc
push 0x30
mov ecx, eax
and ecx, 3
push 1
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x20]
push edx
call esi
push 0x28
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x20]
push ecx
call esi
test eax, eax
jne 0x40c336
mov edx, dword [0x413af8]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
mov ecx, dword [esp + 0x604]
call fcn.0040e0fe
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x14]
push eax
push 0
push 0
push 0x254
lea ecx, [esp + 0x1b8]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x40c389
push eax
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, dword [0x413af8]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
mov ecx, dword [esp + 0x604]
call fcn.0040e0fe
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [esp + 0x10]
push eax
call fcn.0040c130
mov ebx, eax
mov eax, dword [ebp + 0xc]
add esp, 4
cmp eax, 1
jne 0x40c45a
push 0x10e
lea ecx, [esp + 0x9c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov esi, dword [sym.imp.MSVCR71.dll_strrchr]
lea edx, [esp + 0x98]
push 0x5c
push edx
call esi
mov byte [eax], 0
lea eax, [esp + 0xa0]
push 0x5c
push eax
call esi
mov edi, eax
mov ecx, 7
mov esi, str.Jobs_and_SettingsSoftKey.DAT
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
lea ecx, [esp + 0xa8]
push 0x410f54
push ecx
movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCR71.dll_fopen]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x40c45a
mov edi, dword [sym.imp.MSVCR71.dll_fwrite]
push esi
push 1
lea edx, [ebp + 8]
push 4
push edx
call edi
mov ecx, dword [esp + 0x20]
add esp, 0x10
lea eax, [esp + 0x400]
push eax
push 0x200
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push esi
push 1
lea edx, [esp + 0x408]
push 0x200
push edx
call edi
push esi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 0x14
mov eax, dword [esp + 0x10]
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, dword [0x413af8]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [esp + 0x604]
mov eax, ebx
call fcn.0040e0fe
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret