joyce8/EMBER2024-capa huggingface dataset:
Function at 0x401090
Capabilities:
Query service status

Disassembly:
sub esp, 0x1c
push ebx
mov ebx, dword [esp + 0x28]
push esi
push edi
mov edi, dword [esp + 0x2c]
push 0xf01ff
push edx
mov dword [edi], 0
push ecx
mov dword [ebx], 0
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
je 0x4010e6
lea eax, [esp + 0xc]
push eax
push esi
mov dword [edi], 1
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
push esi
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp edi, 1
jne 0x4010f1
cmp dword [esp + 0x10], 4
jne 0x4010e6
mov dword [ebx], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x1c
ret 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x40b540]
push eax
push str.CheckSvc:_QueryServiceStatus_failed__Win32_status:__d
push 0x3eb
push ecx
call fcn.00401000
add esp, 0x10
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x1c
ret 8

Function at 0x401120
Capabilities:
Stop service

Disassembly:
sub esp, 0x1c
push esi
push 0xf01ff
push edx
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
jne 0x40113c
pop esi
add esp, 0x1c
ret
push edi
lea eax, [esp + 8]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
push esi
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
cmp edi, 1
pop edi
setne al
pop esi
add esp, 0x1c
ret

Function at 0x401170
Capabilities:
Delete service

Disassembly:
push esi
push 0xf01ff
push edx
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
jne 0x401186
pop esi
ret
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
push esi
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
jne 0x4011ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [0x40b540]
push str.RemoveSvc:_DeleteService_failed._Win32_status:__d
push 0x3eb
push eax
call fcn.00401000
add esp, 0x10
xor eax, eax
cmp edi, 1
pop edi
setne al
pop esi
ret

Function at 0x4011d0
Capabilities:
Start service

Disassembly:
push esi
push 0xf01ff
push edx
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
jne 0x40120a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [0x40b540]
push str.StartSvc:_OpenService_failed._Win32_status:__d
push 0x3eb
push eax
call fcn.00401000
add esp, 0x10
mov eax, 1
pop esi
ret
push edi
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x401254
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0x420
je 0x401254
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
mov ecx, dword [0x40b540]
push eax
push str.StartSvc:_StartService_failed._Win32_status:__d
push 0x3eb
push ecx
call fcn.00401000
add esp, 0x10
pop edi
mov eax, 1
pop esi
ret
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop edi
xor eax, eax
pop esi
ret
Function at 0x401260
Capabilities:
Create service

Disassembly:
mov eax, dword [esp + 4]
push esi
push 0
push 0
push 0
push 0
push 0
push eax
mov eax, dword [esp + 0x24]
push 1
mov esi, edx
mov edx, dword [esp + 0x2c]
push edx
push eax
push 0xf01ff
push esi
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
test eax, eax
jne 0x4012ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x40b540]
push eax
push esi
push str.InstallSvc:_CreateService_failed.__s._Win32_status:__d
push 0x3eb
push ecx
call fcn.00401000
add esp, 0x14
mov eax, 1
pop esi
ret 0xc
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
pop esi
ret 0xc

Function at 0x4012d0
Capabilities:
Create process on windows

Disassembly:
sub esp, 0x54
push esi
push edi
mov esi, ecx
xor eax, eax
mov ecx, 0x11
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
mov dword [esp + 8], eax
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], eax
lea ecx, [esp + 8]
push ecx
mov dword [esp + 0x18], eax
lea eax, [esp + 0x1c]
push eax
push edx
push 0
push 0
push 0
push 0
push 0
push 0x40b544
push esi
mov dword [esp + 0x40], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x401346
mov ecx, dword [0x40b540]
push esi
push str.Could_not_start__s
push 0x3eb
push ecx
call fcn.00401000
add esp, 0x10
pop edi
mov eax, 1
pop esi
add esp, 0x54
ret
pop edi
xor eax, eax
pop esi
add esp, 0x54
ret

Function at 0x401350
Capabilities:
Delete registry value
Persist via run registry key

Disassembly:
push ecx
mov eax, dword [0x40b540]
push ebx
push esi
push edi
push str.Removing_auto_start_registration
mov edi, edx
push 0x3eb
push eax
mov ebx, ecx
mov dword [edi], 1
call fcn.00401000
add esp, 0xc
lea ecx, [esp + 0xc]
push ecx
push 0xf003f
push 0
push 0x40a17c
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov esi, eax
test esi, esi
je 0x4013c3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x40b540]
push eax
push esi
push 0x40a1ac
push 0x3eb
push edx
call fcn.00401000
add esp, 0x14
pop edi
pop esi
mov eax, 1
pop ebx
pop ecx
ret
mov eax, dword [esp + 0xc]
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
mov esi, eax
cmp esi, 2
jne 0x4013fc
mov ecx, dword [0x40b540]
push str.No_previous_registration_exists
push 0x3eb
push ecx
call fcn.00401000
add esp, 0xc
mov dword [edi], 0
pop edi
pop esi
xor eax, eax
pop ebx
pop ecx
ret
test esi, esi
je 0x40142b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x40b540]
push eax
push esi
push str.RegDeleteValue_failed._Return_value:__d._Win32_error:__d
push 0x3eb
push edx
call fcn.00401000
add esp, 0x14
pop edi
pop esi
mov eax, 1
pop ebx
pop ecx
ret
mov eax, dword [0x40b540]
push str.Registration_removed
push 0x3eb
push eax
call fcn.00401000
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
pop ecx
ret
Function at 0x401450
Capabilities:
Persist via run registry key
Set registry value

Disassembly:
push ecx
mov eax, dword [0x40b540]
push ebx
push esi
push edi
push str.Registering_for_auto_start_...
push 0x3eb
push eax
mov esi, edx
mov ebx, ecx
call fcn.00401000
add esp, 0xc
lea ecx, [esp + 0xc]
push ecx
push 0xf003f
push 0
push str.SOFTWAREMICROSOFTWINDOWSCURRENTVERSIONRUN
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov edi, eax
test edi, edi
je 0x4014bd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x40b540]
push eax
push edi
push 0x40a2a8
push 0x3eb
push edx
call fcn.00401000
add esp, 0x14
pop edi
pop esi
mov eax, 1
pop ebx
pop ecx
ret
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4014c2
sub eax, edx
inc eax
push eax
mov eax, dword [esp + 0x10]
push esi
push 1
push 0
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ecx, dword [esp + 0xc]
push ecx
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x40151a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x40b540]
push eax
push esi
push str.Error:_RegSetValueEx_failed._Return_value:__d._Win32_error:__d
push 0x3eb
push edx
call fcn.00401000
add esp, 0x14
pop edi
pop esi
mov eax, 1
pop ebx
pop ecx
ret
pop edi
pop esi
xor eax, eax
pop ebx
pop ecx
ret

Function at 0x4015f0
Capabilities:
Delete file
Set file attributes

Disassembly:
sub esp, 0x244
push esi
push edi
lea esi, [esp + 8]
mov eax, edx
sub esi, ecx
push ebx
mov bl, byte [ecx]
mov byte [esi + ecx], bl
inc ecx
test bl, bl
jne 0x401601
lea ecx, [esp + 0xc]
lea esi, [ecx + 1]
mov bl, byte [ecx]
inc ecx
test bl, bl
jne 0x401612
sub ecx, esi
cmp byte [esp + ecx + 0xb], 0x5c
je 0x401656
mov ecx, 0x40a324
mov esi, ecx
lea esp, [esp]
mov bl, byte [ecx]
inc ecx
test bl, bl
jne 0x401630
sub ecx, esi
lea edi, [esp + 0xc]
mov ebx, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401640
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, eax
pop ebx
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401660
lea edi, [esp + 8]
sub eax, edx
dec edi
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401670
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea eax, [esp + 0x10c]
rep movsb byte es:[edi], byte [esi]
push eax
lea ecx, [esp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
pop edi
pop esi
jne 0x4016ab
xor eax, eax
add esp, 0x244
ret
push 0
lea edx, [esp + 4]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jne 0x4016c8
mov eax, 1
add esp, 0x244
ret
lea eax, [esp]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
neg eax
sbb eax, eax
inc eax
add esp, 0x244
ret
Function at 0x4016e0
Capabilities:
Copy file

Disassembly:
sub esp, 0x348
push ebp
mov ebp, edx
lea edx, [esp + 0x108]
push esi
sub edx, ecx
mov al, byte [ecx]
mov byte [edx + ecx], al
inc ecx
test al, al
jne 0x4016f3
lea eax, [esp + 0x10c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401707
sub eax, edx
cmp byte [esp + eax + 0x10b], 0x5c
push edi
je 0x40174b
mov eax, 0x40a328
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401722
lea edi, [esp + 0x110]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401733
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, ebp
mov edx, ebp
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401750
lea edi, [esp + 0x110]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401761
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x358]
and ecx, 3
lea edx, [esp + 0xc]
rep movsb byte es:[edi], byte [esi]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x401786
lea eax, [esp + 0xc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401797
sub eax, edx
cmp byte [esp + eax + 0xb], 0x5c
je 0x4017d8
mov eax, 0x40a32c
mov edx, eax
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4017b0
lea edi, [esp + 0xc]
sub eax, edx
dec edi
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4017c0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x35c]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4017e1
lea edi, [esp + 0xc]
sub eax, edx
dec edi
nop
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4017f0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_FindFirstFileA]
lea eax, [esp + 0x214]
push eax
lea ecx, [esp + 0x10]
push ecx
call esi
cmp eax, 0xffffffff
pop edi
je 0x40184d
mov eax, dword [0x40b540]
lea edx, [esp + 8]
push edx
push 0x40a330
push 0x3eb
push eax
call fcn.00401000
add esp, 0x10
pop esi
xor eax, eax
pop ebp
add esp, 0x348
ret 8
lea ecx, [esp + 0x210]
push ecx
lea edx, [esp + 0x110]
push edx
call esi
cmp eax, 0xffffffff
jne 0x40188d
mov eax, dword [0x40b540]
push ebp
push str.File_not_found:__s
push 0x3eb
push eax
call fcn.00401000
add esp, 0x10
pop esi
mov eax, 1
pop ebp
add esp, 0x348
ret 8
push 0
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x114]
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x401840
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x40b540]
push eax
lea eax, [esp + 0xc]
push eax
push str.CopyFile_failed_for__s___d_
push 0x3eb
push ecx
call fcn.00401000
add esp, 0x14
pop esi
mov eax, 1
pop ebp
add esp, 0x348
ret 8
Function at 0x4018e0
Capabilities:
Persist via windows service
Set registry value

Disassembly:
sub esp, 0xc
push esi
lea eax, [esp + 4]
push eax
push 0xf003f
push 0
push str.SYSTEMCurrentControlSetServicesSentinel
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov esi, eax
test esi, esi
je 0x401931
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x40b540]
push eax
push esi
push str.RegOpenKeyEx_failed._Return_value:__d._Win32_error:__d
push 0x3eb
push ecx
call fcn.00401000
add esp, 0x14
mov eax, 1
pop esi
add esp, 0xc
ret
mov eax, dword [esp + 4]
push 0
lea edx, [esp + 0x10]
push edx
push 0
push 0xf003f
push 0
push 0x40b545
push 0
push str.setup
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
mov esi, eax
test esi, esi
je 0x401994
mov ecx, dword [esp + 4]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x40b540]
push eax
push esi
push str.RegCreateKeyEx_failed._Return_value:__d._Win32_error:__d
push 0x3eb
push edx
call fcn.00401000
add esp, 0x14
mov eax, 1
pop esi
add esp, 0xc
ret
mov ecx, dword [esp + 0xc]
push 4
lea eax, [esp + 0xc]
push eax
push 4
push 0
push str.UsbSupport
push ecx
mov dword [esp + 0x20], 1
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov esi, eax
test esi, esi
je 0x4019f2
mov edx, dword [esp + 4]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [0x40b540]
push esi
push str.RegSetValueEx_failed._Return_value:__d._Win32_error:__d
push 0x3eb
push eax
call fcn.00401000
add esp, 0x14
mov eax, 1
pop esi
add esp, 0xc
ret
mov ecx, dword [esp + 4]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor eax, eax
pop esi
add esp, 0xc
ret
Function at 0x402960
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x220
push esi
push edi
xor eax, eax
mov ecx, 0x87
lea edi, [esp + 8]
rep stosd dword es:[edi], eax
mov dword [esp + 0x18], eax
lea eax, [esp + 0x24]
mov esi, 1
push eax
push 0x1ff
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov edi, dword [ebp + 0x10]
push 0x40aeac
push edi
call fcn.004077b6
add esp, 8
test eax, eax
je 0x4029d2
push 0x40aeb0
inc edi
push edi
call fcn.004077b6
add esp, 8
test eax, eax
je 0x4029d2
mov dword [esp + 0x20], 0
jmp 0x4029e9
or eax, 0xffffffff
mov dword [esp + 0x20], esi
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], esi
lea ecx, [esp + 8]
call fcn.00402600
test eax, eax
jg 0x402a00
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [ebp + 8]
lea ecx, [esp + 8]
push ecx
push 0x4027d0
push 0
push 0x65
push edx
call dword [sym.imp.USER32.dll_DialogBoxParamA]
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x10
Function at 0x402b25
Capabilities:
Accept command line arguments
Parse pe header
Terminate process

Disassembly:
push 0x60
push 0x408160
call fcn.0040436c
mov edi, 0x94
mov eax, edi
call fcn.004043c0
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 [0x40b570], ecx
mov eax, dword [esi + 4]
mov dword [0x40b57c], eax
mov edx, dword [esi + 8]
mov dword [0x40b580], edx
mov esi, dword [esi + 0xc]
and esi, 0x7fff
mov dword [0x40b574], esi
cmp ecx, 2
je 0x402b85
or esi, 0x8000
mov dword [0x40b574], esi
shl eax, 8
add eax, edx
mov dword [0x40b578], eax
xor esi, esi
push esi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
cmp word [eax], 0x5a4d
jne 0x402bc0
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x402bc0
movzx eax, word [ecx + 0x18]
cmp eax, 0x10b
je 0x402bd8
cmp eax, 0x20b
je 0x402bc5
mov dword [ebp - 0x1c], esi
jmp 0x402bec
cmp dword [ecx + 0x84], 0xe
jbe 0x402bc0
xor eax, eax
cmp dword [ecx + 0xf8], esi
jmp 0x402be6
cmp dword [ecx + 0x74], 0xe
jbe 0x402bc0
xor eax, eax
cmp dword [ecx + 0xe8], esi
setne al
mov dword [ebp - 0x1c], eax
push esi
call fcn.0040431a
pop ecx
test eax, eax
jne 0x402c18
cmp dword [0x40b554], 1
jne 0x402c05
call fcn.00403ac3
push 0x1c
call fcn.0040394c
push 0xff
call fcn.004037b5
pop ecx
pop ecx
call fcn.00404278
mov dword [ebp - 4], esi
call fcn.004040cd
test eax, eax
jge 0x402c31
push 0x1b
call fcn.00402b00
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x40caa4], eax
call fcn.00403fab
mov dword [0x40b54c], eax
call fcn.00403f09
test eax, eax
jge 0x402c57
push 8
call fcn.00402b00
pop ecx
call fcn.00403cd6
test eax, eax
jge 0x402c68
push 9
call fcn.00402b00
pop ecx
call fcn.004037e5
mov dword [ebp - 0x20], eax
cmp eax, esi
je 0x402c7b
push eax
call fcn.00402b00
pop ecx
mov dword [ebp - 0x38], esi
lea eax, [ebp - 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
call fcn.00403c6d
mov dword [ebp - 0x68], eax
test byte [ebp - 0x38], 1
je 0x402c9c
movzx eax, word [ebp - 0x34]
jmp 0x402c9f
push 0xa
pop eax
push eax
push dword [ebp - 0x68]
push esi
push esi
call edi
push eax
call fcn.00402960
mov edi, eax
mov dword [ebp - 0x6c], edi
cmp dword [ebp - 0x1c], esi
jne 0x402cbd
push edi
call fcn.0040390c
call fcn.0040392e
jmp 0x402cef
or dword [ebp - 4], 0xffffffff
mov eax, edi
lea esp, [ebp - 0x7c]
call fcn.004043a7
ret
Function at 0x40384a
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push esi
xor esi, esi
inc esi
cmp dword [0x40b5b0], esi
push edi
jne 0x40386a
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 [0x40b5ac], esi
mov byte [0x40b5a8], al
jne 0x4038d0
mov ecx, dword [0x40ba88]
test ecx, ecx
je 0x4038b1
mov eax, dword [0x40ba84]
sub eax, 4
cmp eax, ecx
jmp 0x4038aa
mov eax, dword [eax]
test eax, eax
je 0x40389c
call eax
mov eax, dword [0x40ba84]
sub eax, 4
cmp eax, dword [0x40ba88]
mov dword [0x40ba84], eax
jae 0x403894
mov eax, 0x40a020
mov esi, 0x40a028
cmp eax, esi
mov edi, eax
jae 0x4038d0
mov eax, dword [edi]
test eax, eax
je 0x4038c9
call eax
add edi, 4
cmp edi, esi
jb 0x4038c1
mov eax, 0x40a02c
mov esi, 0x40a030
cmp eax, esi
mov edi, eax
jae 0x4038ef
mov eax, dword [edi]
test eax, eax
je 0x4038e8
call eax
add edi, 4
cmp edi, esi
jb 0x4038e0
cmp dword [ebp + 0x10], 0
pop edi
pop esi
jne 0x40390a
push dword [ebp + 8]
mov dword [0x40b5b0], 1
call fcn.004037b5
pop ecx
pop ebp
ret

Function at 0x40394c
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10c
mov eax, dword [0x40b290]
xor eax, dword [ebp + 4]
mov ecx, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 4], eax
xor edx, edx
push edi
xor eax, eax
cmp ecx, dword [eax*8 + 0x40b148]
je 0x403979
inc eax
cmp eax, 0x12
jb 0x40396a
mov esi, eax
shl esi, 3
cmp ecx, dword [esi + 0x40b148]
jne 0x403aad
mov eax, dword [0x40b554]
cmp eax, 1
je 0x403a88
cmp eax, edx
jne 0x4039a9
cmp dword [0x40aeb8], 1
je 0x403a88
cmp ecx, 0xfc
je 0x403aad
push 0x104
lea eax, [ebp - 0x10c]
push eax
push edx
mov byte [ebp - 8], dl
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x4039e2
lea eax, [ebp - 0x10c]
push str._program_name_unknown_
push eax
call fcn.00404cd0
pop ecx
pop ecx
lea eax, [ebp - 0x10c]
push eax
lea edi, [ebp - 0x10c]
call fcn.004046e0
inc eax
cmp eax, 0x3c
pop ecx
jbe 0x403a24
lea eax, [ebp - 0x10c]
push eax
call fcn.004046e0
mov edi, eax
lea eax, [ebp - 0x10c]
sub eax, 0x3b
push 3
add edi, eax
push 0x408548
push edi
call fcn.00404dd0
add esp, 0x10
push edi
call fcn.004046e0
push dword [esi + 0x40b14c]
mov ebx, eax
call fcn.004046e0
lea eax, [ebx + eax + 0x1c]
pop ecx
add eax, 3
pop ecx
and eax, 0xfffffffc
call fcn.004043c0
mov ebx, esp
push str.Runtime_Error__n_nProgram:
push ebx
call fcn.00404cd0
push edi
push ebx
call fcn.00404ce0
push 0x408528
push ebx
call fcn.00404ce0
push dword [esi + 0x40b14c]
push ebx
call fcn.00404ce0
push 0x12010
push str.Microsoft_Visual_C_Runtime_Library
push ebx
call fcn.00404bd2
add esp, 0x2c
jmp 0x403aad
push edx
lea eax, [ebp + 8]
push eax
lea esi, [esi + 0x40b14c]
push dword [esi]
call fcn.004046e0
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 - 0x118]
mov ecx, dword [ebp - 4]
xor ecx, dword [ebp + 4]
call fcn.00404886
pop edi
pop esi
pop ebx
leave
ret
Function at 0x404489
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x41c
mov eax, dword [0x40b290]
xor eax, dword [ebp + 4]
mov ecx, dword [ebp + 8]
cmp ecx, dword [0x40b968]
push ebx
push esi
mov dword [ebp - 4], eax
push edi
jae 0x404619
mov eax, ecx
sar eax, 5
lea ebx, [eax*4 + 0x40b980]
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 - 0x18], ebx
je 0x404619
xor edi, edi
cmp dword [ebp + 0x10], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x14], edi
jne 0x4044e8
xor eax, eax
jmp 0x40462d
test al, 0x20
je 0x4044f9
push 2
push edi
push edi
push ecx
call fcn.00406385
add esp, 0x10
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x4045b5
cmp dword [ebp + 0x10], edi
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
mov dword [ebp + 8], edi
jbe 0x4045ed
mov ecx, dword [ebp - 8]
sub ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x41c]
cmp ecx, dword [ebp + 0x10]
jae 0x40454f
mov edx, dword [ebp - 8]
inc dword [ebp - 8]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x404540
inc dword [ebp - 0x14]
mov byte [eax], 0xd
inc eax
inc edi
mov ebx, dword [ebp - 0x18]
mov byte [eax], dl
inc eax
inc edi
cmp edi, 0x400
jl 0x404525
mov edi, eax
lea eax, [ebp - 0x41c]
sub edi, eax
push 0
lea eax, [ebp - 0x10]
push eax
push edi
lea eax, [ebp - 0x41c]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40458f
mov eax, dword [ebp - 0x10]
add dword [ebp - 0xc], eax
cmp eax, edi
jl 0x404598
mov eax, dword [ebp - 8]
sub eax, dword [ebp + 0xc]
xor edi, edi
cmp eax, dword [ebp + 0x10]
jb 0x404519
jmp 0x40459a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 8], eax
xor edi, edi
mov eax, dword [ebp - 0xc]
cmp eax, edi
jne 0x404614
cmp dword [ebp + 8], edi
je 0x4045ed
push 5
pop eax
cmp dword [ebp + 8], eax
jne 0x4045e2
mov dword [0x40b568], eax
jmp 0x404620
push edi
lea ecx, [ebp - 0x10]
push ecx
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4045d7
mov eax, dword [ebp - 0x10]
mov dword [ebp + 8], edi
mov dword [ebp - 0xc], eax
jmp 0x40459a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 8], eax
jmp 0x40459a
push dword [ebp + 8]
call fcn.00406270
pop ecx
jmp 0x40462a
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x404602
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x1a
je 0x4044e1
mov dword [0x40b564], 0x1c
mov dword [0x40b568], edi
jmp 0x40462a
sub eax, dword [ebp - 0x14]
jmp 0x40462d
and dword [0x40b568], 0
mov dword [0x40b564], 9
or eax, 0xffffffff
mov ecx, dword [ebp - 4]
xor ecx, dword [ebp + 4]
pop edi
pop esi
pop ebx
call fcn.00404886
leave
ret