joyce8/EMBER2024-capa huggingface dataset:
Function at 0x430110
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x24
mov esi, ecx
lea ecx, [esp + 0xc]
push dword [esp + 0x38]
call fcn.0041fad0
add esp, 4
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
test edx, edx
je 0x430175
mov dword [esp + 0x18], edx
mov dword [esp + 0x20], ecx
mov ecx, esp
lea edx, [esp + 0x18]
mov dword [esp + 0x1c], eax
call fcn.00430050
mov edi, dword [esp]
test edi, edi
je 0x430184
mov ebx, dword [esp + 4]
mov ebp, dword [esp + 8]
push edi
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x430199
mov dword [esi], edi
mov dword [esi + 4], ebx
mov dword [esi + 8], ebp
jmp 0x430191
mov dword [esp + 4], eax
mov dword [esp + 8], ecx
mov dword [esp], 0
mov ecx, esp
call fcn.0041fc80
mov dword [esi], 0
add esp, 0x24
pop esi
pop edi
pop ebx
pop ebp
ret
test ebx, ebx
mov dword [esi], 0
je 0x430191
mov ecx, edi
mov edx, 2
call fcn.0040c730
jmp 0x430191
Function at 0x4323a0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
mov eax, 0x1038
call fcn.004380b0
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x437d10
mov edi, ecx
lea eax, [ebp - 0x18]
mov dword [ebp - 0x24], edx
lea esi, [ebp - 0x1044]
mov ecx, dword fs:[0]
mov dword [ebp - 0x18], ecx
mov dword fs:[0], eax
push 0x1000
push 0
push esi
call fcn.00439780
add esp, 0xc
xorps xmm0, xmm0
lea eax, [ebp - 0x30]
mov dword [ebp - 0x30], 0
movups xmmword [ebp - 0x44], xmm0
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x44]
push 0x429f30
push eax
push 0x1000
push esi
push edi
call dword [sym.imp.kernel32.dll_ReadFileEx]
test eax, eax
je 0x4324f4
mov ebx, dword [sym.imp.kernel32.dll_SleepEx]
mov dword [ebp - 0x20], edi
push 1
push 0xffffffffffffffff
call ebx
cmp dword [ebp - 0x30], 0
je 0x43242a
cmp dword [ebp - 0x2c], 0
jne 0x432505
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x432505
cmp esi, 0x1000
ja 0x432541
xor edi, edi
nop dword [eax]
mov eax, esi
sub eax, edi
jb 0x432527
xorps xmm0, xmm0
lea edx, [ebp - 0x30]
lea ecx, [ebp + edi - 0x1044]
mov dword [ebp - 0x30], 0
movups xmmword [ebp - 0x44], xmm0
mov dword [ebp - 0x34], edx
push 0x429f30
lea edx, [ebp - 0x44]
push edx
push eax
push ecx
push dword [ebp - 0x24]
call dword [sym.imp.kernel32.dll_WriteFileEx]
test eax, eax
je 0x4324fc
nop dword [eax]
push 1
push 0xffffffffffffffff
call ebx
cmp dword [ebp - 0x30], 0
je 0x4324a0
cmp dword [ebp - 0x2c], 0
jne 0x432502
add edi, dword [ebp - 0x28]
cmp edi, esi
jne 0x432460
xorps xmm0, xmm0
lea eax, [ebp - 0x30]
mov dword [ebp - 0x30], 0
movups xmmword [ebp - 0x44], xmm0
mov dword [ebp - 0x34], eax
push 0x429f30
lea eax, [ebp - 0x44]
push eax
push 0x1000
lea eax, [ebp - 0x1044]
push eax
mov edi, dword [ebp - 0x20]
push edi
call dword [sym.imp.kernel32.dll_ReadFileEx]
test eax, eax
jne 0x43242a
call dword [sym.imp.kernel32.dll_GetLastError]
jmp 0x432505
call dword [sym.imp.kernel32.dll_GetLastError]
mov edi, dword [ebp - 0x20]
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
push edi
call esi
push dword [ebp - 0x24]
call esi
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x1038
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x10], 0
mov ecx, edi
mov edx, esi
push 0x4542a8
call fcn.00446f70
add esp, 4
jmp 0x43255c
mov dword [ebp - 0x10], 0
mov ecx, esi
mov edx, 0x1000
push 0x4542a8
call fcn.00446d60
add esp, 4
ud2
Function at 0x432630
Capabilities:
Generate random numbers via rtlgenrandom

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x50
mov esi, esp
mov dword [esi + 0x38], ebp
mov dword [esi + 0x3c], esp
mov dword [esi + 0x48], 0xffffffff
mov dword [esi + 0x44], 0x437d30
lea eax, [esi + 0x40]
xorps xmm0, xmm0
mov ecx, dword fs:[0]
mov dword [esi + 0x40], ecx
mov dword fs:[0], eax
movaps xmmword [esi + 0x10], xmm0
lea eax, [esi + 0x10]
push 0x10
push eax
call dword [sym.imp.advapi32.dll_SystemFunction036]
test al, al
je 0x432694
mov ecx, dword [esi + 0x40]
mov eax, dword [esi + 0x10]
mov edx, dword [esi + 0x14]
mov dword fs:[0], ecx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
call dword [sym.imp.kernel32.dll_GetLastError]
mov edx, esi
lea ecx, [esi + 8]
mov dword [esi + 0x20], 0x4543b8
mov dword [esi + 0x24], 1
mov dword [esi + 0x30], 0
mov byte [esi], 0
mov dword [esi + 4], eax
mov dword [esi + 0x48], 0
mov dword [esi + 8], edx
mov dword [esi + 0x28], ecx
lea ecx, [esi + 0x20]
mov edx, 0x4543e4
mov dword [esi + 0xc], fcn.00425810
mov dword [esi + 0x2c], 1
call fcn.00446c50
ud2
Function at 0x436860
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x34
mov ebp, dword [esp + 0x48]
mov ebx, edx
mov edx, dword [ebp + 4]
mov edi, dword [ebp + 8]
mov eax, edx
sub eax, edi
jb 0x436912
mov esi, ecx
mov ecx, dword [ebp]
mov dword [esp + 8], 0
mov dword [esp + 4], 0x103
lea edx, [esp + 4]
add ecx, edi
push 0
push 0
push eax
push ecx
push edx
push 0
push 0
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtReadFile]
cmp eax, 0x103
jne 0x4368c0
push 0xffffffffffffffff
push ebx
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [esp + 4]
xor ecx, ecx
cmp eax, 0xc0000011
je 0x4368d8
cmp eax, 0x103
je 0x436923
test eax, eax
js 0x4368f3
mov ecx, dword [esp + 8]
add ecx, edi
mov dword [ebp + 8], ecx
mov eax, dword [ebp + 0xc]
cmp eax, ecx
cmova ecx, eax
mov dword [ebp + 0xc], ecx
mov byte [esi], 4
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov ecx, eax
mov edi, eax
call fcn.004203b0
cmp al, 0xb
je 0x4368e8
mov dword [esi], 0
mov dword [esi + 4], edi
jmp 0x4368eb
mov ecx, edi
push 0x4521a4
call fcn.00446c80
add esp, 4
ud2
mov eax, esp
mov dword [esp + 0x1c], 0x454070
mov dword [esp + 0x20], 1
mov dword [esp + 0x2c], 0
mov dword [esp + 0xc], 0
mov byte [esp + 0x10], 0
lea ecx, [esp + 0xc]
lea edx, [esp + 0x14]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x28], 0
push eax
push ecx
push edx
call fcn.0041d710
add esp, 0xc
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
call fcn.0041d840
mov ecx, 7
int 0x29
ud2

Function at 0x436990
Capabilities:
Delete file

Disassembly:
push ebx
push edi
push esi
sub esp, 0x18
mov esi, ecx
mov ecx, esp
push dword [esp + 0x28]
call fcn.0041fad0
add esp, 4
mov ecx, dword [esp]
mov ebx, dword [esp + 4]
mov eax, dword [esp + 8]
test ecx, ecx
je 0x4369f4
mov dword [esp], ecx
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
lea ecx, [esp + 0xc]
mov edx, esp
push 1
call fcn.00426a70
add esp, 4
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 0x10]
test edi, edi
je 0x4369f0
push edi
call dword [sym.imp.kernel32.dll_DeleteFileW]
test eax, eax
je 0x4369fb
mov byte [esi], 4
test ebx, ebx
jne 0x436a0b
jmp 0x436a17
mov eax, dword [esp + 0x14]
mov dword [esi], ebx
mov dword [esi + 4], eax
jmp 0x436a17
call dword [sym.imp.kernel32.dll_GetLastError]
mov byte [esi], 0
mov dword [esi + 4], eax
test ebx, ebx
je 0x436a17
mov ecx, edi
mov edx, 2
call fcn.0040c730
add esp, 0x18
pop esi
pop edi
pop ebx
ret

Function at 0x438719
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
test eax, eax
je 0x438758
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x438758
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x438758
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x438758
cmp dword [ecx + 0x74], 0xe
jbe 0x438758
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret
Function at 0x43ffb3
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push esi
call dword [sym.imp.kernel32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x440050
push ebx
push esi
call fcn.0043ff7c
xor ebx, ebx
sub eax, esi
push ebx
push ebx
push ebx
push ebx
sar eax, 1
push eax
push esi
push ebx
push ebx
mov dword [ebp - 8], eax
call fcn.0043ff10
add esp, 0x24
mov dword [ebp - 4], eax
test eax, eax
jne 0x43fffd
push esi
call dword [sym.imp.kernel32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x44004f
push edi
push eax
call fcn.00440bd0
mov edi, eax
pop ecx
push ebx
test edi, edi
jne 0x44001d
call fcn.0043ea71
pop ecx
push esi
call dword [sym.imp.kernel32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x44004e
push ebx
push dword [ebp - 4]
push edi
push dword [ebp - 8]
push esi
push ebx
push ebx
call fcn.0043ff10
add esp, 0x20
test eax, eax
jne 0x44003c
push edi
call fcn.0043ea71
jmp 0x440044
push ebx
call fcn.0043ea71
mov ebx, edi
pop ecx
push esi
call dword [sym.imp.kernel32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop edi
pop ebx
pop esi
leave
ret

Function at 0x44134d
Capabilities:
Allocate thread local storage

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x457048
push 0x457040
push str.FlsAlloc
push 0x1f
call fcn.0044120c
mov esi, eax
add esp, 0x10
test esi, esi
je 0x441381
push dword [ebp + 8]
mov ecx, esi
call dword [0x4491e8]
call esi
jmp 0x441387
call dword [sym.imp.kernel32.dll_TlsAlloc]
pop esi
pop ebp
ret 4

Function at 0x4413cb
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x457058
push 0x457050
push str.FlsGetValue
push 0x21
call fcn.0044120c
mov esi, eax
add esp, 0x10
test esi, esi
je 0x441402
push dword [ebp + 8]
mov ecx, esi
call dword [0x4491e8]
call esi
pop esi
pop ebp
ret 4
pop esi
pop ebp
jmp dword [sym.imp.kernel32.dll_TlsGetValue]

Function at 0x44140a
Capabilities:
Set thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x457060
push 0x457058
push str.FlsSetValue
push 0x22
call fcn.0044120c
mov esi, eax
add esp, 0x10
test esi, esi
je 0x441444
push dword [ebp + 0xc]
mov ecx, esi
push dword [ebp + 8]
call dword [0x4491e8]
call esi
pop esi
pop ebp
ret 8
pop esi
pop ebp
jmp dword [sym.imp.kernel32.dll_TlsSetValue]
Function at 0x4468a0
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x4468cd
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x4468cd
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
sete al
pop ebp
ret
xor eax, eax
pop ebp
ret
Function at 0x447840
Capabilities:
Allocate thread local storage

Disassembly:
push ebx
push edi
push esi
sub esp, 0x20
cmp dword [ecx + 4], 0
mov esi, ecx
je 0x4478b1
lea ebx, [esi + 0xc]
mov dword [esp + 4], 0
lea eax, [esp + 4]
push 0
push eax
push 0
push ebx
call dword [sym.imp.kernel32.dll_InitOnceBeginInitialize]
cmp eax, 1
mov dword [esp], eax
jne 0x4478ec
cmp dword [esp + 4], 0
je 0x4478d3
call dword [sym.imp.kernel32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x447901
mov edi, eax
inc eax
mov dword [esi], eax
mov eax, dword [0x45ea5c]
nop dword [eax]
mov dword [esi + 8], eax
lock cmpxchg dword [0x45ea5c], esi
jne 0x447890
mov byte [0x45ea58], 1
push 0
push 0
push ebx
call dword [sym.imp.kernel32.dll_InitOnceComplete]
jmp 0x4478e3
call dword [sym.imp.kernel32.dll_TlsAlloc]
cmp eax, 0xffffffff
mov dword [esp], eax
je 0x447944
mov ecx, eax
xor eax, eax
inc ecx
lock cmpxchg dword [esi], ecx
jne 0x4478d7
mov edi, dword [esp]
jmp 0x4478e3
mov edi, dword [esi]
jmp 0x4478e2
mov edi, eax
push dword [esp]
call dword [sym.imp.kernel32.dll_TlsFree]
dec edi
mov eax, edi
add esp, 0x20
pop esi
pop edi
pop ebx
ret
mov ecx, esp
lea edx, [esp + 8]
mov dword [esp + 8], 0
call fcn.00447980
ud2
push 0
push 4
push ebx
call dword [sym.imp.kernel32.dll_InitOnceComplete]
lea ecx, [esp + 8]
mov edx, 0x4546d8
mov dword [esp + 8], 0x4546a0
mov dword [esp + 0xc], 1
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], 0x454e90
mov dword [esp + 0x14], 0
call fcn.00446c50
ud2
mov ecx, esp
lea edx, [esp + 8]
mov dword [esp + 8], 0x4546a0
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], 0x454e90
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0
call fcn.004479c0
ud2
Function at 0x401460
Capabilities:
Execute command

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov dword [esp], 0x406064
call sym._system
mov dword [ebp - 0xc], 0
jmp 0x40156f
mov dword [ebp - 0x10], 0
jmp 0x401553
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 8]
jne 0x4014d9
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
jne 0x4014d9
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x10]
jne 0x4014aa
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x14]
je 0x4014ba
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x18]
jne 0x4014cb
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x1c]
jne 0x4014cb
mov dword [esp], 0x406068
call sym._printf
jmp 0x40154f
mov dword [esp], 0x40606b
call sym._printf
jmp 0x40154f
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x10]
jne 0x401507
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x14]
jne 0x401507
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x18]
jne 0x401507
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x1c]
jne 0x401507
mov dword [esp], 0x40606e
call sym._printf
jmp 0x40154f
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x10]
jne 0x401525
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x14]
jne 0x401525
mov dword [esp], 0x406071
call sym._printf
jmp 0x40154f
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x18]
jne 0x401543
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x1c]
jne 0x401543
mov dword [esp], 0x406074
call sym._printf
jmp 0x40154f
mov dword [esp], 0x406077
call sym._printf
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x20]
jl 0x40148a
mov dword [esp], 0xa
call sym._putchar
add dword [ebp - 0xc], 1
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x20]
jl 0x40147e
nop
leave
ret
Function at 0x4027a0
Capabilities:
Get thread local storage value

Disassembly:
push esi
push ebx
sub esp, 0x14
mov dword [esp], 0x408044
call sym._EnterCriticalSection_4
mov ebx, dword [0x40803c]
sub esp, 4
test ebx, ebx
je 0x4027eb
nop
mov eax, dword [ebx]
mov dword [esp], eax
call sym._TlsGetValue_4
sub esp, 4
mov esi, eax
call sym._GetLastError_0
test eax, eax
jne 0x4027e4
test esi, esi
je 0x4027e4
mov eax, dword [ebx + 4]
mov dword [esp], esi
call eax
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x4027c0
mov dword [esp], 0x408044
call sym._LeaveCriticalSection_4
sub esp, 4
add esp, 0x14
pop ebx
pop esi
ret

Function at 0x4029d0
Capabilities:
Write file on windows

Disassembly:
push esi
push ebx
sub esp, 0x14
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x17
mov dword [esp + 4], 1
lea esi, [esp + 0x24]
mov dword [esp], str.Mingw_runtime_failure:_n
lea ebx, [eax + 0x40]
mov dword [esp + 0xc], ebx
call sym._fwrite
mov eax, dword [esp + 0x20]
mov dword [esp + 8], esi
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._vfprintf
call sym._abort
lea esi, [esi]

Function at 0x402a20
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
push edi
mov edi, ecx
push esi
push ebx
mov ebx, eax
mov esi, edx
sub esp, 0x4c
lea eax, [esp + 0x24]
mov dword [esp + 8], 0x1c
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._VirtualQuery_12
sub esp, 0xc
test eax, eax
je 0x402af8
mov eax, dword [esp + 0x38]
cmp eax, 0x40
je 0x402a5e
cmp eax, 4
jne 0x402a80
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], ebx
call sym._memcpy
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x30]
lea ebp, [esp + 0x20]
mov dword [esp + 8], 0x40
mov dword [esp + 0xc], ebp
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call sym._VirtualProtect_16
sub esp, 0x10
mov edx, dword [esp + 0x38]
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 0x1c], edx
call sym._memcpy
mov edx, dword [esp + 0x1c]
cmp edx, 0x40
je 0x402a6e
cmp edx, 4
je 0x402a6e
mov eax, dword [esp + 0x20]
mov dword [esp + 0xc], ebp
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call sym._VirtualProtect_16
sub esp, 0x10
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x1c
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
call fcn.004029d0
Function at 0x7813166c
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp word [eax], 0x5a4d
je 0x7813167e
xor eax, eax
ret
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x7813167b
movzx eax, word [ecx + 0x18]
cmp eax, 0x10b
je 0x781316b0
cmp eax, 0x20b
jne 0x7813167b
xor eax, eax
cmp dword [ecx + 0x84], 0xe
jbe 0x781316c1
cmp dword [ecx + 0xf8], eax
jmp 0x781316be
xor eax, eax
cmp dword [ecx + 0x74], 0xe
jbe 0x781316c1
cmp dword [ecx + 0xe8], eax
setne al
ret

Function at 0x78131aca
Capabilities:
Write file on windows

Disassembly:
push ecx
push ebx
mov ebx, dword [esp + 0xc]
push esi
push edi
xor esi, esi
xor edi, edi
cmp ebx, dword [edi*8 + 0x781bf018]
je 0x78131ae5
inc edi
cmp edi, 0x17
jb 0x78131ad6
cmp edi, 0x17
jae 0x78131c65
push ebp
push 3
call sym.MSVCR80.dll__set_error_mode
cmp eax, 1
pop ecx
je 0x78131c31
push 3
call sym.MSVCR80.dll__set_error_mode
test eax, eax
pop ecx
jne 0x78131b19
cmp dword [0x781c3b34], 1
je 0x78131c31
cmp ebx, 0xfc
je 0x78131c64
push str.Runtime_Error__n_nProgram:
mov ebx, 0x314
push ebx
mov ebp, 0x781c3808
push ebp
call sym.MSVCR80.dll_strcpy_s
add esp, 0xc
test eax, eax
je 0x78131b4f
push esi
push esi
push esi
push esi
push esi
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
push 0x104
mov esi, 0x781c3821
push esi
push 0
mov byte [0x781c3925], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x78131b93
push 0x781948c8
push 0x2fb
push esi
call sym.MSVCR80.dll_strcpy_s
add esp, 0xc
test eax, eax
je 0x78131b93
xor eax, eax
push eax
push eax
push eax
push eax
push eax
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
push esi
call sym.MSVCR80.dll_strlen
inc eax
cmp eax, 0x3c
pop ecx
jbe 0x78131bd8
push esi
call sym.MSVCR80.dll_strlen
sub esi, 0x3b
add eax, esi
push 3
mov ecx, 0x781c3b1c
push 0x781948c4
sub ecx, eax
push ecx
push eax
call sym.MSVCR80.dll_strncpy_s
add esp, 0x14
test eax, eax
je 0x78131bd8
xor esi, esi
push esi
push esi
push esi
push esi
push esi
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
jmp 0x78131bda
xor esi, esi
push 0x781948c0
push ebx
push ebp
call sym.MSVCR80.dll_strcat_s
add esp, 0xc
test eax, eax
je 0x78131bfa
push esi
push esi
push esi
push esi
push esi
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
push dword [edi*8 + 0x781bf01c]
push ebx
push ebp
call sym.MSVCR80.dll_strcat_s
add esp, 0xc
test eax, eax
je 0x78131c1c
push esi
push esi
push esi
push esi
push esi
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
push 0x12010
push str.Microsoft_Visual_C_Runtime_Library
push ebp
call fcn.781396ba
add esp, 0xc
jmp 0x78131c64
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ebp, eax
cmp ebp, esi
je 0x78131c64
cmp ebp, 0xffffffff
je 0x78131c64
push 0
lea eax, [esp + 0x14]
push eax
lea esi, [edi*8 + 0x781bf01c]
push dword [esi]
call sym.MSVCR80.dll_strlen
pop ecx
push eax
push dword [esi]
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop ebp
pop edi
pop esi
pop ebx
pop ecx
ret
Function at 0x781348a9
Capabilities:
Query environment variable

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
xor ebx, ebx
push ebx
push ebx
mov ebp, str.__MSVCRT_HEAP_SELECT
push ebp
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
call edi
mov esi, eax
cmp esi, ebx
je 0x781349fb
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x781349f9
push esi
push ebx
push ebp
call edi
test eax, eax
mov ebp, dword [sym.imp.KERNEL32.dll_HeapFree]
jbe 0x781349ed
cmp eax, esi
ja 0x781349ed
cmp byte [ebx], 0
mov ecx, ebx
je 0x78134923
mov al, byte [ecx]
cmp al, 0x61
jl 0x7813491d
cmp al, 0x7a
jg 0x7813491d
sub al, 0x20
mov byte [ecx], al
inc ecx
cmp byte [ecx], 0
jne 0x7813490f
push 0x16
push ebx
push str.__GLOBAL_HEAP_SELECTED
call sym.MSVCR80.dll_strncmp
add esp, 0xc
test eax, eax
jne 0x7813493b
mov edi, ebx
jmp 0x78134996
push 0x105
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x781349ed
push 3
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp byte [esi], 0
mov ecx, esi
je 0x7813497f
mov al, byte [ecx]
cmp al, 0x61
jl 0x78134979
cmp al, 0x7a
jg 0x78134979
sub al, 0x20
mov byte [ecx], al
inc ecx
cmp byte [ecx], 0
jne 0x7813496b
push esi
push ebx
call sym.MSVCR80.dll_strstr
pop ecx
pop ecx
push esi
push 0
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebp
test edi, edi
je 0x781349ed
push 0x2c
push edi
call sym.MSVCR80.dll_strchr
test eax, eax
pop ecx
pop ecx
je 0x781349ed
inc eax
cmp byte [eax], 0x20
je 0x781349a8
mov cl, byte [eax]
xor esi, esi
cmp cl, 0x30
jl 0x781349ed
cmp cl, 0x39
jg 0x781349ce
imul esi, esi, 0xa
movsx ecx, cl
inc eax
lea esi, [esi + ecx - 0x30]
mov cl, byte [eax]
cmp cl, 0x30
jge 0x781349b7
cmp esi, 2
je 0x781349dd
cmp esi, 3
je 0x781349dd
cmp esi, 1
jne 0x781349ed
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebp
mov eax, esi
jmp 0x78134a5b
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebp
xor ebx, ebx
lea eax, [esp + 0x10]
push eax
call sym.MSVCR80.dll__get_osplatform
test eax, eax
pop ecx
je 0x78134a17
push ebx
push ebx
push ebx
push ebx
push ebx
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
lea eax, [esp + 0x14]
push eax
call sym.MSVCR80.dll__get_winmajor
test eax, eax
pop ecx
je 0x78134a33
push ebx
push ebx
push ebx
push ebx
push ebx
call sym.MSVCR80.dll__invoke_watson
add esp, 0x14
cmp dword [esp + 0x10], 2
jne 0x78134a46
cmp dword [esp + 0x14], 5
jb 0x78134a46
xor eax, eax
inc eax
jmp 0x78134a5b
lea eax, [esp + 0x18]
push eax
call fcn.7813487c
cmp byte [esp + 0x1c], 6
pop ecx
sbb eax, eax
add eax, 3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret