joyce8/EMBER2024-capa huggingface dataset:
Function at 0x404bfe
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x158
push ebx
mov ebx, ecx
lea eax, [ebx + 0x630]
cmp byte [eax], 0
jne 0x404c1c
xor eax, eax
jmp 0x404d3b
push esi
push edi
mov esi, 0x40c644
push esi
push eax
call fcn.004065c0
mov edi, eax
test edi, edi
pop ecx
pop ecx
jne 0x404c93
lea eax, [ebp - 0x158]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
lea edi, [ebx + 0x108]
jne 0x404c55
push 0x40c54c
jmp 0x404c5c
lea eax, [ebp - 0x158]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebx + 0x630]
push eax
push edi
lea eax, [ebp - 0x158]
push 0x40c508
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x158]
push esi
push eax
call fcn.004065c0
mov edi, eax
add esp, 0x18
test edi, edi
je 0x404cad
push 0x514
push 0
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
jne 0x404cb4
push edi
call fcn.004064fd
pop ecx
xor eax, eax
jmp 0x404d39
and dword [ebp - 4], 0
push edi
push 0x514
push esi
call fcn.004065d3
add esp, 0xc
test eax, eax
jne 0x404cd8
test byte [edi + 0xc], 0x10
je 0x404d28
mov dword [ebp - 4], 1
push 0x50
lea eax, [ebp - 0x54]
push 0
push eax
call fcn.00405830
add esp, 0xc
push esi
lea eax, [ebp - 0x54]
push eax
push esi
mov ecx, ebx
call fcn.004041d4
push esi
lea eax, [ebp - 0x54]
push eax
mov ecx, ebx
call fcn.0040491b
lea eax, [ebp - 0x54]
push eax
push 0x40c640
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x404d22
push esi
lea eax, [ebx + 0x734]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp dword [ebp - 4], 0
je 0x404cb8
push edi
call fcn.004064fd
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x404f93
Capabilities:
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x228
push esi
xor esi, esi
cmp dword [ebp + 0xc], esi
mov dword [ebp - 0xc], str.softwareEPSONSTM3STMDataEPNTarget
jne 0x404fb2
mov dword [ebp - 0xc], str.softwareEPSONSTM3STMDataEPLTarget
lea eax, [ebp + 0xc]
push eax
push 0x20019
push esi
push dword [ebp - 0xc]
mov dword [ebp + 0xc], esi
push 0x80000001
mov dword [ebp - 4], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x404fdc
push 4
pop eax
jmp 0x4050bd
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
push edi
lea eax, [ebp - 0x20]
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x124]
push eax
mov dword [ebp - 0x10], esi
mov edi, 0x104
push esi
jmp 0x40508d
cmp dword [ebp - 8], 0x103
je 0x4050ad
lea eax, [ebp - 4]
push eax
push 0x20019
push esi
lea eax, [ebp - 0x124]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405075
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x228]
push eax
push esi
push esi
push 0x40c64c
push dword [ebp - 4]
mov dword [ebp - 0x18], edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 4]
mov dword [ebp - 8], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 8], esi
mov dword [ebp - 4], esi
jne 0x405075
push dword [ebp + 8]
lea eax, [ebp - 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4050c0
inc dword [ebp - 0x10]
lea eax, [ebp - 0x20]
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x124]
push eax
push dword [ebp - 0x10]
push dword [ebp + 0xc]
mov dword [ebp - 0x14], edi
call ebx
mov dword [ebp - 8], eax
lea eax, [ebp - 0x124]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jne 0x405004
xor esi, esi
inc esi
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
mov eax, esi
pop ebx
pop esi
leave
ret
lea eax, [ebp - 0x124]
push eax
push dword [ebp - 0xc]
push str._s_s
push dword [ebp + 0x10]
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x4050b0
Function at 0x4050dd
Capabilities:
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
push ebx
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
push esi
push edi
mov dword [ebp - 0xc], str.softwareEPSONSTM3STMDataEPNTarget
jne 0x4050fe
mov dword [ebp - 0xc], str.softwareEPSONSTM3STMDataEPLTarget
mov esi, dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x18]
push eax
push ebx
push 0xf003f
push ebx
lea eax, [ebp + 0xf]
push eax
push ebx
push dword [ebp - 0xc]
mov edi, 0x80000001
push edi
mov byte [ebp + 0xf], bl
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 8], ebx
call esi
test eax, eax
je 0x405142
push 4
pop eax
jmp 0x405268
mov dword [ebp - 4], ebx
push dword [ebp - 4]
lea eax, [ebp - 0x11c]
push dword [ebp - 0xc]
push str._sP_016d
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 8]
push eax
push ebx
push 0xf003f
push ebx
lea eax, [ebp + 0xf]
push eax
push ebx
lea eax, [ebp - 0x11c]
push eax
push edi
call esi
test eax, eax
jne 0x405255
cmp dword [ebp - 0x14], 1
je 0x4051a6
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc dword [ebp - 4]
cmp dword [ebp - 4], 0x7fffffff
jl 0x405145
jmp 0x40525c
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
inc eax
push eax
push dword [ebp + 8]
push 1
push ebx
push 0x40c64c
push dword [ebp - 8]
call esi
test eax, eax
je 0x4051dd
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x10], 2
jmp 0x40525c
lea eax, [ebp - 0x11c]
push eax
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 4
pop eax
push eax
lea ecx, [ebp - 4]
push ecx
push eax
push ebx
mov edi, str.Setting
push edi
push dword [ebp - 8]
mov dword [ebp - 4], ebx
mov dword [ebp - 0xc], eax
call esi
push dword [ebp - 0xc]
lea eax, [ebp - 4]
push eax
push 4
push ebx
push str.Timer
push dword [ebp - 8]
mov dword [ebp - 4], 0xa
call esi
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
push eax
push ebx
push ebx
push edi
push dword [ebp - 8]
mov dword [ebp - 0x10], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405243
cmp dword [ebp - 4], ebx
je 0x40524a
mov dword [ebp - 0x10], 1
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40525c
mov dword [ebp - 0x10], 3
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x10]
pop edi
pop esi
pop ebx
leave
ret
Function at 0x40526d
Capabilities:
Delete registry key
Delete registry value
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x324
push esi
lea eax, [ebp - 4]
push eax
push 0xf003f
xor esi, esi
push esi
push dword [ebp + 8]
mov dword [ebp - 4], esi
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x4052a0
or eax, 0xffffffff
jmp 0x40538f
push ebx
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
mov ebx, 0x104
jmp 0x4052ef
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
je 0x40530e
lea eax, [ebp - 0x220]
push eax
push dword [ebp + 8]
lea eax, [ebp - 0x324]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x324]
push eax
call fcn.0040526d
add esp, 0x14
test eax, eax
jne 0x405326
lea eax, [ebp - 0x18]
push eax
push esi
push esi
push esi
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x220]
push eax
push esi
push dword [ebp - 4]
mov dword [ebp - 0x10], ebx
call edi
test eax, eax
je 0x4052af
lea eax, [ebp - 0x18]
push eax
push esi
push esi
push esi
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x11c]
push eax
mov dword [ebp - 8], esi
push esi
jmp 0x405368
or esi, 0xffffffff
jmp 0x405382
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
je 0x405374
lea eax, [ebp - 0x11c]
push eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
test eax, eax
je 0x405353
inc dword [ebp - 8]
lea eax, [ebp - 0x18]
push eax
push esi
push esi
push esi
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x11c]
push eax
push dword [ebp - 8]
push dword [ebp - 4]
mov dword [ebp - 0xc], ebx
call edi
test eax, eax
je 0x40532b
push dword [ebp + 8]
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
mov eax, esi
pop ebx
pop esi
leave
ret

Function at 0x405392
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
and dword [ebp - 4], 0
lea eax, [ebp - 4]
push eax
push 0xf003f
push 0
push dword [ebp + 8]
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x4053bd
or eax, 0xffffffff
leave
ret
push 4
lea eax, [ebp - 8]
push eax
push 4
push 0
push str.Setting
push dword [ebp - 4]
mov dword [ebp - 8], 0xff
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push dword [ebp + 8]
call fcn.0040526d
pop ecx
xor eax, eax
leave
ret
Function at 0x40664f
Capabilities:
Accept command line arguments
Parse pe header
Terminate process

Disassembly:
push 0x60
push 0x40c730
call fcn.004071fc
mov edi, 0x94
mov eax, edi
call fcn.00406110
mov dword [ebp - 0x18], esp
mov esi, esp
mov dword [esi], edi
push esi
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov ecx, dword [esi + 0x10]
mov dword [0x40f720], ecx
mov eax, dword [esi + 4]
mov dword [0x40f72c], eax
mov edx, dword [esi + 8]
mov dword [0x40f730], edx
mov esi, dword [esi + 0xc]
and esi, 0x7fff
mov dword [0x40f724], esi
cmp ecx, 2
je 0x4066af
or esi, 0x8000
mov dword [0x40f724], esi
shl eax, 8
add eax, edx
mov dword [0x40f728], eax
xor esi, esi
push esi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
cmp word [eax], 0x5a4d
jne 0x4066ea
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x4066ea
movzx eax, word [ecx + 0x18]
cmp eax, 0x10b
je 0x406702
cmp eax, 0x20b
je 0x4066ef
mov dword [ebp - 0x1c], esi
jmp 0x406716
cmp dword [ecx + 0x84], 0xe
jbe 0x4066ea
xor eax, eax
cmp dword [ecx + 0xf8], esi
jmp 0x406710
cmp dword [ecx + 0x74], 0xe
jbe 0x4066ea
xor eax, eax
cmp dword [ecx + 0xe8], esi
setne al
mov dword [ebp - 0x1c], eax
push esi
call fcn.00408c89
pop ecx
test eax, eax
jne 0x406742
cmp dword [0x40f6f0], 1
jne 0x40672f
call fcn.0040843e
push 0x1c
call fcn.004082c7
push 0xff
call fcn.00407a45
pop ecx
pop ecx
call fcn.00408be7
mov dword [ebp - 4], esi
call fcn.00408a3c
test eax, eax
jge 0x40675b
push 0x1b
call fcn.0040662a
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x410cd4], eax
call fcn.0040891a
mov dword [0x40f6e8], eax
call fcn.00408878
test eax, eax
jge 0x406781
push 8
call fcn.0040662a
pop ecx
call fcn.00408645
test eax, eax
jge 0x406792
push 9
call fcn.0040662a
pop ecx
push 1
call fcn.00407a75
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, esi
je 0x4067a8
push eax
call fcn.0040662a
pop ecx
mov dword [ebp - 0x44], esi
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
call fcn.004085e8
mov dword [ebp - 0x20], eax
test byte [ebp - 0x44], 1
je 0x4067c9
movzx eax, word [ebp - 0x40]
jmp 0x4067cc
push 0xa
pop eax
push eax
push dword [ebp - 0x20]
push esi
push esi
call edi
push eax
call fcn.00401d00
mov edi, eax
mov dword [ebp - 0x2c], edi
cmp dword [ebp - 0x1c], esi
jne 0x4067ea
push edi
call fcn.00407ba0
call fcn.00407bc2
jmp 0x40681c
or dword [ebp - 4], 0xffffffff
mov eax, edi
lea esp, [ebp - 0x7c]
call fcn.00407237
ret
Function at 0x407adf
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push esi
xor esi, esi
inc esi
cmp dword [0x40f760], esi
push edi
jne 0x407aff
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
cmp dword [ebp + 0xc], 0
mov al, byte [ebp + 0x10]
mov dword [0x40f75c], esi
mov byte [0x40f758], al
jne 0x407b65
mov ecx, dword [0x410cc8]
test ecx, ecx
je 0x407b46
mov eax, dword [0x410cc4]
sub eax, 4
cmp eax, ecx
jmp 0x407b3f
mov eax, dword [eax]
test eax, eax
je 0x407b31
call eax
mov eax, dword [0x410cc4]
sub eax, 4
cmp eax, dword [0x410cc8]
mov dword [0x410cc4], eax
jae 0x407b29
mov eax, 0x40f024
mov esi, 0x40f02c
cmp eax, esi
mov edi, eax
jae 0x407b65
mov eax, dword [edi]
test eax, eax
je 0x407b5e
call eax
add edi, 4
cmp edi, esi
jb 0x407b56
mov eax, 0x40f030
mov esi, 0x40f038
cmp eax, esi
mov edi, eax
jae 0x407b84
mov eax, dword [edi]
test eax, eax
je 0x407b7d
call eax
add edi, 4
cmp edi, esi
jb 0x407b75
cmp dword [ebp + 0x10], 0
pop edi
pop esi
jne 0x407b9e
push dword [ebp + 8]
mov dword [0x40f760], 1
call fcn.00407a45
pop ebp
ret

Function at 0x407e28
Capabilities:
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
push edi
push 4
pop eax
call fcn.00406110
mov esi, esp
push 0x1c
lea eax, [ebp - 0x28]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x407ec3
mov ebx, dword [ebp - 0x24]
lea eax, [ebp - 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov ecx, dword [ebp - 0x48]
mov eax, dword [0x40f720]
lea edi, [ecx - 1]
not edi
and edi, esi
sub edi, ecx
mov esi, eax
dec esi
neg esi
sbb esi, esi
and esi, 0xfffffff1
add esi, 0x11
imul esi, ecx
add esi, ebx
cmp edi, esi
mov dword [ebp - 8], ecx
jb 0x407ec3
cmp eax, 1
je 0x407ee4
mov dword [ebp - 4], ebx
mov ebx, 0x1000
push 0x1c
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x407ec3
mov eax, dword [ebp - 0x1c]
add dword [ebp - 4], eax
test dword [ebp - 0x18], ebx
je 0x407e90
test byte [ebp - 0x13], 1
mov eax, dword [ebp - 0x28]
mov dword [ebp - 4], eax
je 0x407ebf
xor eax, eax
inc eax
jmp 0x407f03
cmp edi, eax
jae 0x407ec7
xor eax, eax
jmp 0x407f03
cmp eax, esi
jae 0x407ece
mov dword [ebp - 4], esi
push 4
push ebx
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov eax, dword [0x40f720]
jmp 0x407ee7
mov dword [ebp - 4], edi
dec eax
neg eax
sbb eax, eax
and eax, 0x103
lea ecx, [ebp - 0xc]
push ecx
inc eax
push eax
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
lea esp, [ebp - 0x58]
pop edi
pop esi
pop ebx
leave
ret
Function at 0x4082c7
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x8c]
sub esp, 0x10c
mov eax, dword [0x40f08c]
mov ecx, dword [ebp + 0x94]
push ebx
push esi
mov dword [ebp + 0x88], eax
xor edx, edx
push edi
xor eax, eax
cmp ecx, dword [eax*8 + 0x40f0a8]
je 0x4082fc
inc eax
cmp eax, 0x13
jb 0x4082ed
mov esi, eax
shl esi, 3
cmp ecx, dword [esi + 0x40f0a8]
jne 0x408422
mov eax, dword [0x40f6f0]
cmp eax, 1
je 0x4083fa
cmp eax, edx
jne 0x40832c
cmp dword [0x40f084], 1
je 0x4083fa
cmp ecx, 0xfc
je 0x408422
push 0x104
lea eax, [ebp - 0x80]
push eax
push edx
mov byte [ebp + 0x84], dl
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x408362
lea eax, [ebp - 0x80]
push str._program_name_unknown_
push eax
call fcn.00407d30
pop ecx
pop ecx
lea edi, [ebp - 0x80]
mov eax, edi
push eax
call fcn.004058b0
inc eax
cmp eax, 0x3c
pop ecx
jbe 0x408396
mov eax, edi
push eax
call fcn.004058b0
mov edi, eax
lea eax, [ebp - 0x80]
sub eax, 0x3b
push 3
add edi, eax
push 0x40cbe0
push edi
call fcn.0040b340
add esp, 0x10
push edi
call fcn.004058b0
push dword [esi + 0x40f0ac]
mov ebx, eax
call fcn.004058b0
lea eax, [ebx + eax + 0x1c]
pop ecx
add eax, 3
pop ecx
and eax, 0xfffffffc
call fcn.00406110
mov ebx, esp
push str.Runtime_Error__n_nProgram:
push ebx
call fcn.00407d30
push edi
push ebx
call fcn.00407d40
push 0x40cbc0
push ebx
call fcn.00407d40
push dword [esi + 0x40f0ac]
push ebx
call fcn.00407d40
push 0x12010
push str.Microsoft_Visual_C_Runtime_Library
push ebx
call fcn.0040b23f
add esp, 0x2c
jmp 0x408422
push edx
lea eax, [ebp + 0x94]
push eax
lea esi, [esi + 0x40f0ac]
push dword [esi]
call fcn.004058b0
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]
lea esp, [ebp - 0x8c]
mov ecx, dword [ebp + 0x88]
call fcn.0040b495
pop edi
pop esi
pop ebx
add ebp, 0x8c
leave
ret
Function at 0x409bc5
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, dword [esi + 8]
test bl, 3
jne 0x409bf3
mov eax, dword fs:[0x18]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 8]
cmp ebx, ecx
mov dword [ebp - 4], ecx
jb 0x409bfa
cmp ebx, dword [eax + 4]
jae 0x409bfa
xor eax, eax
jmp 0x409dea
push edi
mov edi, dword [esi + 0xc]
cmp edi, 0xffffffff
jne 0x409c0b
xor eax, eax
inc eax
jmp 0x409de9
xor edx, edx
mov dword [ebp + 8], edx
mov eax, ebx
mov ecx, dword [eax]
cmp ecx, 0xffffffff
je 0x409c21
cmp ecx, edx
jae 0x409d66
cmp dword [eax + 4], 0
je 0x409c2a
inc dword [ebp + 8]
inc edx
add eax, 0xc
cmp edx, edi
jbe 0x409c12
cmp dword [ebp + 8], 0
je 0x409c4c
mov eax, dword [esi - 8]
cmp eax, dword [ebp - 4]
jb 0x409d66
cmp eax, esi
jae 0x409d66
mov eax, dword [0x40f8a8]
mov edi, ebx
and edi, 0xfffff000
xor esi, esi
test eax, eax
jle 0x409c71
cmp dword [esi*4 + 0x40f8b0], edi
je 0x409d6a
inc esi
cmp esi, eax
jl 0x409c5f
push 0x1c
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x409de6
cmp dword [ebp - 8], 0x1000000
jne 0x409de6
test byte [ebp - 0xc], 0xcc
je 0x409cef
mov ecx, dword [ebp - 0x1c]
cmp word [ecx], 0x5a4d
jne 0x409de6
mov eax, dword [ecx + 0x3c]
add eax, ecx
cmp dword [eax], 0x4550
jne 0x409de6
cmp word [eax + 0x18], 0x10b
jne 0x409de6
sub ebx, ecx
cmp word [eax + 6], 0
movzx ecx, word [eax + 0x14]
lea ecx, [ecx + eax + 0x18]
jbe 0x409de6
mov eax, dword [ecx + 0xc]
cmp ebx, eax
jb 0x409cef
mov edx, dword [ecx + 8]
add edx, eax
cmp ebx, edx
jae 0x409cef
test byte [ecx + 0x27], 0x80
jne 0x409d66
push 1
push 0x40f8f0
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
jne 0x409c03
mov ecx, dword [0x40f8a8]
test ecx, ecx
mov edx, ecx
jle 0x409d23
lea eax, [ecx*4 + 0x40f8ac]
cmp dword [eax], edi
je 0x409d23
dec edx
sub eax, 4
test edx, edx
jg 0x409d17
test edx, edx
jne 0x409d54
push 0xf
pop ebx
cmp ecx, ebx
jg 0x409d30
mov ebx, ecx
xor edx, edx
test ebx, ebx
jl 0x409d48
lea eax, [edx*4 + 0x40f8b0]
mov esi, dword [eax]
inc edx
cmp edx, ebx
mov dword [eax], edi
mov edi, esi
jle 0x409d36
cmp ecx, 0x10
jge 0x409d54
inc ecx
mov dword [0x40f8a8], ecx
push 0
push 0x40f8f0
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
jmp 0x409c03
xor eax, eax
jmp 0x409de9
test esi, esi
jle 0x409c03
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push 1
push 0x40f8f0
call ebx
test eax, eax
jne 0x409c03
cmp dword [esi*4 + 0x40f8b0], edi
je 0x409dc0
mov eax, dword [0x40f8a8]
lea esi, [eax - 1]
test esi, esi
jl 0x409dae
cmp dword [esi*4 + 0x40f8b0], edi
je 0x409daa
dec esi
jns 0x409d9e
test esi, esi
jge 0x409dbe
cmp eax, 0x10
jge 0x409db9
inc eax
mov dword [0x40f8a8], eax
lea esi, [eax - 1]
jmp 0x409dc0
je 0x409dd8
xor ecx, ecx
test esi, esi
jl 0x409dd8
lea eax, [ecx*4 + 0x40f8b0]
mov edx, dword [eax]
inc ecx
cmp ecx, esi
mov dword [eax], edi
mov edi, edx
jle 0x409dc6
push 0
push 0x40f8f0
call ebx
jmp 0x409c03
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret
Function at 0x40a637
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x39c]
sub esp, 0x41c
mov ecx, dword [ebp + 0x3a4]
cmp ecx, dword [0x410ba4]
mov eax, dword [0x40f08c]
push ebx
push esi
mov dword [ebp + 0x398], eax
push edi
jae 0x40a7fd
mov eax, ecx
sar eax, 5
lea ebx, [eax*4 + 0x410bc0]
mov eax, dword [ebx]
mov esi, ecx
and esi, 0x1f
shl esi, 3
mov al, byte [eax + esi + 4]
test al, 1
mov dword [ebp - 0x80], ebx
je 0x40a7fd
xor edi, edi
cmp dword [ebp + 0x3ac], edi
mov dword [ebp - 0x74], edi
mov dword [ebp - 0x7c], edi
jne 0x40a6a1
xor eax, eax
jmp 0x40a811
test al, 0x20
je 0x40a6b2
push 2
push edi
push edi
push ecx
call fcn.0040b6c4
add esp, 0x10
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x40a787
cmp dword [ebp + 0x3ac], edi
mov eax, dword [ebp + 0x3a8]
mov dword [ebp - 0x70], eax
mov dword [ebp + 0x3a4], edi
jbe 0x40a7ce
mov ecx, dword [ebp - 0x70]
sub ecx, dword [ebp + 0x3a8]
lea eax, [ebp - 0x6c]
cmp ecx, dword [ebp + 0x3ac]
jae 0x40a714
mov edx, dword [ebp - 0x70]
inc dword [ebp - 0x70]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x40a705
inc dword [ebp - 0x7c]
mov byte [eax], 0xd
inc eax
inc edi
mov ebx, dword [ebp - 0x80]
mov byte [eax], dl
inc eax
inc edi
cmp edi, 0x400
jl 0x40a6e7
mov edi, eax
lea eax, [ebp - 0x6c]
sub edi, eax
push 0
lea eax, [ebp - 0x78]
push eax
push edi
lea eax, [ebp - 0x6c]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a754
mov eax, dword [ebp - 0x78]
add dword [ebp - 0x74], eax
cmp eax, edi
jl 0x40a760
mov eax, dword [ebp - 0x70]
sub eax, dword [ebp + 0x3a8]
xor edi, edi
cmp eax, dword [ebp + 0x3ac]
jb 0x40a6db
jmp 0x40a762
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x3a4], eax
xor edi, edi
mov eax, dword [ebp - 0x74]
cmp eax, edi
jne 0x40a7f8
cmp dword [ebp + 0x3a4], edi
je 0x40a7ce
push 5
pop eax
cmp dword [ebp + 0x3a4], eax
jne 0x40a7c0
mov dword [0x40f718], eax
jmp 0x40a804
push edi
lea ecx, [ebp - 0x78]
push ecx
push dword [ebp + 0x3ac]
push dword [ebp + 0x3a8]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a7b2
mov eax, dword [ebp - 0x78]
mov dword [ebp + 0x3a4], edi
mov dword [ebp - 0x74], eax
jmp 0x40a762
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x3a4], eax
jmp 0x40a762
push dword [ebp + 0x3a4]
call fcn.0040a40e
pop ecx
jmp 0x40a80e
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x40a7e6
mov eax, dword [ebp + 0x3a8]
cmp byte [eax], 0x1a
je 0x40a69a
mov dword [0x40f714], 0x1c
mov dword [0x40f718], edi
jmp 0x40a80e
sub eax, dword [ebp - 0x7c]
jmp 0x40a811
and dword [0x40f718], 0
mov dword [0x40f714], 9
or eax, 0xffffffff
mov ecx, dword [ebp + 0x398]
pop edi
pop esi
pop ebx
call fcn.0040b495
add ebp, 0x39c
leave
ret