joyce8/EMBER2024-capa huggingface dataset:
Function at 0x403309
Capabilities:
Check for time delay via gettickcount
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
push ebx
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 8], esi
test edi, edi
jne 0x403326
mov dword [ebp - 8], 0x8000
and dword [ebp - 4], 0
mov ebx, edi
test edi, edi
jne 0x403335
mov ebx, 0x410960
mov eax, dword [ebp + 8]
test eax, eax
jl 0x40334a
mov ecx, dword [0x426418]
add ecx, eax
push ecx
call fcn.0040352e
lea eax, [ebp + 0x14]
push 4
push eax
call fcn.004034fc
test eax, eax
je 0x4034a7
test byte [ebp + 0x17], 0x80
je 0x403490
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, 0x40c8d0
mov dword [ebp - 0xc], eax
call fcn.0040675e
and dword [ebp + 0x14], 0x7fffffff
mov eax, dword [ebp + 0x14]
mov dword [ebp + 8], eax
jle 0x4034f2
mov esi, 0x4000
cmp dword [ebp + 0x14], esi
jge 0x40339a
mov esi, dword [ebp + 0x14]
mov edi, 0x40c960
push esi
push edi
call fcn.004034fc
test eax, eax
je 0x4034a7
sub dword [ebp + 0x14], esi
mov dword [0x40c8e8], edi
mov dword [0x40c8ec], esi
mov eax, dword [ebp - 8]
mov ecx, 0x40c8d0
mov dword [0x40c8f0], ebx
mov dword [0x40c8f4], eax
call fcn.0040677e
test eax, eax
mov dword [ebp - 0x14], eax
jl 0x403488
mov esi, dword [0x40c8f0]
sub esi, ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
test byte [0x426474], 1
mov edi, eax
je 0x40343c
sub eax, dword [ebp - 0xc]
cmp eax, 0xc8
ja 0x403409
cmp dword [ebp + 0x14], 0
jne 0x40343c
mov eax, dword [ebp + 8]
push dword [ebp + 8]
sub eax, dword [ebp + 0x14]
push 0x64
push eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
push eax
lea eax, [ebp - 0x54]
push str....__d__
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x54]
push eax
push 0
call fcn.004053a2
mov dword [ebp - 0xc], edi
xor eax, eax
cmp esi, eax
je 0x40347d
cmp dword [ebp + 0x10], eax
jne 0x403465
push eax
lea eax, [ebp - 0x10]
push eax
push esi
push ebx
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40348c
cmp dword [ebp - 0x10], esi
jne 0x40348c
add dword [ebp - 4], esi
jmp 0x403471
add dword [ebp - 4], esi
sub dword [ebp - 8], esi
mov ebx, dword [0x40c8f0]
cmp dword [ebp - 0x14], 1
jne 0x4033bd
jmp 0x4034f2
cmp dword [ebp + 0x14], eax
jg 0x40338d
jmp 0x4034f2
push 0xfffffffffffffffc
jmp 0x4034a9
push 0xfffffffffffffffe
jmp 0x4034a9
test edi, edi
je 0x4034e7
cmp dword [ebp + 0x14], esi
jge 0x40349c
mov esi, dword [ebp + 0x14]
push esi
push edi
call fcn.004034fc
test eax, eax
jne 0x4034ef
push 0xfffffffffffffffd
pop eax
jmp 0x4034f5
mov esi, dword [ebp - 8]
cmp dword [ebp + 0x14], esi
jge 0x4034b7
mov esi, dword [ebp + 0x14]
mov edi, 0x40c960
push esi
push edi
call fcn.004034fc
test eax, eax
je 0x4034a7
lea eax, [ebp + 0x10]
push 0
push eax
push esi
push edi
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40348c
cmp esi, dword [ebp + 0x10]
jne 0x40348c
add dword [ebp - 4], esi
sub dword [ebp + 0x14], esi
cmp dword [ebp + 0x14], 0
jg 0x4034ac
jmp 0x4034f2
mov dword [ebp - 4], esi
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 0x10
Function at 0x405899
Capabilities:
Create directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, 0x408364
and byte [ebp - 0x1f], 0
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x20]
and dword [ebp - 0x14], 0
and dword [ebp - 4], 0
mov dword [ebp - 8], eax
lea eax, [ebp - 0xc]
push esi
push eax
mov byte [ebp - 0x20], 1
push dword [ebp + 8]
mov word [ebp - 0x1e], 4
mov dword [ebp - 0x10], 0x408354
mov dword [ebp - 0xc], 0xc
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x4058ea
xor eax, eax
jmp 0x405911
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0xb7
jne 0x405911
lea eax, [ebp - 0x20]
push eax
push 0x80000007
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
test eax, eax
jne 0x4058e6
call esi
pop esi
leave
ret 4

Function at 0x40594b
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
lea eax, [ebp - 0x10]
mov dword [0x423db8], 0x44
push eax
xor eax, eax
push 0x423db8
push eax
push eax
push eax
push eax
push eax
push eax
push dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x405986
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x10]
leave
ret 4
Function at 0x405d18
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push esi
push edi
push dword [esp + 0xc]
mov esi, 0x4231b8
push esi
call fcn.00406144
push esi
call fcn.00405ccb
mov edi, eax
test edi, edi
jne 0x405d39
xor eax, eax
jmp 0x405d8b
push edi
call fcn.004063a6
test byte [0x4263d8], 0x80
je 0x405d52
mov al, byte [edi]
test al, al
je 0x405d35
cmp al, 0x5c
je 0x405d35
sub edi, esi
jmp 0x405d6a
call fcn.004065ec
test eax, eax
je 0x405d64
test byte [eax], 0x10
je 0x405d35
push esi
call fcn.00405c7e
push esi
call sub.KERNEL32.dll_lstrlenA
cmp eax, edi
push esi
jg 0x405d56
call fcn.00405c37
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov eax, ecx
pop edi
pop esi
ret 4

Function at 0x405dfc
Capabilities:
Check if file exists
Get file attributes
Set file attributes

Disassembly:
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405e18
and al, 0xfe
push eax
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
ret 4

Function at 0x405e1b
Capabilities:
Get file attributes

Disassembly:
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ecx, eax
push 0
inc ecx
neg ecx
sbb ecx, ecx
and ecx, eax
push ecx
push dword [esp + 0x14]
push 0
push 1
push dword [esp + 0x1c]
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
ret 0xc

Function at 0x405e4a
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 8]
push edi
push 0x64
pop edi
dec edi
mov dword [ebp + 8], 0x61736e
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x1a
xor edx, edx
pop ecx
div ecx
push esi
lea eax, [ebp + 8]
push 0
push eax
push dword [ebp + 0xc]
add byte [ebp + 0xa], dl
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
jne 0x405e8e
test edi, edi
jne 0x405e55
and byte [esi], 0
pop edi
pop esi
pop ebp
ret 8
mov eax, esi
jmp 0x405e88
Function at 0x405e92
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebx
push ebp
push esi
push edi
push 2
call fcn.00406681
test eax, eax
mov esi, dword [esp + 0x18]
je 0x405eb6
push 5
push esi
push dword [esp + 0x1c]
call eax
test eax, eax
jne 0x405fef
mov ebx, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
mov dword [0x423f40], 0x4c554e
test esi, esi
mov edi, 0x400
mov ebp, 0x423f40
je 0x405efa
push 1
push 0
push esi
call fcn.00405e1b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
push ebp
push esi
call ebx
test eax, eax
je 0x405ff5
cmp eax, edi
jg 0x405ff5
mov esi, 0x4239b8
push edi
push esi
push dword [esp + 0x1c]
call ebx
test eax, eax
je 0x405ff5
cmp eax, edi
jg 0x405ff5
push esi
push ebp
push str._s_s_r_n
push 0x4235b8
call dword [sym.imp.USER32.dll_wsprintfA]
mov ebx, eax
mov eax, dword [0x4263d0]
add esp, 0x10
push dword [eax + 0x128]
push esi
call fcn.00406166
push 4
push 0xc0000000
push esi
call fcn.00405e1b
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x14], ebp
je 0x405fef
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
lea eax, [edi + ebx + 0xa]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
je 0x405fe8
lea eax, [esp + 0x18]
push 0
push eax
push edi
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x405fe8
cmp edi, dword [esp + 0x18]
jne 0x405fe8
push str._Rename__r_n
push esi
call fcn.00405d90
test eax, eax
jne 0x405ffc
lea eax, [esi + edi]
push str._Rename__r_n
push eax
call fcn.00406144
add edi, 0xa
mov eax, edi
push ebx
add eax, esi
push 0x4235b8
push eax
call fcn.00405ddc
xor eax, eax
push eax
push eax
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x18]
push 0
add edi, ebx
push eax
push edi
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [0x426450]
pop edi
pop esi
pop ebp
pop ebx
ret 8
add eax, 0xa
push 0x40abb4
push eax
call fcn.00405d90
test eax, eax
je 0x405fb3
inc eax
lea ecx, [esi + edi]
cmp eax, ecx
mov ebp, eax
jae 0x406023
mov dl, byte [ebp]
mov byte [ebx + ebp], dl
inc ebp
cmp ebp, ecx
jb 0x406018
mov ebp, dword [esp + 0x14]
sub eax, esi
jmp 0x405fb5
Function at 0x40602b
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push ebx
lea eax, [ebp + 0x18]
push esi
push eax
mov eax, dword [ebp + 0x18]
xor ebx, ebx
neg eax
sbb eax, eax
mov esi, dword [ebp + 0x14]
and eax, 0x100
or eax, 0x20019
mov byte [esi], bl
push eax
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40609c
lea eax, [ebp + 0xc]
mov dword [ebp + 0xc], 0x400
push eax
lea eax, [ebp + 0x14]
push esi
push eax
push ebx
push dword [ebp + 0x10]
push dword [ebp + 0x18]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40608b
cmp dword [ebp + 0x14], 1
je 0x40608d
cmp dword [ebp + 0x14], 2
je 0x40608d
mov byte [esi], bl
push dword [ebp + 0x18]
mov byte [esi + 0x3ff], bl
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop esi
pop ebx
pop ebp
ret 0x14
Function at 0x40643f
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
je 0x406464
mov eax, dword [0x40a8d8]
cmp eax, 0xffffffff
je 0x40645b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [0x40a8d8], 0xffffffff
jmp 0x4064d7
cmp dword [0x424b40], ebx
je 0x4064d7
cmp byte [0x424740], bl
je 0x4064a3
cmp dword [0x40a8d8], 0xffffffff
jne 0x4064ac
push 4
push 0x40000000
push 0x424740
call fcn.00405e1b
cmp eax, 0xffffffff
mov dword [0x40a8d8], eax
je 0x4064d7
push 2
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [0x40a8d8], 0xffffffff
je 0x4064d7
push esi
mov esi, 0x425360
push 0x40abcc
push esi
call sub.KERNEL32.dll_lstrcatA
lea eax, [ebp + 8]
push ebx
push eax
push esi
call sub.KERNEL32.dll_lstrlenA
push eax
push esi
push dword [0x40a8d8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop esi
pop ebx
pop ebp
ret 4

Function at 0x406613
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
push esi
mov esi, 0x104
lea eax, [ebp - 0x120]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
cmp eax, esi
pop esi
jbe 0x406637
xor eax, eax
test eax, eax
je 0x406649
cmp byte [ebp + eax - 0x121], 0x5c
je 0x406649
xor ecx, ecx
jmp 0x40664c
xor ecx, ecx
inc ecx
push dword [ebp + 8]
lea ecx, [ecx + 0x40a28c]
lea eax, [ebp + eax - 0x120]
push ecx
push str._s_s.dll
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x120]
push 8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
leave
ret 4

Function at 0x4066f0
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
cmp dword [0x424344], 0
push esi
jne 0x406727
xor ecx, ecx
push 8
mov eax, ecx
pop esi
mov edx, eax
and dl, 1
neg dl
sbb edx, edx
and edx, 0xedb88320
shr eax, 1
xor eax, edx
dec esi
jne 0x406701
mov dword [ecx*4 + 0x424340], eax
inc ecx
cmp ecx, 0x100
jl 0x4066fc
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 8]
test edx, edx
not eax
jbe 0x406758
mov ecx, dword [esp + 0xc]
push edi
movzx edi, byte [ecx]
mov esi, eax
and esi, 0xff
xor esi, edi
shr eax, 8
mov esi, dword [esi*4 + 0x424340]
xor eax, esi
inc ecx
dec edx
jne 0x40673a
pop edi
not eax
pop esi
ret 0xc
Function at 0x40b0d0
Capabilities:
Terminate process

Disassembly:
mov eax, dword [0x4172ec]
push ebx
push ebp
mov ebp, dword [esp + 0xc]
cmp eax, 1
push esi
jne 0x40b0ef
push ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
test eax, eax
mov dword [0x4172e8], 1
mov byte [0x4172e4], bl
jne 0x40b149
mov ecx, dword [0x418808]
test ecx, ecx
je 0x40b137
mov esi, dword [0x418804]
sub esi, 4
cmp esi, ecx
jb 0x40b137
mov eax, dword [esi]
test eax, eax
je 0x40b130
call eax
mov ecx, dword [0x418808]
sub esi, 4
cmp esi, ecx
jae 0x40b122
push 0x41201c
push 0x412014
call fcn.0040b180
add esp, 8
push 0x412024
push 0x412020
call fcn.0040b180
add esp, 8
test ebx, ebx
jne 0x40b170
push ebp
mov dword [0x4172ec], 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop esi
pop ebp
pop ebx
ret

Function at 0x40c3d0
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x411888
push 0x40f248
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
add esp, 0xfffffff0
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
call dword [sym.imp.KERNEL32.dll_GetVersion]
xor edx, edx
mov dl, ah
mov dword [0x4172bc], edx
mov ecx, eax
and ecx, 0xff
mov dword [0x4172b8], ecx
shl ecx, 8
add ecx, edx
mov dword [0x4172b4], ecx
shr eax, 0x10
mov dword [0x4172b0], eax
call fcn.0040cfe0
test eax, eax
jne 0x40c43a
push 0x1c
call fcn.0040c4f0
add esp, 4
mov dword [ebp - 4], 0
call fcn.0040d910
call fcn.0040f140
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x4177e8], eax
call fcn.0040ed10
mov dword [0x417308], eax
test eax, eax
je 0x40c46d
mov eax, dword [0x4177e8]
test eax, eax
jne 0x40c477
push 0xffffffffffffffff
call fcn.0040b090
add esp, 4
call fcn.0040ea60
call fcn.0040e970
call fcn.0040b060
mov eax, dword [0x4172cc]
mov dword [0x4172d0], eax
push eax
mov eax, dword [0x4172c4]
push eax
mov ecx, dword [0x4172c0]
push ecx
call fcn.00405740
add esp, 0xc
mov dword [ebp - 0x1c], eax
push eax
call fcn.0040b090
jmp 0x40c4d2
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x40dda0
Capabilities:
Write file on windows

Disassembly:
mov eax, dword [esp + 4]
mov ecx, dword [0x4177e0]
sub esp, 0x41c
cmp eax, ecx
push ebx
push ebp
push esi
push edi
jae 0x40df4d
mov ecx, eax
mov esi, eax
sar ecx, 5
and esi, 0x1f
mov edx, dword [ecx*4 + 0x4176e0]
lea edi, [ecx*4 + 0x4176e0]
shl esi, 3
mov dword [esp + 0x24], edi
mov dword [esp + 0x14], esi
mov cl, byte [esi + edx + 4]
test cl, 1
je 0x40df4d
mov ebx, dword [esp + 0x438]
xor ebp, ebp
cmp ebx, ebp
mov dword [esp + 0x10], ebp
mov dword [esp + 0x20], ebp
jne 0x40de0e
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
test cl, 0x20
je 0x40de1f
push 2
push ebp
push eax
call fcn.0040dce0
add esp, 0xc
mov eax, dword [edi]
add eax, esi
test byte [eax + 4], 0x80
je 0x40df7e
mov ebp, dword [esp + 0x434]
mov dword [esp + 0x18], 0
test ebx, ebx
mov edi, ebp
jbe 0x40dec9
lea eax, [esp + 0x28]
mov ecx, edi
sub ecx, ebp
cmp ecx, ebx
jae 0x40de7a
mov cl, byte [edi]
inc edi
cmp cl, 0xa
jne 0x40de67
mov esi, dword [esp + 0x20]
mov byte [eax], 0xd
inc esi
inc eax
mov dword [esp + 0x20], esi
mov byte [eax], cl
inc eax
mov edx, eax
lea ecx, [esp + 0x28]
sub edx, ecx
cmp edx, 0x400
jl 0x40de4a
mov esi, eax
lea edx, [esp + 0x28]
lea eax, [esp + 0x1c]
sub esi, edx
mov edx, dword [esp + 0x24]
push 0
push eax
lea ecx, [esp + 0x30]
mov eax, dword [edx]
push esi
push ecx
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + eax]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40df6f
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
add edx, eax
cmp eax, esi
mov dword [esp + 0x10], edx
jl 0x40dec5
mov eax, edi
sub eax, ebp
cmp eax, ebx
jb 0x40de46
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40df3e
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40df12
cmp eax, 5
jne 0x40defb
mov dword [0x4172a8], eax
mov dword [0x4172a4], 9
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
push eax
call fcn.0040fcb0
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx]
test byte [esi + edx + 4], 0x40
je 0x40df32
cmp byte [ebp], 0x1a
jne 0x40df32
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov dword [0x4172a4], 0x1c
jmp 0x40df57
sub eax, dword [esp + 0x20]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov dword [0x4172a4], 9
pop edi
pop esi
pop ebp
mov dword [0x4172a8], 0
or eax, 0xffffffff
pop ebx
add esp, 0x41c
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
jmp 0x40dec5
mov edx, dword [eax]
lea ecx, [esp + 0x1c]
push ebp
mov ebp, dword [esp + 0x438]
push ecx
push ebx
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40dfaf
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], eax
jmp 0x40dec9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
jmp 0x40dec9
Function at 0x40ed10
Capabilities:
Query environment variable

Disassembly:
mov eax, dword [0x417440]
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
push esi
xor esi, esi
xor ebx, ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
test eax, eax
jne 0x40ed52
call edi
mov esi, eax
test esi, esi
je 0x40ed3c
mov eax, 1
jmp 0x40ed4d
call ebp
mov ebx, eax
test ebx, ebx
je 0x40ee5f
mov eax, 2
mov dword [0x417440], eax
cmp eax, 1
jne 0x40edf2
test esi, esi
jne 0x40ed6b
call edi
mov esi, eax
test esi, esi
je 0x40ee5f
cmp word [esi], 0
mov eax, esi
je 0x40ed85
add eax, 2
cmp word [eax], 0
jne 0x40ed73
add eax, 2
cmp word [eax], 0
jne 0x40ed73
sub eax, esi
push 0
sar eax, 1
inc eax
push 0
mov ebp, eax
push 0
push 0
push ebp
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
test edi, edi
je 0x40ede4
push edi
call fcn.0040b7e0
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40ede4
push 0
push 0
push edi
push ebx
push ebp
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x40edd6
push ebx
call fcn.0040b210
add esp, 4
xor ebx, ebx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
ret
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret
cmp eax, 2
jne 0x40ee5f
test ebx, ebx
jne 0x40ee03
call ebp
mov ebx, eax
test ebx, ebx
je 0x40ee5f
mov cl, byte [ebx]
mov eax, ebx
test cl, cl
je 0x40ee1b
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40ee0b
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40ee0b
sub eax, ebx
inc eax
mov esi, eax
push esi
call fcn.0040b7e0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40ee3d
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret
mov ecx, esi
mov esi, ebx
mov eax, ecx
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
Function at 0x40f360
Capabilities:
Write file on windows

Disassembly:
mov ecx, dword [esp + 4]
sub esp, 0x1a8
mov eax, 0x417030
push ebx
push ebp
push esi
push edi
xor ebp, ebp
cmp ecx, dword [eax]
je 0x40f384
add eax, 8
inc ebp
cmp eax, 0x4170c0
jb 0x40f375
cmp ecx, dword [ebp*8 + 0x417030]
jne 0x40f52b
mov eax, dword [0x417310]
cmp eax, 1
je 0x40f4ed
test eax, eax
jne 0x40f3b0
cmp dword [0x414e5c], 1
je 0x40f4ed
cmp ecx, 0xfc
je 0x40f52b
lea eax, [esp + 0xb4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40f3eb
mov ecx, 5
mov esi, str._program_name_unknown_
lea edi, [esp + 0xb4]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
lea edi, [esp + 0xb4]
or ecx, 0xffffffff
xor eax, eax
lea ebx, [esp + 0xb4]
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x3c
jbe 0x40f434
lea edi, [esp + 0xb4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 3
mov ebx, ecx
lea ecx, [esp + 0xb8]
sub ecx, 0x3b
push 0x411be8
add ebx, ecx
push ebx
call fcn.00410710
add esp, 0xc
mov ecx, 6
mov esi, str.Runtime_Error__n_nProgram:
lea edi, [esp + 0x14]
xor eax, eax
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
or ecx, 0xffffffff
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x14]
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x14]
and ecx, 3
push 0x12010
rep movsb byte es:[edi], byte [esi]
mov edi, 0x411bc8
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push str.Microsoft_Visual_C_Runtime_Library
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp*8 + 0x417034]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.00410680
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1a8
ret
mov eax, dword [0x4176e0]
test eax, eax
je 0x40f4fe
mov esi, dword [eax + 0x10]
cmp esi, 0xffffffff
jne 0x40f508
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebp*8 + 0x417034]
lea ecx, [esp + 0x10]
push 0
push ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1a8
ret