joyce8/EMBER2024-capa huggingface dataset:
Function at 0x10037280
Capabilities:
Enumerate threads
Suspend thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x10050040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x28], edx
push edi
xor ebx, ebx
push ebx
push 4
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], 0
call dword [sym.imp.KERNEL32.dll_CreateToolhelp32Snapshot]
mov edi, eax
cmp edi, 0xffffffff
je 0x10037408
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x1c
push eax
push edi
call dword [sym.imp.KERNEL32.dll_Thread32First]
test eax, eax
je 0x10037397
mov ebx, 1
cmp dword [ebp - 0x20], 0x10
jb 0x1003735a
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp dword [ebp - 0x14], eax
jne 0x1003735a
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [ebp - 0x18], eax
je 0x1003735a
mov edx, dword [esi]
test edx, edx
jne 0x10037326
push 0x200
push edx
push dword [0x100508fc]
mov dword [esi + 4], 0x80
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edx, eax
mov dword [esi], edx
test edx, edx
je 0x1003737f
jmp 0x1003734e
mov eax, dword [esi + 4]
cmp dword [esi + 8], eax
jb 0x1003734e
add eax, eax
mov dword [esi + 4], eax
shl eax, 2
push eax
push edx
push 0
push dword [0x100508fc]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov edx, eax
test edx, edx
je 0x1003737f
mov dword [esi], edx
mov ecx, dword [esi + 8]
mov eax, dword [ebp - 0x18]
mov dword [edx + ecx*4], eax
inc dword [esi + 8]
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x1c
push eax
push edi
call dword [sym.imp.KERNEL32.dll_Thread32Next]
test eax, eax
jne 0x100372e1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
je 0x10037397
mov eax, dword [esi]
xor ebx, ebx
test eax, eax
je 0x10037397
push eax
push ebx
push dword [0x100508fc]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [esi], ebx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x10037408
cmp dword [esi], 0
je 0x100373f5
xor ebx, ebx
cmp dword [esi + 8], ebx
jbe 0x100373f5
xor ecx, ecx
mov dword [ebp - 0x24], ecx
mov eax, dword [esi]
push dword [eax + ecx]
push 0
push 0x5a
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov edi, eax
test edi, edi
je 0x100373e6
push edi
call dword [sym.imp.KERNEL32.dll_SuspendThread]
push dword [ebp + 8]
mov edx, dword [ebp - 0x28]
mov ecx, edi
call fcn.10037110
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x24]
inc ebx
add ecx, 4
mov dword [ebp - 0x24], ecx
cmp ebx, dword [esi + 8]
jb 0x100373b3
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10043d30
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 9
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10043d30
mov esp, ebp
pop ebp
ret
Function at 0x10037420
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
push ecx
push edi
mov edi, ecx
cmp dword [edi], 0
je 0x10037484
push ebx
xor ebx, ebx
cmp dword [edi + 8], ebx
jbe 0x10037473
xor ecx, ecx
mov dword [ebp - 4], ecx
push esi
nop word [eax + eax]
mov eax, dword [edi]
push dword [eax + ecx]
push 0
push 0x5a
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov esi, eax
test esi, esi
je 0x10037463
push esi
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
inc ebx
add ecx, 4
mov dword [ebp - 4], ecx
cmp ebx, dword [edi + 8]
jb 0x10037440
pop esi
push dword [edi]
push 0
push dword [0x100508fc]
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop ebx
pop edi
mov esp, ebp
pop ebp
ret

Function at 0x10037490
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, dword [0x10050040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
imul esi, ecx, 0x2c
push edi
add esi, dword [0x10050e20]
mov eax, dword [esi]
mov cl, byte [esi + 0x14]
and cl, 1
lea edi, [eax - 5]
cmove edi, eax
movzx eax, cl
lea ebx, [eax*2 + 5]
lea eax, [ebp - 8]
push eax
push 0x40
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x100374ec
pop edi
pop esi
mov eax, 0xa
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10043d30
mov esp, ebp
pop ebp
ret
mov byte [edi], 0xe9
mov eax, dword [esi + 4]
sub eax, edi
sub eax, 5
mov dword [edi + 1], eax
test byte [esi + 0x14], 1
je 0x10037507
mov eax, dword [esi]
mov word [eax], 0xf9eb
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
or byte [esi + 0x14], 6
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10043d30
mov esp, ebp
pop ebp
ret
Function at 0x10038290
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
sub eax, 0
je 0x1003843c
sub eax, 1
jne 0x1003849f
mov eax, dword [ebp + 8]
push esi
push str.send
push str.ws2_32.dll
mov dword [0x1005092c], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call esi
push str.recv
push str.ws2_32.dll
mov dword [0x10050908], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call esi
cmp dword [0x10050908], 0
mov dword [0x10050904], eax
je 0x1003832a
test eax, eax
je 0x1003832a
call fcn.10042b70
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call fcn.10043050
push 0x10038020
push 0x10050908
call fcn.10042410
push 0x10038060
push 0x10050904
call fcn.10042410
call fcn.10042bd0
jmp 0x1003833e
push 0x10
push str.Error
push str.Failed_to_get_the_address_of_send_or_recv
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov esi, dword [sym.imp.KERNEL32.dll_CreateThread]
push 0
push 0
push 0
push 0x10038100
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10039330
push 0
push 0
call esi
push 0
push 0
push 0
push 0x100394a0
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10039760
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10039840
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10038ef0
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10039c30
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10039e20
push 0
push 0
call esi
push 0
push 0
push 0
push 0x10039940
push 0
push 0
call esi
push 0
push 0
push 0
push 0x1003a000
push 0
push 0
call esi
push 0
push 0
push 0
push 0x1003a3c0
push 0
push 0
call esi
push 0
push 0
push 0
push 0x1003c660
push 0
push 0
call esi
push 0
push 0
push 0
push 0x1003a790
push 0
push 0
call esi
push 0
push 0
push 0
push 0x1003aa10
push 0
push 0
call esi
pop esi
mov eax, 1
pop ebp
ret 0xc
cmp dword [0x10050908], 0
jne 0x1003844e
cmp dword [0x10050904], 0
je 0x1003849f
call fcn.10042b70
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call fcn.10043050
push 0x10038020
push 0x10050908
call fcn.10042880
push 0x10038060
push 0x10050904
call fcn.10042880
call fcn.10042bd0
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str._Unhook__Successfully_unhooked_send_and_recv_
call fcn.10038680
push 0x10038860
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov eax, 1
pop ebp
ret 0xc
Function at 0x10038d10
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [0x10050040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push str.xx_xx_xx
mov edx, 0x1005032c
call fcn.10038b70
mov edi, dword [sym.imp.KERNEL32.dll_VirtualProtect]
add esp, 4
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
push 6
lea ecx, [esi + 6]
push esi
mov dword [0x1005097c], ecx
call edi
mov eax, 0x10038c40
mov byte [esi], 0xe9
sub eax, esi
sub eax, 5
mov dword [esi + 1], eax
lea eax, [ebp - 0xc]
push eax
mov byte [esi + 5], 0x90
push dword [ebp - 8]
push 6
push esi
call edi
push str.xx____xxx____xxx____xxx____xxx____xxx____xxxx
mov edx, 0x100502bc
call fcn.10038b70
add esp, 4
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
push 6
lea ecx, [esi + 6]
push esi
mov dword [0x10050a7c], ecx
call edi
mov eax, 0x10038c60
mov byte [esi], 0xe9
sub eax, esi
sub eax, 5
mov dword [esi + 1], eax
lea eax, [ebp - 0xc]
push eax
mov byte [esi + 5], 0x90
push dword [ebp - 8]
push 6
push esi
call edi
push str.xx____xxx
mov edx, 0x10050338
call fcn.10038b70
add esp, 4
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
push 6
lea ecx, [esi + 6]
push esi
mov dword [0x10050ae4], ecx
call edi
mov eax, 0x10038c80
mov byte [esi], 0xe9
sub eax, esi
sub eax, 5
mov dword [esi + 1], eax
lea eax, [ebp - 0xc]
push eax
mov byte [esi + 5], 0x90
push dword [ebp - 8]
push 6
push esi
call edi
push str.xxxxxx
mov edx, 0x100502ec
call fcn.10038b70
add esp, 4
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
push 6
lea ecx, [esi + 6]
push esi
mov dword [0x100509d4], ecx
call edi
mov eax, 0x10038ca0
mov byte [esi], 0xe9
sub eax, esi
sub eax, 5
mov dword [esi + 1], eax
lea eax, [ebp - 0xc]
push eax
mov byte [esi + 5], 0x90
push dword [ebp - 8]
push 6
push esi
call edi
push str.xxxxx__x_xxxxxx_xx
mov edx, 0x10050384
call fcn.10038b70
add esp, 4
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
push 7
lea ecx, [esi + 7]
push esi
mov dword [0x10050aa4], ecx
call edi
mov eax, 0x10038cc0
mov byte [esi], 0xe9
sub eax, esi
sub eax, 5
mov dword [esi + 1], eax
mov eax, 0x90909090
mov word [esi + 5], ax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 8]
push 7
push esi
call edi
push str.xxxx_xx____xx
mov edx, 0x1005031c
call fcn.10038b70
add esp, 4
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
push 5
lea ecx, [esi + 5]
push esi
mov dword [0x10050dc0], ecx
call edi
mov eax, 0x10038ce0
mov byte [esi], 0xe9
sub eax, esi
sub eax, 5
mov dword [esi + 1], eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 8]
push 5
push esi
call edi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.10043d30
mov esp, ebp
pop ebp
ret
Function at 0x100412c0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 0xc]
sub eax, 0x10000
push eax
call fcn.10041470
add esp, 4
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 8]
jbe 0x1004138d
mov edx, dword [ebp - 4]
cmp edx, dword [section..data]
jb 0x1004130a
mov eax, dword [ebp - 4]
cmp eax, dword [0x10050004]
ja 0x1004130a
mov ecx, dword [ebp - 4]
sub ecx, 0x8000000
mov dword [ebp - 4], ecx
jmp 0x100412da
push 0x1c
push 0
lea edx, [ebp - 0x24]
push edx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0x1c
lea eax, [ebp - 0x24]
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
jne 0x10041330
jmp 0x1004138d
cmp dword [ebp - 0x14], 0x10000
jne 0x10041373
cmp dword [ebp - 0x18], 0x10000
jb 0x10041373
push 0x40
push 0x3000
push 0x10000
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x10041366
mov eax, dword [ebp - 8]
jmp 0x1004138f
mov eax, dword [ebp - 4]
sub eax, 0x10000
mov dword [ebp - 4], eax
jmp 0x10041388
mov ecx, dword [ebp - 0x20]
sub ecx, 0x10000
push ecx
call fcn.10041470
add esp, 4
mov dword [ebp - 4], eax
jmp 0x100412da
xor eax, eax
mov esp, ebp
pop ebp
ret

Function at 0x100413a0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 8]
push eax
call fcn.100414a0
add esp, 4
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 0xc]
jae 0x10041465
mov edx, dword [ebp - 4]
cmp edx, dword [section..data]
jb 0x100413e5
mov eax, dword [ebp - 4]
cmp eax, dword [0x10050004]
ja 0x100413e5
mov ecx, dword [ebp - 4]
add ecx, 0x8000000
mov dword [ebp - 4], ecx
jmp 0x100413b5
push 0x1c
push 0
lea edx, [ebp - 0x24]
push edx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0x1c
lea eax, [ebp - 0x24]
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
jne 0x1004140b
jmp 0x10041465
cmp dword [ebp - 0x14], 0x10000
jne 0x1004144e
cmp dword [ebp - 0x18], 0x10000
jb 0x1004144e
push 0x40
push 0x3000
push 0x10000
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x10041441
mov eax, dword [ebp - 8]
jmp 0x10041467
mov eax, dword [ebp - 4]
add eax, 0x10000
mov dword [ebp - 4], eax
jmp 0x10041460
mov ecx, dword [ebp - 0x24]
add ecx, dword [ebp - 0x18]
push ecx
call fcn.100414a0
add esp, 4
mov dword [ebp - 4], eax
jmp 0x100413b5
xor eax, eax
mov esp, ebp
pop ebp
ret
Function at 0x433000
Capabilities:
Encode data using xor
Packed with generic packer

Disassembly:
pushal
nop
nop
nop
nop
nop
nop
mov eax, section..text
nop
mov ebx, 0x40de38
mov ecx, 0x30d733c8
nop
nop
nop
test eax, eax
nop
nop
je 0x43304e
nop
nop
nop
nop
nop
nop
xor dword [eax], ecx
nop
nop
nop
inc eax
nop
nop
nop
nop
nop
nop
nop
inc eax
nop
nop
nop
nop
nop
nop
inc eax
nop
nop
nop
inc eax
nop
nop
nop
cmp eax, ebx
nop
nop
nop
nop
nop
jne 0x433024
nop
nop
nop
nop
mov eax, section..data
mov ebx, 0x4304d8
nop
mov ecx, 0x592f7727
nop
nop
nop
nop
nop
test eax, eax
je 0x433084
nop
nop
nop
nop
nop
nop
nop
nop
xor dword [eax], ecx
add eax, 4
nop
nop
nop
nop
cmp eax, ebx
nop
nop
nop
nop
nop
nop
nop
jne 0x43306c
nop
nop
nop
popal
nop
nop
jmp 0x431219
Function at 0x401550
Capabilities:
Accept command line arguments

Disassembly:
mov eax, dword fs:[0]
push ebp
mov ebp, esp
push 0xffffffffffffffff
push section..rdata
push 0x403704
push eax
mov dword fs:[0], esp
sub esp, 0x60
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [0x4071ac], eax
xor eax, eax
mov al, byte [0x4071ad]
mov dword [0x4071b8], eax
mov eax, dword [0x4071ac]
shr dword [0x4071ac], 0x10
and eax, 0xff
mov dword [0x4071b4], eax
shl eax, 8
add eax, dword [0x4071b8]
mov dword [0x4071b0], eax
call fcn.004036c0
test eax, eax
jne 0x4015c4
push 0x1c
call fcn.004016f0
add esp, 4
mov dword [ebp - 4], 0
call fcn.004034e0
call fcn.004034d0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x409620], eax
call fcn.00403080
mov dword [0x407170], eax
test eax, eax
je 0x4015f7
cmp dword [0x409620], 0
jne 0x401601
push 0xffffffffffffffff
call fcn.00402920
add esp, 4
call fcn.00402e00
call fcn.00402d10
call fcn.004028f0
mov esi, dword [0x409620]
mov al, byte [esi]
cmp al, 0x22
je 0x401628
cmp al, 0x20
jbe 0x401655
inc esi
cmp byte [esi], 0x20
ja 0x401620
jmp 0x401655
inc esi
cmp byte [esi], 0x22
je 0x401654
mov bl, byte [ebp - 0x28]
mov bl, byte [esi]
test bl, bl
je 0x40164f
xor eax, eax
mov al, bl
push eax
call fcn.00402cb0
add esp, 4
test eax, eax
je 0x401649
inc esi
inc esi
cmp byte [esi], 0x22
jne 0x401631
cmp byte [esi], 0x22
jne 0x401655
inc esi
cmp byte [esi], 0
je 0x401665
cmp byte [esi], 0x20
ja 0x401665
inc esi
cmp byte [esi], 0
jne 0x40165a
mov dword [ebp - 0x44], 0
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
test byte [ebp - 0x44], 1
mov eax, 0xa
je 0x401689
mov eax, dword [ebp - 0x40]
and eax, 0xffff
push eax
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call main
push eax
call fcn.00402920
jmp 0x4016ca
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x10]
pop edi
mov dword fs:[0], eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret

Function at 0x402960
Capabilities:
Terminate process

Disassembly:
cmp dword [0x4071e8], 1
push ebx
push esi
mov esi, dword [esp + 0xc]
push edi
jne 0x40297e
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov dword [0x4071e4], 1
cmp dword [esp + 0x14], 0
mov ebx, dword [esp + 0x18]
mov byte [0x4071e0], bl
jne 0x4029d8
cmp dword [0x409618], 0
je 0x4029c6
mov edi, dword [0x409614]
sub edi, 4
cmp edi, dword [0x409618]
jb 0x4029c6
mov eax, dword [edi]
test eax, eax
je 0x4029bb
call eax
sub edi, 4
cmp edi, dword [0x409618]
jae 0x4029b3
push 0x40701c
push 0x407014
call fcn.00402a10
add esp, 8
push 0x407024
push 0x407020
call fcn.00402a10
add esp, 8
test ebx, ebx
jne 0x4029ff
mov dword [0x4071e8], 1
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop edi
pop esi
pop ebx
ret
Function at 0x403080
Capabilities:
Query environment variable

Disassembly:
sub esp, 4
push ebx
push esi
push edi
xor ebx, ebx
push ebp
xor edi, edi
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
cmp dword [0x407290], ebx
jne 0x4030cf
call esi
cmp eax, ebx
mov edi, eax
je 0x4030ad
mov dword [0x407290], 1
jmp 0x4030cf
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
je 0x4030c5
mov dword [0x407290], 2
jmp 0x4030cf
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp dword [0x407290], 1
jne 0x40317e
test edi, edi
jne 0x4030f2
call esi
mov edi, eax
test edi, edi
jne 0x4030f2
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp word [edi], 0
mov esi, edi
je 0x40310c
add esi, 2
cmp word [esi], 0
jne 0x4030fa
add esi, 2
cmp word [esi], 0
jne 0x4030fa
sub esi, edi
push 0
sar esi, 1
push 0
inc esi
push 0
push 0
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebp, eax
test ebp, ebp
je 0x40316d
push ebp
call fcn.00403a20
add esp, 4
mov ebx, eax
test ebx, ebx
je 0x40316d
push 0
push 0
push ebp
push ebx
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x40315c
push ebx
call fcn.004023a0
add esp, 4
xor ebx, ebx
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp dword [0x407290], 2
jne 0x403202
test ebx, ebx
jne 0x4031a1
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
jne 0x4031a1
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov ebp, ebx
cmp byte [ebx], 0
je 0x4031b6
inc ebp
cmp byte [ebp], 0
jne 0x4031a8
inc ebp
cmp byte [ebp], 0
jne 0x4031a8
sub ebp, ebx
inc ebp
push ebp
call fcn.00403a20
mov dword [esp + 0x14], eax
add esp, 4
test eax, eax
jne 0x4031db
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edi, dword [esp + 0x10]
mov esi, ebx
mov ecx, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, dword [esp + 0x10]
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
Function at 0x403820
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x1a8
xor ecx, ecx
mov eax, 0x4074c0
push ebx
mov edx, dword [esp + 0x1b0]
push esi
push edi
push ebp
cmp dword [eax], edx
je 0x403847
add eax, 8
inc ecx
cmp eax, 0x407550
jb 0x403838
cmp dword [ecx*8 + 0x4074c0], edx
lea ebx, [ecx*8]
jne 0x403a0b
cmp dword [0x40717c], 1
je 0x4039c7
cmp dword [0x40717c], 0
jne 0x40387e
cmp dword [0x407180], 1
je 0x4039c7
cmp edx, 0xfc
je 0x403a0b
lea eax, [esp + 0xb4]
push 0x104
push eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
call ebp
test eax, eax
jne 0x4038bb
mov esi, str._program_name_unknown_
lea edi, [esp + 0xb4]
mov ecx, 5
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
lea ebp, [esp + 0xb4]
lea edi, [esp + 0xb4]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x3c
jbe 0x4038ff
lea edi, [esp + 0xb4]
mov ecx, 0xffffffff
sub eax, eax
push 3
repne scasb al, byte es:[edi]
not ecx
lea ebp, [esp + ecx + 0x7c]
push 0x406358
push ebp
call fcn.00405050
add esp, 0xc
mov esi, str.Runtime_Error__n_nProgram:
lea edi, [esp + 0x14]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, ebp
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov ecx, 0xffffffff
lea edi, [esp + 0x14]
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x406338
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov ecx, 0xffffffff
lea edi, [esp + 0x14]
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebx + 0x4074c4]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
lea edi, [esp + 0x14]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x12010
and ecx, 3
push str.Microsoft_Visual_C_Runtime_Library
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x1c]
push eax
call fcn.00404fb0
add esp, 0xc
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret
cmp dword [0x409510], 0
je 0x4039dd
mov eax, dword [0x409510]
mov esi, dword [eax + 0x10]
cmp esi, 0xffffffff
jne 0x4039e7
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebx + 0x4074c4]
push 0
lea eax, [esp + 0x14]
mov edi, edx
push eax
mov ecx, 0xffffffff
sub 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 ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret