joyce8/EMBER2024-capa huggingface dataset:
Function at 0x4013e3
Capabilities:
Get common file path
Print debug messages

Disassembly:
jmp 0x403480
sub esp, 0x10c
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x108], eax
mov eax, dword [0x4c8dc4]
test eax, eax
push edi
mov edi, ecx
je 0x4034a7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4c8dc8]
cmp dword [eax - 0xc], 0
je 0x4034de
push 0
push 0x80
push 4
push 0
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [0x4c8dc4], eax
jne 0x403572
mov eax, dword [0x4c8dc8]
push esi
push eax
lea esi, [edi + 4]
push str._s_could_not_be_created_or_opened__defaulting_to_temp_dir_n
push esi
call fcn.0040105f
push esi
lea eax, [esp + 0x18]
push 0x4a303c
push eax
call fcn.004011fe
mov ecx, dword [eax]
add esp, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [esp + 8]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
pop esi
jg 0x40352b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x104
lea ecx, [esp + 0xc]
push 0
push ecx
call fcn.00451640
add esp, 0xc
lea edx, [esp + 8]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push str.temp.log
lea eax, [esp + 0xc]
push eax
push 0x4a3058
push 0x4c8dc8
call fcn.0040105f
add esp, 0x10
mov ecx, edi
call fcn.004013e3
mov ecx, dword [esp + 0x10c]
pop edi
xor ecx, esp
mov al, 1
call fcn.0045162d
add esp, 0x10c
ret
Function at 0x401424
Capabilities:
Get common file path

Disassembly:
jmp 0x409670
push 0xffffffffffffffff
push 0x498591
mov eax, dword fs:[0]
push eax
sub esp, 0x124
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x120], eax
push esi
push edi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x130]
mov dword fs:[0], eax
mov esi, dword [esp + 0x140]
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push 0x4a310a
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x2c], esp
push str..FileToEmail.cpp
mov dword [esp + 0x144], 0
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push str.GetDesktopDir
mov byte [esp + 0x148], 1
call fcn.004012d5
lea ecx, [esp + 0x20]
mov dword [esp + 0x144], 0xffffffff
call fcn.0040130c
push 0x104
lea eax, [esp + 0x2c]
push 0
push eax
mov dword [esp + 0x144], 2
call fcn.00451640
add esp, 0xc
push 1
push 0x10
lea ecx, [esp + 0x30]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
test eax, eax
jne 0x409772
push 0xffffffffffffffff
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push str.Failed_to_get_users_data_directory
call fcn.004012d5
lea ecx, [esp + 0x1c]
call fcn.00401514
lea ecx, [esp + 0x14]
mov dword [esp + 0x138], 0xffffffff
call fcn.004013f2
xor al, al
jmp 0x4097ce
lea edi, [esp + 0x28]
add edi, 0xffffffff
lea esp, [esp]
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x409780
mov dx, word [0x4a33c8]
lea eax, [esp + 0x28]
mov word [edi], dx
lea edx, [eax + 1]
jmp 0x4097a0
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4097a0
sub eax, edx
push eax
lea eax, [esp + 0x2c]
push eax
mov ecx, esi
call fcn.00401032
lea ecx, [esp + 0x14]
mov dword [esp + 0x138], 0xffffffff
call fcn.004013f2
mov al, 1
mov ecx, dword [esp + 0x130]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.0045162d
add esp, 0x130
ret 4
Function at 0x401438
Capabilities:
Get number of processors
Query environment variable

Disassembly:
jmp 0x405c10
push 0xffffffffffffffff
push 0x497db0
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x30]
mov dword fs:[0], eax
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
xor edi, edi
push 0x4a310a
mov dword [esp + 0x40], edi
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push str..FileToEmail.cpp
mov byte [esp + 0x44], 1
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push str.ExpandVar
mov byte [esp + 0x48], 2
call fcn.004012d5
lea ecx, [esp + 0x2c]
mov byte [esp + 0x44], 0
call fcn.0040130c
mov ecx, dword [esp + 0x44]
mov byte [esp + 0x38], 3
call fcn.004011b3
mov ebp, dword [esp + 0x40]
xor bl, bl
lea esp, [esp]
add edi, 0x64
push edi
call fcn.004121b7
add esp, 4
push edi
mov esi, eax
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x405ce6
cmp eax, edi
jae 0x405ce8
test esi, esi
jne 0x405cc7
xor eax, eax
jmp 0x405cdb
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x405cd0
sub eax, edx
mov ecx, dword [esp + 0x44]
push eax
push esi
call fcn.00401032
mov bl, 1
push esi
call fcn.004121bc
add esp, 4
test bl, bl
je 0x405ca0
mov eax, dword [esp + 0x44]
mov ecx, dword [eax]
cmp dword [ecx - 0xc], 0
lea ecx, [esp + 0x20]
setne bl
mov byte [esp + 0x38], 0
call fcn.004013f2
lea eax, [ebp - 0x10]
mov dword [esp + 0x38], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405d34
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, bl
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 8
Function at 0x4014b0
Capabilities:
Get common file path

Disassembly:
jmp 0x406860
push 0xffffffffffffffff
push 0x498011
mov eax, dword fs:[0]
push eax
sub esp, 0x124
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x120], eax
push esi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x12c]
mov dword fs:[0], eax
mov esi, dword [esp + 0x13c]
push ecx
mov ecx, esp
mov dword [esp + 0x10], esp
push 0x4a310a
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push str..FileToEmail.cpp
mov dword [esp + 0x140], 0
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push str.GetWindowsDir
mov byte [esp + 0x144], 1
call fcn.004012d5
lea ecx, [esp + 0x20]
mov dword [esp + 0x140], 0xffffffff
call fcn.0040130c
push 0x104
lea eax, [esp + 0x28]
push 0
push eax
mov dword [esp + 0x140], 2
call fcn.00451640
add esp, 0xc
push 0x104
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
jne 0x406944
lea ecx, [esp + 0x14]
mov dword [esp + 0x134], 0xffffffff
call fcn.004013f2
xor al, al
jmp 0x406987
lea eax, [esp + 0x24]
lea edx, [eax + 1]
jmp 0x406950
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406950
sub eax, edx
push eax
lea edx, [esp + 0x28]
push edx
mov ecx, esi
call fcn.00401032
push 0x5c
mov ecx, esi
call fcn.00401366
lea ecx, [esp + 0x14]
mov dword [esp + 0x134], 0xffffffff
call fcn.004013f2
mov al, 1
mov ecx, dword [esp + 0x12c]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.0045162d
add esp, 0x130
ret 4
Function at 0x4014ce
Capabilities:
Check os version

Disassembly:
jmp 0x404c40
sub esp, 0x98
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x94], eax
push ebx
mov ebx, dword [esp + 0xa8]
push ebp
push esi
mov esi, dword [esp + 0xac]
push edi
mov edi, dword [esp + 0xac]
lea eax, [esp + 0x10]
push eax
mov ebp, ecx
mov dword [esp + 0x14], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x404d96
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
push str.Major_Version:__d__Minor_Version:__d__Build:__d__Platform:__d___s
push edi
call fcn.0040105f
mov eax, dword [esp + 0x3c]
add esp, 0x1c
cmp eax, 1
mov dword [ebx], eax
jne 0x404cf8
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x404cce
push str.Windows_95
jmp 0x404d8f
cmp eax, 0xa
jne 0x404cdd
push str.Windows_98
jmp 0x404d8f
cmp eax, 0x5a
mov ecx, esi
jne 0x404cee
push str.Windows_Me
jmp 0x404d91
push str.Unknown_9x_system
jmp 0x404d91
cmp eax, 2
jne 0x404d8a
mov eax, dword [esp + 0x14]
cmp eax, 3
jne 0x404d21
cmp dword [esp + 0x18], 0x33
mov ecx, esi
jne 0x404d1a
push str.Windows_NT_3.51
jmp 0x404d91
push str.Unknown_major_3_version
jmp 0x404d91
cmp eax, 4
jne 0x404d3d
cmp dword [esp + 0x18], 0
mov ecx, esi
jne 0x404d36
push str.Windows_NT_4.0
jmp 0x404d91
push str.Unknown_major_4_version
jmp 0x404d91
cmp eax, 5
jne 0x404d83
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x404d51
push str.Windows_2000
jmp 0x404d8f
cmp eax, 1
jne 0x404d7c
cmp dword [esp + 0x1c], 0xe10
mov ecx, esi
jbe 0x404d69
push str.probably_Windows_.NET_Server
jmp 0x404d91
push str.probably_Windows_XP
call fcn.004013c0
mov byte [ebp + 0xa8], 1
jmp 0x404d96
push str.Unknown_major_5_version
jmp 0x404d8f
push str.Unknown_NT_platform
jmp 0x404d8f
push str.Unknown_platform
mov ecx, esi
call fcn.004013c0
mov ecx, dword [esp + 0xa4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0045162d
add esp, 0x98
ret 0xc
Function at 0x401523
Capabilities:
Extract resource via kernel32 functions

Disassembly:
jmp 0x401af0
push ebx
mov ebx, dword [esp + 8]
push edi
mov edi, dword [esp + 0x10]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x401b09
pop edi
pop ebx
ret
push esi
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov esi, eax
test esi, esi
je 0x401b44
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ecx, dword [esp + 0x18]
add eax, esi
and ecx, 0xf
jbe 0x401b40
lea ebx, [ebx]
cmp esi, eax
jae 0x401b44
sub ecx, 1
movzx edx, word [esi]
lea esi, [esi + edx*2 + 2]
jne 0x401b30
cmp esi, eax
jb 0x401b4a
pop esi
pop edi
xor eax, eax
pop ebx
ret
mov ax, word [esi]
neg ax
sbb eax, eax
and eax, esi
pop esi
pop edi
pop ebx
ret

Function at 0x402c00
Capabilities:
Print debug messages
Write file on windows

Disassembly:
jmp 0x402c00
push 0xffffffffffffffff
push 0x4976f8
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push esi
push edi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x14]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [esp + 0x28]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], 0
je 0x402c4a
push eax
mov eax, dword [esp + 0x28]
push eax
lea ecx, [esp + 0x2c]
push ecx
call fcn.0040105f
add esp, 0xc
mov ebx, dword [esp + 0x24]
mov edx, dword [esi + 8]
mov eax, dword [esi + 0xc]
push ebx
push edx
push eax
lea edi, [esi + 4]
push str._s:__s___s_r_n
push edi
call fcn.0040105f
push edi
lea ecx, [esp + 0x40]
push 0x4a303c
push ecx
call fcn.004011fe
mov eax, dword [eax]
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
add esp, 0x20
push eax
call esi
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402ca3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [edi]
mov edx, dword [0x4c8dc4]
push 0
lea ecx, [esp + 0x14]
push ecx
mov dword [esp + 0x18], 0
mov eax, dword [edi - 0xc]
push eax
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402cd1
push str._FILEToEmail:_Could_Not_Write_message_to_Log_File_n
call esi
lea eax, [ebx - 0x10]
mov dword [esp + 0x1c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402cf5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 0x10
ret 8
Function at 0x403480
Capabilities:
Get common file path
Print debug messages

Disassembly:
jmp 0x403480
sub esp, 0x10c
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x108], eax
mov eax, dword [0x4c8dc4]
test eax, eax
push edi
mov edi, ecx
je 0x4034a7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4c8dc8]
cmp dword [eax - 0xc], 0
je 0x4034de
push 0
push 0x80
push 4
push 0
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [0x4c8dc4], eax
jne 0x403572
mov eax, dword [0x4c8dc8]
push esi
push eax
lea esi, [edi + 4]
push str._s_could_not_be_created_or_opened__defaulting_to_temp_dir_n
push esi
call fcn.0040105f
push esi
lea eax, [esp + 0x18]
push 0x4a303c
push eax
call fcn.004011fe
mov ecx, dword [eax]
add esp, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [esp + 8]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
pop esi
jg 0x40352b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x104
lea ecx, [esp + 0xc]
push 0
push ecx
call fcn.00451640
add esp, 0xc
lea edx, [esp + 8]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push str.temp.log
lea eax, [esp + 0xc]
push eax
push 0x4a3058
push 0x4c8dc8
call fcn.0040105f
add esp, 0x10
mov ecx, edi
call fcn.004013e3
mov ecx, dword [esp + 0x10c]
pop edi
xor ecx, esp
mov al, 1
call fcn.0045162d
add esp, 0x10c
ret
Function at 0x404c40
Capabilities:
Check os version

Disassembly:
jmp 0x404c40
sub esp, 0x98
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x94], eax
push ebx
mov ebx, dword [esp + 0xa8]
push ebp
push esi
mov esi, dword [esp + 0xac]
push edi
mov edi, dword [esp + 0xac]
lea eax, [esp + 0x10]
push eax
mov ebp, ecx
mov dword [esp + 0x14], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x404d96
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
push str.Major_Version:__d__Minor_Version:__d__Build:__d__Platform:__d___s
push edi
call fcn.0040105f
mov eax, dword [esp + 0x3c]
add esp, 0x1c
cmp eax, 1
mov dword [ebx], eax
jne 0x404cf8
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x404cce
push str.Windows_95
jmp 0x404d8f
cmp eax, 0xa
jne 0x404cdd
push str.Windows_98
jmp 0x404d8f
cmp eax, 0x5a
mov ecx, esi
jne 0x404cee
push str.Windows_Me
jmp 0x404d91
push str.Unknown_9x_system
jmp 0x404d91
cmp eax, 2
jne 0x404d8a
mov eax, dword [esp + 0x14]
cmp eax, 3
jne 0x404d21
cmp dword [esp + 0x18], 0x33
mov ecx, esi
jne 0x404d1a
push str.Windows_NT_3.51
jmp 0x404d91
push str.Unknown_major_3_version
jmp 0x404d91
cmp eax, 4
jne 0x404d3d
cmp dword [esp + 0x18], 0
mov ecx, esi
jne 0x404d36
push str.Windows_NT_4.0
jmp 0x404d91
push str.Unknown_major_4_version
jmp 0x404d91
cmp eax, 5
jne 0x404d83
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x404d51
push str.Windows_2000
jmp 0x404d8f
cmp eax, 1
jne 0x404d7c
cmp dword [esp + 0x1c], 0xe10
mov ecx, esi
jbe 0x404d69
push str.probably_Windows_.NET_Server
jmp 0x404d91
push str.probably_Windows_XP
call fcn.004013c0
mov byte [ebp + 0xa8], 1
jmp 0x404d96
push str.Unknown_major_5_version
jmp 0x404d8f
push str.Unknown_NT_platform
jmp 0x404d8f
push str.Unknown_platform
mov ecx, esi
call fcn.004013c0
mov ecx, dword [esp + 0xa4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0045162d
add esp, 0x98
ret 0xc
Function at 0x405c10
Capabilities:
Get number of processors
Query environment variable

Disassembly:
jmp 0x405c10
push 0xffffffffffffffff
push 0x497db0
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x30]
mov dword fs:[0], eax
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
xor edi, edi
push 0x4a310a
mov dword [esp + 0x40], edi
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push str..FileToEmail.cpp
mov byte [esp + 0x44], 1
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push str.ExpandVar
mov byte [esp + 0x48], 2
call fcn.004012d5
lea ecx, [esp + 0x2c]
mov byte [esp + 0x44], 0
call fcn.0040130c
mov ecx, dword [esp + 0x44]
mov byte [esp + 0x38], 3
call fcn.004011b3
mov ebp, dword [esp + 0x40]
xor bl, bl
lea esp, [esp]
add edi, 0x64
push edi
call fcn.004121b7
add esp, 4
push edi
mov esi, eax
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x405ce6
cmp eax, edi
jae 0x405ce8
test esi, esi
jne 0x405cc7
xor eax, eax
jmp 0x405cdb
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x405cd0
sub eax, edx
mov ecx, dword [esp + 0x44]
push eax
push esi
call fcn.00401032
mov bl, 1
push esi
call fcn.004121bc
add esp, 4
test bl, bl
je 0x405ca0
mov eax, dword [esp + 0x44]
mov ecx, dword [eax]
cmp dword [ecx - 0xc], 0
lea ecx, [esp + 0x20]
setne bl
mov byte [esp + 0x38], 0
call fcn.004013f2
lea eax, [ebp - 0x10]
mov dword [esp + 0x38], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405d34
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, bl
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 8
Function at 0x405da0
Capabilities:
Get common file path

Disassembly:
jmp 0x405da0
push 0xffffffffffffffff
push 0x497e01
mov eax, dword fs:[0]
push eax
sub esp, 0x124
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x120], eax
push esi
push edi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x130]
mov dword fs:[0], eax
mov esi, dword [esp + 0x140]
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push 0x4a310a
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x2c], esp
push str..FileToEmail.cpp
mov dword [esp + 0x144], 0
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push str.GetDataDirectory
mov byte [esp + 0x148], 1
call fcn.004012d5
lea ecx, [esp + 0x20]
mov dword [esp + 0x144], 0xffffffff
call fcn.0040130c
push 0x104
lea eax, [esp + 0x2c]
push 0
push eax
mov dword [esp + 0x144], 2
call fcn.00451640
add esp, 0xc
push 1
push 5
lea ecx, [esp + 0x30]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
test eax, eax
jne 0x405ea2
push 0xffffffffffffffff
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push str.Failed_to_get_users_data_directory
call fcn.004012d5
lea ecx, [esp + 0x1c]
call fcn.00401514
lea ecx, [esp + 0x14]
mov dword [esp + 0x138], 0xffffffff
call fcn.004013f2
xor al, al
jmp 0x405efe
lea edi, [esp + 0x28]
add edi, 0xffffffff
lea esp, [esp]
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x405eb0
mov dx, word [0x4a33c8]
lea eax, [esp + 0x28]
mov word [edi], dx
lea edx, [eax + 1]
jmp 0x405ed0
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x405ed0
sub eax, edx
push eax
lea eax, [esp + 0x2c]
push eax
mov ecx, esi
call fcn.00401032
lea ecx, [esp + 0x14]
mov dword [esp + 0x138], 0xffffffff
call fcn.004013f2
mov al, 1
mov ecx, dword [esp + 0x130]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.0045162d
add esp, 0x130
ret 4
Function at 0x405f90
Capabilities:
Get common file path
Get program files directory
Query or enumerate registry value

Disassembly:
jmp 0x405f90
push 0xffffffffffffffff
push 0x497e71
mov eax, dword fs:[0]
push eax
sub esp, 0x12c
mov eax, dword [0x4c6dd4]
xor eax, esp
mov dword [esp + 0x128], eax
push esi
mov eax, dword [0x4c6dd4]
xor eax, esp
push eax
lea eax, [esp + 0x134]
mov dword fs:[0], eax
mov esi, dword [esp + 0x144]
push ecx
mov ecx, esp
mov dword [esp + 0x2c], esp
push 0x4a310a
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x2c], esp
push str..FileToEmail.cpp
mov dword [esp + 0x148], 0
call fcn.004012d5
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push str.GetProgramFilesDir
mov byte [esp + 0x14c], 1
call fcn.004012d5
lea ecx, [esp + 0x20]
mov dword [esp + 0x148], 0xffffffff
call fcn.0040130c
push 0x104
lea eax, [esp + 0x30]
push 0
push eax
mov dword [esp + 0x148], 2
call fcn.00451640
add esp, 0xc
push 1
push 0x26
lea ecx, [esp + 0x34]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
test eax, eax
jne 0x4060ea
lea edx, [esp + 8]
push edx
push 1
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x1c], eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4060bb
mov edx, dword [esp + 8]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x30]
push ecx
push 0
push 0
push str.ProgramFilesDir
push edx
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4060d7
push 0xffffffffffffffff
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push str.Couldnt_read_ProgramFilesDir_from_reg
jmp 0x4060c9
push 0xffffffffffffffff
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push str.Couldnt_open_CurrentVersion_key
call fcn.004012d5
lea ecx, [esp + 0x1c]
call fcn.00401514
mov eax, dword [esp + 8]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp + 8], 0
lea eax, [esp + 0x2c]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4060f1
sub eax, edx
push eax
lea ecx, [esp + 0x30]
push ecx
mov ecx, esi
call fcn.00401032
mov edx, dword [esi]
cmp dword [edx - 0xc], 0
jne 0x406145
push 0xffffffffffffffff
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push str.Failed_to_get_the_OSs_program_files_directory
call fcn.004012d5
lea ecx, [esp + 0x1c]
call fcn.00401514
lea ecx, [esp + 0x14]
mov dword [esp + 0x13c], 0xffffffff
call fcn.004013f2
xor al, al
jmp 0x406169
push 1
push 0x4a33c8
mov ecx, esi
call fcn.004010ff
lea ecx, [esp + 0x14]
mov dword [esp + 0x13c], 0xffffffff
call fcn.004013f2
mov al, 1
mov ecx, dword [esp + 0x134]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [esp + 0x128]
xor ecx, esp
call fcn.0045162d
add esp, 0x138
ret 4