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

Disassembly:
sub esp, 0x404
mov eax, dword [0x4120e0]
mov dword [esp + 0x400], eax
lea eax, [esp]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
cmp eax, 0x400
ja 0x402a9d
test eax, eax
je 0x402a9d
mov edx, dword [esp + 0x408]
lea eax, [esp]
mov ecx, eax
sub edx, ecx
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x402a80
mov ecx, dword [esp + 0x400]
call fcn.00404e96
add esp, 0x404
ret
mov edx, dword [str.c:_temp]
mov eax, dword [esp + 0x408]
mov dword [eax], edx
mov ecx, dword [0x40f2a4]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x400]
call fcn.00404e96
add esp, 0x404
ret

Function at 0x402ad0
Capabilities:
Create thread

Disassembly:
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
push esi
mov esi, dword [esp + 8]
push 0
push 0
push eax
push ecx
push 0
push 0
mov dword [esi], 0xffffffff
call dword [sym.imp.KERNEL32.dll_CreateThread]
xor edx, edx
cmp eax, 0xffffffff
setne dl
mov dword [esi], eax
pop esi
mov eax, edx
ret

Function at 0x402d20
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40f2e0
push 0x405e6c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x13c
mov eax, dword [0x4120e0]
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
xor edi, edi
push edi
push 2
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, eax
mov dword [ebp - 0x14c], esi
cmp esi, 0xffffffff
jne 0x402d6c
xor eax, eax
jmp 0x402e0c
mov dword [ebp - 0x148], edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x144], edi
mov ecx, 0x49
xor eax, eax
lea edi, [ebp - 0x140]
rep stosd dword es:[edi], eax
mov ebx, 0x128
mov dword [ebp - 0x144], ebx
lea eax, [ebp - 0x144]
push eax
push esi
call sub.KERNEL32.dll_Process32First
test eax, eax
je 0x402dfa
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x120]
push edx
call fcn.00404cbd
add esp, 8
test eax, eax
jne 0x402dd4
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x13c]
mov dword [eax], ecx
mov dword [ebp - 0x148], 1
jmp 0x402dfa
mov ecx, 0x4a
xor eax, eax
lea edi, [ebp - 0x144]
rep stosd dword es:[edi], eax
mov dword [ebp - 0x144], ebx
lea edx, [ebp - 0x144]
push edx
push esi
call sub.KERNEL32.dll_Process32Next
test eax, eax
jne 0x402da6
mov dword [ebp - 4], 0xffffffff
call fcn.00402e2b
mov eax, dword [ebp - 0x148]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x1c]
call fcn.00404e96
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x402e40
Capabilities:
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ecx
push esi
mov esi, dword [esp + 0x18]
test esi, esi
push edi
mov dword [esp + 8], 0
jne 0x402e5c
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, eax
mov eax, dword [esp + 0x14]
movzx ecx, word [esp + 0x10]
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
test edi, edi
jne 0x402e78
pop edi
pop esi
pop ecx
ret
push ebp
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebp, eax
test ebp, ebp
jne 0x402e8c
pop ebp
pop edi
pop esi
pop ecx
ret
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov ebx, eax
test ebx, ebx
jne 0x402ea1
pop ebx
pop ebp
pop edi
pop esi
pop ecx
ret
push ebx
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
test edi, edi
je 0x402efa
mov edx, dword [esp + 0x20]
push 0
push 0x80
push 2
push 0
push 0
push 0x1f01ff
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x402efa
push 0
lea eax, [esp + 0x28]
push eax
push ebp
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_FreeResource]
pop ebx
pop ebp
mov eax, edi
pop edi
pop esi
pop ecx
ret
mov edi, dword [esp + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_FreeResource]
pop ebx
pop ebp
mov eax, edi
pop edi
pop esi
pop ecx
ret

Function at 0x402f80
Capabilities:
Acquire debug privileges
Terminate process

Disassembly:
mov eax, dword [esp + 4]
test eax, eax
jne 0x402f89
ret
lea ecx, [esp + 4]
push ecx
push eax
mov dword [esp + 0xc], 0
call fcn.00402d20
add esp, 8
test eax, eax
jne 0x402fa9
mov eax, 1
ret
mov edx, dword [esp + 4]
mov dword [esp + 4], edx
jmp fcn.00402c50

Function at 0x403120
Capabilities:
Enumerate process modules

Disassembly:
sub esp, 0x110
mov eax, dword [0x4120e0]
push esi
mov esi, ecx
mov dword [esp + 0x110], eax
mov eax, dword [esi]
cmp eax, 0xffffffff
je 0x4031b6
test eax, eax
je 0x4031b6
lea ecx, [esp + 8]
push ecx
push 4
lea edx, [esp + 0xc]
push edx
push eax
mov dword [esp + 0x18], 0
call sub.PSAPI.DLL_EnumProcessModules
test eax, eax
je 0x4031b6
mov ecx, dword [esp + 4]
mov edx, dword [esi]
push 0x104
lea eax, [esp + 0x10]
push eax
push ecx
push edx
call sub.PSAPI.DLL_GetModuleFileNameExA
lea eax, [esp + 0xc]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403180
mov ecx, dword [esp + 0x118]
sub eax, edx
push eax
lea eax, [esp + 0x10]
push eax
call fcn.00401410
mov eax, 1
pop esi
mov ecx, dword [esp + 0x10c]
call fcn.00404e96
add esp, 0x110
ret 4
mov ecx, dword [esp + 0x110]
xor eax, eax
pop esi
call fcn.00404e96
add esp, 0x110
ret 4
Function at 0x4031d0
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x808
mov eax, dword [0x4120e0]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push edi
push 0
push str._pmc
mov dword [esp + 0x814], eax
call esi
push eax
call fcn.00401000
add esp, 0xc
test al, al
je 0x40329f
xor eax, eax
mov byte [esp + 0x408], 0
mov ecx, 0xff
lea edi, [esp + 0x409]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov byte [esp + 8], 0
mov ecx, 0xff
lea edi, [esp + 9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x3ff
lea eax, [esp + 0xc]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call esi
push str._pmc
push eax
call fcn.004048c0
add eax, 4
push eax
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x418]
push str.__s__s
push edx
call fcn.00404e0d
push 0x20
lea eax, [esp + 0x424]
push 0
push eax
call fcn.00402960
add esp, 0x24
mov eax, 1
mov ecx, dword [esp + 0x80c]
call fcn.00404e96
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x80c]
xor eax, eax
call fcn.00404e96
pop edi
pop esi
mov esp, ebp
pop ebp
ret

Function at 0x403cd0
Capabilities:
Persist via run registry key

Disassembly:
push 0xffffffffffffffff
push 0x40e9db
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x408
mov eax, dword [0x4120e0]
lea ecx, [esp]
mov dword [esp + 0x404], eax
call fcn.00402b90
push str.SOFTWAREMicrosoftWindowsCurrentVersionRun
push 0x80000002
lea ecx, [esp + 8]
mov dword [esp + 0x418], 0
call fcn.00403a10
test eax, eax
je 0x403d41
lea eax, [esp + 4]
push eax
call fcn.004018f0
add esp, 4
lea ecx, [esp + 4]
push ecx
push str.RzxMon
lea ecx, [esp + 8]
call fcn.004039a0
lea ecx, [esp]
mov dword [esp + 0x410], 0xffffffff
call fcn.004039f0
mov ecx, dword [esp + 0x408]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x404]
call fcn.00404e96
add esp, 0x414
ret
Function at 0x4062f2
Capabilities:
Accept command line arguments
Parse pe header
Terminate process

Disassembly:
push 0x60
push 0x40f508
call fcn.00408194
mov edi, 0x94
mov eax, edi
call fcn.00406230
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 [0x412d10], ecx
mov eax, dword [esi + 4]
mov dword [0x412d1c], eax
mov edx, dword [esi + 8]
mov dword [0x412d20], edx
mov esi, dword [esi + 0xc]
and esi, 0x7fff
mov dword [0x412d14], esi
cmp ecx, 2
je 0x406352
or esi, 0x8000
mov dword [0x412d14], esi
shl eax, 8
add eax, edx
mov dword [0x412d18], eax
xor esi, esi
push esi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
cmp word [eax], 0x5a4d
jne 0x40638d
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x40638d
movzx eax, word [ecx + 0x18]
cmp eax, 0x10b
je 0x4063a5
cmp eax, 0x20b
je 0x406392
mov dword [ebp - 0x1c], esi
jmp 0x4063b9
cmp dword [ecx + 0x84], 0xe
jbe 0x40638d
xor eax, eax
cmp dword [ecx + 0xf8], esi
jmp 0x4063b3
cmp dword [ecx + 0x74], 0xe
jbe 0x40638d
xor eax, eax
cmp dword [ecx + 0xe8], esi
setne al
mov dword [ebp - 0x1c], eax
push 1
call fcn.0040b882
pop ecx
test eax, eax
jne 0x4063cd
push 0x1c
call fcn.004062ce
pop ecx
call fcn.004070be
test eax, eax
jne 0x4063de
push 0x10
call fcn.004062ce
pop ecx
call fcn.0040b7e0
mov dword [ebp - 4], esi
call fcn.00409cef
test eax, eax
jge 0x4063f7
push 0x1b
call fcn.004062a9
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x414580], eax
call fcn.0040b6be
mov dword [0x412cdc], eax
call fcn.0040b61c
test eax, eax
jge 0x40641d
push 8
call fcn.004062a9
pop ecx
call fcn.0040b3e9
test eax, eax
jge 0x40642e
push 9
call fcn.004062a9
pop ecx
push 1
call fcn.00408db1
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, esi
je 0x406444
push eax
call fcn.004062a9
pop ecx
mov dword [ebp - 0x44], esi
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
call fcn.0040b38c
mov dword [ebp - 0x20], eax
test byte [ebp - 0x44], 1
je 0x406465
movzx eax, word [ebp - 0x40]
jmp 0x406468
push 0xa
pop eax
push eax
push dword [ebp - 0x20]
push esi
push esi
call edi
push eax
call fcn.004016b0
mov edi, eax
mov dword [ebp - 0x2c], edi
cmp dword [ebp - 0x1c], esi
jne 0x406486
push edi
call fcn.00408ede
call fcn.00408f00
jmp 0x4064b8
or dword [ebp - 4], 0xffffffff
mov eax, edi
lea esp, [ebp - 0x7c]
call fcn.004081cf
ret
Function at 0x408e1b
Capabilities:
Terminate process

Disassembly:
push 8
push 0x40f8e0
call fcn.00408194
push 8
call fcn.0040a3f6
pop ecx
xor edi, edi
mov dword [ebp - 4], edi
xor esi, esi
inc esi
cmp dword [0x412d50], esi
jne 0x408e4f
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov dword [0x412d4c], esi
mov al, byte [ebp + 0x10]
mov byte [0x412d48], al
cmp dword [ebp + 0xc], edi
jne 0x408e99
cmp dword [0x41432c], edi
je 0x408e89
mov eax, dword [0x414328]
sub eax, 4
mov dword [0x414328], eax
cmp eax, dword [0x41432c]
jb 0x408e89
mov eax, dword [eax]
cmp eax, edi
je 0x408e6a
call eax
jmp 0x408e6a
push 0x412030
mov eax, 0x412028
call fcn.00408d99
pop ecx
push 0x41203c
mov eax, 0x412034
call fcn.00408d99
pop ecx
or dword [ebp - 4], 0xffffffff
call 0x408eca
cmp dword [ebp + 0x10], edi
jne 0x408ed8
mov dword [0x412d50], esi
push dword [ebp + 8]
call fcn.00408d57
xor edi, edi
xor esi, esi
inc esi
cmp dword [ebp + 0x10], edi
je 0x408ed7
push 8
call fcn.0040a341
pop ecx
ret
call fcn.004081cf
ret

Function at 0x4095df
Capabilities:
Get common file path

Disassembly:
push 0x120
push 0x40f910
call fcn.00408194
mov eax, dword [0x4120e0]
mov dword [ebp - 0x1c], eax
lea edi, [ebp - 0x124]
and dword [ebp - 0x128], 0
mov eax, edi
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov esi, eax
mov dword [ebp - 0x12c], esi
cmp esi, 0x104
jle 0x409683
and dword [ebp - 4], 0
lea eax, [esi + 1]
add eax, 3
and eax, 0xfffffffc
call fcn.00406230
mov dword [ebp - 0x18], esp
mov edi, esp
mov dword [ebp - 0x130], edi
jmp 0x409670
or dword [ebp - 4], 0xffffffff
test esi, esi
je 0x409683
push edi
inc esi
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov esi, eax
xor ebx, ebx
test esi, esi
je 0x40969e
cmp byte [edi + 1], 0x3a
jne 0x40969e
movzx eax, byte [edi]
push eax
call fcn.0040d34c
pop ecx
mov ebx, eax
sub ebx, 0x40
cmp dword [ebp - 0x128], 0
je 0x4096ae
push edi
call fcn.004075d2
pop ecx
mov eax, ebx
lea esp, [ebp - 0x13c]
mov ecx, dword [ebp - 0x1c]
call fcn.00404e96
call fcn.004081cf
ret
Function at 0x4097ec
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x3a0]
sub esp, 0x420
mov eax, dword [0x4120e0]
push edi
xor edi, edi
cmp dword [ebp + 0x3b0], edi
mov dword [ebp + 0x39c], eax
mov dword [ebp - 0x78], edi
mov dword [ebp - 0x7c], edi
jne 0x40981d
xor eax, eax
jmp 0x4099a6
mov eax, dword [ebp + 0x3a8]
push ebx
mov ebx, dword [ebp + 0x3a8]
and eax, 0x1f
sar ebx, 5
push esi
lea esi, [eax + eax*8]
lea ebx, [ebx*4 + 0x413200]
mov eax, dword [ebx]
shl esi, 2
test byte [eax + esi + 4], 0x20
je 0x409859
push 2
push edi
push edi
push dword [ebp + 0x3a8]
call fcn.0040d3b0
add esp, 0x10
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x409934
cmp dword [ebp + 0x3b0], edi
mov eax, dword [ebp + 0x3ac]
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x6c], edi
jbe 0x409972
mov ecx, dword [ebp - 0x74]
sub ecx, dword [ebp + 0x3ac]
lea eax, [ebp - 0x68]
mov dword [ebp - 0x70], edi
cmp ecx, dword [ebp + 0x3b0]
jae 0x4098bd
mov edx, dword [ebp - 0x74]
inc dword [ebp - 0x74]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x4098ae
inc dword [ebp - 0x7c]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x70]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x70]
cmp dword [ebp - 0x70], 0x400
jl 0x40988e
mov edi, eax
lea eax, [ebp - 0x68]
sub edi, eax
push 0
lea eax, [ebp - 0x80]
push eax
push edi
lea eax, [ebp - 0x68]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4098fd
mov eax, dword [ebp - 0x80]
add dword [ebp - 0x78], eax
cmp eax, edi
jl 0x409906
mov eax, dword [ebp - 0x74]
sub eax, dword [ebp + 0x3ac]
xor edi, edi
cmp eax, dword [ebp + 0x3b0]
jb 0x40987f
jmp 0x409908
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x6c], eax
xor edi, edi
mov eax, dword [ebp - 0x78]
cmp eax, edi
jne 0x4099a1
cmp dword [ebp - 0x6c], edi
je 0x409972
push 5
pop esi
cmp dword [ebp - 0x6c], esi
jne 0x409967
call fcn.004093a2
mov dword [eax], 9
call fcn.004093ab
mov dword [eax], esi
jmp 0x40999c
push edi
lea ecx, [ebp - 0x80]
push ecx
push dword [ebp + 0x3b0]
push dword [ebp + 0x3ac]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40995c
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x6c], edi
mov dword [ebp - 0x78], eax
jmp 0x409908
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x6c], eax
jmp 0x409908
push dword [ebp - 0x6c]
call fcn.004093b4
pop ecx
jmp 0x40999c
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x40998a
mov eax, dword [ebp + 0x3ac]
cmp byte [eax], 0x1a
jne 0x40998a
xor eax, eax
jmp 0x4099a4
call fcn.004093a2
mov dword [eax], 0x1c
call fcn.004093ab
mov dword [eax], edi
or eax, 0xffffffff
jmp 0x4099a4
sub eax, dword [ebp - 0x7c]
pop esi
pop ebx
mov ecx, dword [ebp + 0x39c]
pop edi
call fcn.00404e96
add ebp, 0x3a0
leave
ret
Function at 0x409eed
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
and dword [ebp - 8], 0
cmp dword [ebp + 0x10], 0
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edx, ebx
je 0x40a0c1
mov eax, dword [ebp + 8]
mov ecx, eax
and eax, 0x1f
sar ecx, 5
lea esi, [eax + eax*8]
lea edi, [ecx*4 + 0x413200]
mov eax, dword [edi]
shl esi, 2
add eax, esi
mov cl, byte [eax + 4]
test cl, 2
jne 0x40a0c1
test cl, 0x48
je 0x409f58
cmp byte [eax + 5], 0xa
je 0x409f58
mov eax, dword [edi]
mov al, byte [eax + esi + 5]
dec dword [ebp + 0x10]
mov byte [ebx], al
mov eax, dword [edi]
lea edx, [ebx + 1]
mov dword [ebp - 8], 1
mov byte [eax + esi + 5], 0xa
push 0
lea eax, [ebp - 0xc]
push eax
push dword [ebp + 0x10]
mov eax, dword [edi]
push edx
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x409faa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x409f92
call fcn.004093a2
mov dword [eax], 9
call fcn.004093ab
mov dword [eax], esi
jmp 0x409fa2
cmp eax, 0x6d
je 0x40a0c1
push eax
call fcn.004093b4
pop ecx
or eax, 0xffffffff
jmp 0x40a0c3
mov eax, dword [ebp - 0xc]
mov ecx, dword [edi]
add dword [ebp - 8], eax
test byte [ecx + esi + 4], 0x80
je 0x40a0bc
test eax, eax
je 0x409fd1
cmp byte [ebx], 0xa
jne 0x409fd1
mov eax, ecx
lea eax, [eax + esi + 4]
or byte [eax], 4
jmp 0x409fda
mov eax, dword [edi]
lea eax, [eax + esi + 4]
and byte [eax], 0xfb
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
add ecx, eax
cmp eax, ecx
mov dword [ebp + 0x10], eax
mov dword [ebp - 8], ecx
jae 0x40a0b6
mov eax, dword [ebp + 0x10]
mov al, byte [eax]
cmp al, 0x1a
je 0x40a0a6
cmp al, 0xd
je 0x40a00c
mov byte [ebx], al
inc ebx
inc dword [ebp + 0x10]
jmp 0x40a098
dec ecx
cmp dword [ebp + 0x10], ecx
jae 0x40a026
mov eax, dword [ebp + 0x10]
inc eax
cmp byte [eax], 0xa
jne 0x40a021
add dword [ebp + 0x10], 2
jmp 0x40a07a
mov dword [ebp + 0x10], eax
jmp 0x40a094
inc dword [ebp + 0x10]
push 0
lea eax, [ebp - 0xc]
push eax
push 1
lea eax, [ebp - 1]
push eax
mov eax, dword [edi]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a04e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40a094
cmp dword [ebp - 0xc], 0
je 0x40a094
mov eax, dword [edi]
test byte [eax + esi + 4], 0x48
je 0x40a06f
mov al, byte [ebp - 1]
cmp al, 0xa
je 0x40a07a
mov byte [ebx], 0xd
mov ecx, dword [edi]
mov byte [ecx + esi + 5], al
jmp 0x40a097
cmp ebx, dword [ebp + 0xc]
jne 0x40a07f
cmp byte [ebp - 1], 0xa
jne 0x40a07f
mov byte [ebx], 0xa
jmp 0x40a097
push 1
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0040a0c8
add esp, 0xc
cmp byte [ebp - 1], 0xa
je 0x40a098
mov byte [ebx], 0xd
inc ebx
mov ecx, dword [ebp - 8]
cmp dword [ebp + 0x10], ecx
jb 0x409ff0
jmp 0x40a0b6
mov eax, dword [edi]
test byte [eax + esi + 4], 0x40
jne 0x40a0b6
lea esi, [eax + esi + 4]
or byte [esi], 2
sub ebx, dword [ebp + 0xc]
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 8]
jmp 0x40a0c3
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x40ab08
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 0x40ab36
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 0x40ab3d
cmp ebx, dword [eax + 4]
jae 0x40ab3d
xor eax, eax
jmp 0x40ad2d
push edi
mov edi, dword [esi + 0xc]
cmp edi, 0xffffffff
jne 0x40ab4e
xor eax, eax
inc eax
jmp 0x40ad2c
xor edx, edx
mov dword [ebp + 8], edx
mov eax, ebx
mov ecx, dword [eax]
cmp ecx, 0xffffffff
je 0x40ab64
cmp ecx, edx
jae 0x40aca9
cmp dword [eax + 4], 0
je 0x40ab6d
inc dword [ebp + 8]
inc edx
add eax, 0xc
cmp edx, edi
jbe 0x40ab55
cmp dword [ebp + 8], 0
je 0x40ab8f
mov eax, dword [esi - 8]
cmp eax, dword [ebp - 4]
jb 0x40aca9
cmp eax, esi
jae 0x40aca9
mov eax, dword [0x412f90]
mov edi, ebx
and edi, 0xfffff000
xor esi, esi
test eax, eax
jle 0x40abb4
cmp dword [esi*4 + 0x412f98], edi
je 0x40acad
inc esi
cmp esi, eax
jl 0x40aba2
push 0x1c
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x40ad29
cmp dword [ebp - 8], 0x1000000
jne 0x40ad29
test byte [ebp - 0xc], 0xcc
je 0x40ac32
mov ecx, dword [ebp - 0x1c]
cmp word [ecx], 0x5a4d
jne 0x40ad29
mov eax, dword [ecx + 0x3c]
add eax, ecx
cmp dword [eax], 0x4550
jne 0x40ad29
cmp word [eax + 0x18], 0x10b
jne 0x40ad29
sub ebx, ecx
cmp word [eax + 6], 0
movzx ecx, word [eax + 0x14]
lea ecx, [ecx + eax + 0x18]
jbe 0x40ad29
mov eax, dword [ecx + 0xc]
cmp ebx, eax
jb 0x40ac32
mov edx, dword [ecx + 8]
add edx, eax
cmp ebx, edx
jae 0x40ac32
test byte [ecx + 0x27], 0x80
jne 0x40aca9
push 1
push 0x412fd8
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
jne 0x40ab46
mov ecx, dword [0x412f90]
test ecx, ecx
mov edx, ecx
jle 0x40ac66
lea eax, [ecx*4 + 0x412f94]
cmp dword [eax], edi
je 0x40ac66
dec edx
sub eax, 4
test edx, edx
jg 0x40ac5a
test edx, edx
jne 0x40ac97
push 0xf
pop ebx
cmp ecx, ebx
jg 0x40ac73
mov ebx, ecx
xor edx, edx
test ebx, ebx
jl 0x40ac8b
lea eax, [edx*4 + 0x412f98]
mov esi, dword [eax]
inc edx
cmp edx, ebx
mov dword [eax], edi
mov edi, esi
jle 0x40ac79
cmp ecx, 0x10
jge 0x40ac97
inc ecx
mov dword [0x412f90], ecx
push 0
push 0x412fd8
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
jmp 0x40ab46
xor eax, eax
jmp 0x40ad2c
test esi, esi
jle 0x40ab46
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push 1
push 0x412fd8
call ebx
test eax, eax
jne 0x40ab46
cmp dword [esi*4 + 0x412f98], edi
je 0x40ad03
mov eax, dword [0x412f90]
lea esi, [eax - 1]
test esi, esi
jl 0x40acf1
cmp dword [esi*4 + 0x412f98], edi
je 0x40aced
dec esi
jns 0x40ace1
test esi, esi
jge 0x40ad01
cmp eax, 0x10
jge 0x40acfc
inc eax
mov dword [0x412f90], eax
lea esi, [eax - 1]
jmp 0x40ad03
je 0x40ad1b
xor ecx, ecx
test esi, esi
jl 0x40ad1b
lea eax, [ecx*4 + 0x412f98]
mov edx, dword [eax]
inc ecx
cmp ecx, esi
mov dword [eax], edi
mov edi, edx
jle 0x40ad09
push 0
push 0x412fd8
call ebx
jmp 0x40ab46
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret
Function at 0x40b078
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x8c]
sub esp, 0x10c
mov eax, dword [0x4120e0]
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 + 0x412a30]
je 0x40b0ad
inc eax
cmp eax, 0x13
jb 0x40b09e
mov esi, eax
shl esi, 3
cmp ecx, dword [esi + 0x412a30]
jne 0x40b1d3
mov eax, dword [0x412ce4]
cmp eax, 1
je 0x40b1ab
cmp eax, edx
jne 0x40b0dd
cmp dword [0x412124], 1
je 0x40b1ab
cmp ecx, 0xfc
je 0x40b1d3
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 0x40b113
lea eax, [ebp - 0x80]
push str._program_name_unknown_
push eax
call fcn.0040af80
pop ecx
pop ecx
lea edi, [ebp - 0x80]
mov eax, edi
push eax
call fcn.004065a0
inc eax
cmp eax, 0x3c
pop ecx
jbe 0x40b147
mov eax, edi
push eax
call fcn.004065a0
mov edi, eax
lea eax, [ebp - 0x80]
sub eax, 0x3b
push 3
add edi, eax
push 0x40f684
push edi
call fcn.00405d40
add esp, 0x10
push edi
call fcn.004065a0
push dword [esi + 0x412a34]
mov ebx, eax
call fcn.004065a0
lea eax, [ebx + eax + 0x1c]
pop ecx
add eax, 3
pop ecx
and eax, 0xfffffffc
call fcn.00406230
mov ebx, esp
push str.Runtime_Error__n_nProgram:
push ebx
call fcn.0040af80
push edi
push ebx
call fcn.0040af90
push 0x40f680
push ebx
call fcn.0040af90
push dword [esi + 0x412a34]
push ebx
call fcn.0040af90
push 0x12010
push str.Microsoft_Visual_C_Runtime_Library
push ebx
call fcn.0040cba5
add esp, 0x2c
jmp 0x40b1d3
push edx
lea eax, [ebp + 0x94]
push eax
lea esi, [esi + 0x412a34]
push dword [esi]
call fcn.004065a0
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.00404e96
pop edi
pop esi
pop ebx
add ebp, 0x8c
leave
ret