joyce8/EMBER2024-capa huggingface dataset:
Function at 0x100293b9
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 8]
mov ecx, eax
push ebx
mov ebx, dword [ebp + 0xc]
and eax, 0x3f
sar ecx, 6
push esi
push edi
imul edi, eax, 0x38
mov eax, dword [ecx*4 + 0x10087708]
mov dword [ebp - 0xc], ecx
mov ecx, dword [edi + eax + 0x18]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x100293f9
cmp byte [ebx], 0xa
jne 0x100293f9
or byte [edi + eax + 0x28], 4
jmp 0x100293fe
and byte [edi + eax + 0x28], 0xfb
add ecx, ebx
mov eax, ebx
mov dword [ebp - 0x10], ecx
mov esi, ebx
mov dword [ebp - 8], eax
cmp ebx, ecx
jae 0x100294fd
mov dl, byte [eax]
cmp dl, 0x1a
je 0x100294e0
inc eax
cmp dl, 0xd
je 0x1002942a
mov dword [ebp - 8], eax
mov byte [esi], dl
jmp 0x10029450
cmp eax, ecx
jae 0x1002945e
mov cl, byte [eax]
xor eax, eax
cmp cl, 0xa
sete al
inc eax
add dword [ebp - 8], eax
cmp cl, 0xa
sete al
dec al
and al, 3
add al, 0xa
mov byte [esi], al
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x10]
xor edx, edx
inc edx
add esi, edx
cmp eax, ecx
jb 0x10029412
jmp 0x100294fd
push 0
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100294db
cmp dword [ebp - 0x10], 0
je 0x100294db
mov ecx, dword [ebp - 0xc]
mov eax, dword [ecx*4 + 0x10087708]
test byte [eax + edi + 0x28], 0x48
je 0x100294b5
mov dl, byte [ebp - 1]
lea eax, [esi + 1]
mov dword [ebp - 0x14], eax
cmp dl, 0xa
jne 0x100294a0
mov byte [esi], dl
jmp 0x100294b1
mov byte [esi], 0xd
mov eax, dword [ecx*4 + 0x10087708]
mov byte [eax + edi + 0x2a], dl
mov eax, dword [ebp - 0x14]
mov esi, eax
jmp 0x100294fd
cmp byte [ebp - 1], 0xa
jne 0x100294c4
cmp esi, ebx
jne 0x100294c4
mov byte [esi], 0xa
jmp 0x100294fc
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.10029f3f
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x100294fd
mov byte [esi], 0xd
jmp 0x100294fc
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx*4 + 0x10087708]
mov al, byte [ecx + edi + 0x28]
test al, 0x40
jne 0x100294fa
or al, 2
mov byte [ecx + edi + 0x28], al
jmp 0x100294fd
mov byte [esi], dl
inc esi
sub esi, ebx
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret
Function at 0x10029506
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
mov ecx, eax
push ebx
mov ebx, dword [ebp + 0xc]
and eax, 0x3f
push esi
sar ecx, 6
push edi
imul edi, eax, 0x38
mov dword [ebp - 8], ecx
mov eax, dword [ecx*4 + 0x10087708]
push 0xa
pop edx
mov dword [ebp - 0x18], edx
mov ecx, dword [eax + edi + 0x18]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x1002954c
cmp word [ebx], dx
jne 0x1002954c
or byte [eax + edi + 0x28], 4
jmp 0x10029551
and byte [eax + edi + 0x28], 0xfb
lea edx, [ebx + ecx*2]
mov eax, ebx
mov dword [ebp - 0xc], edx
mov esi, ebx
mov dword [ebp - 4], eax
cmp ebx, edx
jae 0x100296b4
mov dword [ebp - 0x10], 0xd
movzx ecx, word [eax]
mov edx, ecx
mov dword [ebp - 0x14], edx
mov edx, dword [ebp - 0xc]
cmp ecx, 0x1a
je 0x10029694
add eax, 2
cmp cx, word [ebp - 0x10]
je 0x10029592
mov dword [ebp - 4], eax
mov word [esi], cx
jmp 0x100295c8
cmp eax, edx
jae 0x100295d6
movzx eax, word [eax]
xor ecx, ecx
cmp ax, word [ebp - 0x18]
mov edx, eax
push 0xa
sete cl
xor eax, eax
lea ecx, [ecx*2 + 2]
add dword [ebp - 4], ecx
pop ecx
cmp dx, cx
mov edx, dword [ebp - 0xc]
sete al
dec eax
and eax, 3
add eax, ecx
mov word [esi], ax
mov eax, dword [ebp - 4]
push 2
pop ecx
add esi, ecx
cmp eax, edx
jb 0x1002956d
jmp 0x100296b4
push 0
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1002968f
cmp dword [ebp - 0x18], 0
je 0x1002968f
mov edx, dword [ebp - 8]
push 0xa
mov eax, dword [edx*4 + 0x10087708]
test byte [eax + edi + 0x28], 0x48
je 0x10029665
lea eax, [esi + 2]
mov dword [ebp - 0x1c], eax
mov ax, word [ebp - 4]
pop ecx
mov word [ebp - 2], ax
cmp ax, cx
jne 0x10029629
mov word [esi], cx
jmp 0x10029660
push 0xd
pop ecx
mov word [esi], cx
movzx ecx, ax
mov eax, dword [edx*4 + 0x10087708]
mov dx, word [ebp - 2]
shr ecx, 8
push 0xa
mov byte [eax + edi + 0x2a], dl
mov edx, dword [ebp - 8]
mov eax, dword [edx*4 + 0x10087708]
mov byte [eax + edi + 0x2b], cl
mov eax, dword [edx*4 + 0x10087708]
pop ecx
mov byte [eax + edi + 0x2c], cl
mov esi, dword [ebp - 0x1c]
jmp 0x100296b4
pop eax
cmp word [ebp - 4], ax
jne 0x10029675
cmp esi, ebx
jne 0x10029675
mov word [esi], ax
jmp 0x100296b1
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.10029f3f
add esp, 0x10
push 0xa
pop eax
cmp word [ebp - 4], ax
je 0x100296b4
push 0xd
pop eax
jmp 0x10029670
mov edx, dword [ebp - 8]
mov edx, dword [edx*4 + 0x10087708]
mov al, byte [edx + edi + 0x28]
test al, 0x40
jne 0x100296ae
or al, 2
mov byte [edx + edi + 0x28], al
jmp 0x100296b4
mov word [esi], cx
add esi, 2
sub esi, ebx
and esi, 0xfffffffe
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret
Function at 0x1002c333
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 0x1002c3d0
push ebx
push esi
call fcn.1002c2fc
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.10025a99
add esp, 0x24
mov dword [ebp - 4], eax
test eax, eax
jne 0x1002c37d
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x1002c3cf
push edi
push eax
call fcn.100259bb
mov edi, eax
pop ecx
push ebx
test edi, edi
jne 0x1002c39d
call fcn.1002573d
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x1002c3ce
push ebx
push dword [ebp - 4]
push edi
push dword [ebp - 8]
push esi
push ebx
push ebx
call fcn.10025a99
add esp, 0x20
test eax, eax
jne 0x1002c3bc
push edi
call fcn.1002573d
jmp 0x1002c3c4
push ebx
call fcn.1002573d
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 0x1002ee0b
Capabilities:
Get geographical location

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push esi
push edi
call fcn.100226eb
mov esi, dword [ebp + 8]
mov edi, eax
push 2
lea eax, [ebp - 4]
mov ecx, esi
push eax
and ecx, 0x3ff
push 0x20000001
or ecx, 0x400
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
test eax, eax
je 0x1002ee7a
cmp esi, dword [ebp - 4]
je 0x1002ee75
cmp dword [ebp + 0xc], 0
je 0x1002ee75
mov esi, dword [edi + 0x50]
lea ecx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x1002ee52
push dword [edi + 0x50]
sub esi, ecx
sar esi, 1
call fcn.1002e95d
pop ecx
xor ecx, ecx
cmp eax, esi
setne cl
mov eax, ecx
jmp 0x1002ee7c
xor eax, eax
inc eax
jmp 0x1002ee7c
xor eax, eax
pop edi
pop esi
leave
ret
Function at 0x1002eee1
Capabilities:
Get geographical location

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x10037080]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x18], eax
call fcn.100226eb
add eax, 0x50
lea edi, [ebp - 0x10]
mov dword [ebp - 0x14], eax
xor eax, eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call fcn.100226eb
lea ecx, [ebp - 0x10]
xor edx, edx
mov dword [eax + 0x34c], ecx
lea ecx, [esi + 0x80]
mov eax, dword [ebp - 0x14]
mov dword [eax], esi
lea edi, [eax + 4]
mov dword [edi], ecx
test ecx, ecx
je 0x1002ef58
cmp word [ecx], dx
je 0x1002ef58
mov eax, dword [0x1008d3ec]
push edi
dec eax
push eax
push 0x1008d2d8
call fcn.1002ee80
mov eax, dword [ebp - 0x14]
add esp, 0xc
xor edx, edx
mov dword [ebp - 0x10], edx
mov eax, dword [eax]
test eax, eax
je 0x1002efcb
cmp word [eax], dx
je 0x1002efcb
mov eax, dword [edi]
test eax, eax
je 0x1002ef7c
cmp word [eax], dx
je 0x1002ef7c
lea eax, [ebp - 0x10]
push eax
call fcn.1002e863
jmp 0x1002ef85
lea eax, [ebp - 0x10]
push eax
call fcn.1002e8fe
cmp dword [ebp - 0x10], 0
pop ecx
jne 0x1002eff5
mov eax, dword [0x1008d2d4]
push dword [ebp - 0x14]
dec eax
push eax
push 0x1008cfc8
call fcn.1002ee80
add esp, 0xc
test al, al
je 0x1002eff5
mov eax, dword [edi]
xor edi, edi
test eax, eax
je 0x1002efc0
cmp word [eax], di
je 0x1002efc0
lea eax, [ebp - 0x10]
push eax
call fcn.1002e863
pop ecx
jmp 0x1002eff7
lea eax, [ebp - 0x10]
push eax
call fcn.1002e8fe
jmp 0x1002efbd
mov eax, dword [edi]
test eax, eax
je 0x1002efe2
cmp word [eax], dx
je 0x1002efe2
lea eax, [ebp - 0x10]
push eax
call fcn.1002e818
pop ecx
jmp 0x1002eff5
mov dword [ebp - 0x10], 0x104
call dword [sym.imp.KERNEL32.dll_GetUserDefaultLCID]
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], eax
xor edi, edi
cmp dword [ebp - 0x10], 0
je 0x1002f0c0
lea eax, [ebp - 0x10]
push eax
lea eax, [esi + 0x100]
neg esi
sbb esi, esi
and esi, eax
push esi
call fcn.1002ed05
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x1002f0c0
movzx ecx, si
push ecx
call dword [sym.imp.KERNEL32.dll_IsValidCodePage]
test eax, eax
je 0x1002f0c0
push 1
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_IsValidLocale]
test eax, eax
je 0x1002f0c0
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x1002f04d
mov dword [eax], esi
mov eax, dword [ebp - 0x14]
push edi
push 0x55
add eax, 0x250
push eax
push dword [ebp - 0xc]
call fcn.10028134
test ebx, ebx
je 0x1002f0bb
push edi
push 0x55
lea eax, [ebx + 0x120]
push eax
push dword [ebp - 0xc]
call fcn.10028134
push 0x40
push ebx
push 0x1001
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
test eax, eax
je 0x1002f0c0
push 0x40
lea eax, [ebx + 0x80]
push eax
push 0x1002
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
test eax, eax
je 0x1002f0c0
push 0xa
push 0x10
lea ecx, [ebx + 0x100]
push ecx
push esi
call fcn.100330bf
add esp, 0x10
xor eax, eax
inc eax
jmp 0x1002f0c2
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10016f16
leave
ret
Function at 0x10033531
Capabilities:
Clear file content

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, dword [ebp + 8]
lea ecx, [ebp - 0x2c]
push esi
push edi
push dword [ebp + 0x10]
mov edi, dword [ebp + 0x14]
push dword [ebp + 0xc]
push ebx
call fcn.100334ad
mov eax, dword [ebp - 0x2c]
and eax, dword [ebp - 0x28]
cmp eax, 0xffffffff
je 0x100336a0
mov eax, dword [ebp - 0x24]
and eax, dword [ebp - 0x20]
cmp eax, 0xffffffff
je 0x100336a0
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], ecx
mov dword [ebp - 4], eax
test ecx, ecx
jl 0x10033655
jg 0x1003358d
test eax, eax
je 0x1003364b
push 1
push 0x1000
call fcn.10024290
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x100335b0
push 0xc
pop ebx
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], ebx
jmp 0x10033642
push 0x8000
push ebx
call fcn.100333de
pop ecx
pop ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x100335d9
jg 0x100335d4
cmp ecx, 0x1000
jb 0x100335d9
mov ecx, 0x1000
push edi
push ecx
push esi
push ebx
call fcn.10024cf6
add esp, 0x10
cmp eax, 0xffffffff
je 0x1003361e
mov ecx, dword [ebp - 4]
cdq
sub ecx, eax
mov eax, dword [ebp - 8]
mov dword [ebp - 4], ecx
sbb eax, edx
mov dword [ebp - 8], eax
test eax, eax
jg 0x100335d4
jl 0x10033605
test ecx, ecx
jne 0x100335c6
push dword [ebp - 0xc]
push ebx
call fcn.100333de
push esi
call fcn.1002573d
add esp, 0xc
xor ebx, ebx
jmp 0x100336ae
cmp byte [edi + 0x24], 0
je 0x10033635
cmp dword [edi + 0x20], 5
jne 0x10033635
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], 0xd
cmp byte [edi + 0x1c], 0
je 0x10033640
mov ebx, dword [edi + 0x18]
jmp 0x10033642
xor ebx, ebx
push esi
call fcn.1002573d
pop ecx
jmp 0x100336ae
test ecx, ecx
jg 0x10033617
jl 0x10033655
test eax, eax
jae 0x10033617
push 0
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
call fcn.10029f3f
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x10033675
cmp byte [edi + 0x1c], 0
je 0x10033617
jmp 0x100336a6
push ebx
call fcn.1002ccaa
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x10033617
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0xd
mov byte [edi + 0x24], 1
mov dword [edi + 0x20], eax
pop ebx
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], ebx
jmp 0x100336ae
cmp byte [edi + 0x1c], 0
je 0x100336ab
mov ebx, dword [edi + 0x18]
jmp 0x100336ae
push 0x16
pop ebx
push 0
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x14]
call fcn.10029f3f
add esp, 0x10
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret

Function at 0x10035370
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x1003539d
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x1003539d
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
sete al
pop ebp
ret
xor eax, eax
pop ebp
ret
Function at 0x401fc0
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x418e78
push 0x406f18
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 [0x422e48], edx
mov ecx, eax
and ecx, 0xff
mov dword [0x422e44], ecx
shl ecx, 8
add ecx, edx
mov dword [0x422e40], ecx
shr eax, 0x10
mov dword [0x422e3c], eax
call fcn.00406ed0
test eax, eax
jne 0x40202a
push 0x1c
call fcn.00402120
add esp, 4
call fcn.004054c0
test eax, eax
jne 0x40203d
push 0x10
call fcn.00402120
add esp, 4
mov dword [ebp - 4], 0
call fcn.00406cc0
call fcn.004038b0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x424550], eax
call fcn.00406b60
mov dword [0x422e2c], eax
test eax, eax
je 0x402070
mov eax, dword [0x424550]
test eax, eax
jne 0x40207a
push 0xffffffffffffffff
call fcn.00402be0
add esp, 4
call fcn.004068b0
call fcn.004067c0
call fcn.00402bb0
mov eax, dword [0x422e58]
mov dword [0x422e5c], eax
push eax
mov eax, dword [0x422e50]
push eax
mov ecx, dword [0x422e4c]
push ecx
call section..text
add esp, 0xc
mov dword [ebp - 0x1c], eax
push eax
call fcn.00402be0
jmp 0x4020d5
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 0x402120
Capabilities:
Terminate process

Disassembly:
cmp dword [0x422e34], 2
je 0x40212e
call fcn.00406ff0
mov eax, dword [esp + 4]
push eax
call fcn.00407030
add esp, 4
push 0xff
call dword [sym.imp.KERNEL32.dll_ExitProcess]

Function at 0x402c20
Capabilities:
Terminate process

Disassembly:
push ebx
push ebp
push esi
call fcn.00402ce0
mov eax, dword [0x422e78]
mov ebp, dword [esp + 0x10]
cmp eax, 1
jne 0x402c44
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 [0x422e74], 1
mov byte [0x422e70], bl
jne 0x402c9e
mov ecx, dword [0x42454c]
test ecx, ecx
je 0x402c8c
mov esi, dword [0x424548]
sub esi, 4
cmp esi, ecx
jb 0x402c8c
mov eax, dword [esi]
test eax, eax
je 0x402c85
call eax
mov ecx, dword [0x42454c]
sub esi, 4
cmp esi, ecx
jae 0x402c77
push 0x41d06c
push 0x41d064
call fcn.00402d00
add esp, 8
push 0x41d078
push 0x41d070
call fcn.00402d00
add esp, 8
test ebx, ebx
je 0x402cbd
call fcn.00402cf0
pop esi
pop ebp
pop ebx
ret
push ebp
mov dword [0x422e78], 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
Function at 0x4054c0
Capabilities:
Allocate thread local storage
Set thread local storage value

Disassembly:
push esi
call fcn.004038c0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
mov dword [0x41dbb0], eax
je 0x405518
push 0x74
push 1
call fcn.00407da0
mov esi, eax
add esp, 8
test esi, esi
je 0x405518
mov eax, dword [0x41dbb0]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x405518
push esi
call fcn.00405520
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esi], eax
mov dword [esi + 4], 0xffffffff
mov eax, 1
pop esi
ret
xor eax, eax
pop esi
ret

Function at 0x405540
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [0x41dbb0]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x4055ae
push 0x74
push 1
call fcn.00407da0
mov esi, eax
add esp, 8
test esi, esi
je 0x4055a4
mov ecx, dword [0x41dbb0]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x4055a4
push esi
call fcn.00405520
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push edi
mov dword [esi], eax
mov dword [esi + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
pop edi
pop esi
ret
push 0x10
call fcn.004020f0
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
pop edi
pop esi
ret
Function at 0x406b60
Capabilities:
Query environment variable

Disassembly:
mov eax, dword [0x423268]
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 0x406ba2
call edi
mov esi, eax
test esi, esi
je 0x406b8c
mov eax, 1
jmp 0x406b9d
call ebp
mov ebx, eax
test ebx, ebx
je 0x406caf
mov eax, 2
mov dword [0x423268], eax
cmp eax, 1
jne 0x406c42
test esi, esi
jne 0x406bbb
call edi
mov esi, eax
test esi, esi
je 0x406caf
cmp word [esi], 0
mov eax, esi
je 0x406bd5
add eax, 2
cmp word [eax], 0
jne 0x406bc3
add eax, 2
cmp word [eax], 0
jne 0x406bc3
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 0x406c34
push edi
call fcn.00402580
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x406c34
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 0x406c26
push ebx
call fcn.00402650
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 0x406caf
test ebx, ebx
jne 0x406c53
call ebp
mov ebx, eax
test ebx, ebx
je 0x406caf
mov cl, byte [ebx]
mov eax, ebx
test cl, cl
je 0x406c6b
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x406c5b
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x406c5b
sub eax, ebx
inc eax
mov esi, eax
push esi
call fcn.00402580
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x406c8d
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 0x407030
Capabilities:
Write file on windows

Disassembly:
mov ecx, dword [esp + 4]
sub esp, 0x1a8
mov eax, 0x41dd10
push ebx
push ebp
push esi
push edi
xor ebp, ebp
cmp ecx, dword [eax]
je 0x407054
add eax, 8
inc ebp
cmp eax, 0x41dda0
jb 0x407045
cmp ecx, dword [ebp*8 + 0x41dd10]
jne 0x4071fb
mov eax, dword [0x422e34]
cmp eax, 1
je 0x4071bd
test eax, eax
jne 0x407080
cmp dword [0x41d510], 1
je 0x4071bd
cmp ecx, 0xfc
je 0x4071fb
lea eax, [esp + 0xb4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x4070bb
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 0x407104
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 0x419444
add ebx, ecx
push ebx
call fcn.00408930
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, 0x419424
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 + 0x41dd14]
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.0040a610
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1a8
ret
mov eax, dword [0x423420]
test eax, eax
je 0x4071ce
mov esi, dword [eax + 0x48]
cmp esi, 0xffffffff
jne 0x4071d8
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebp*8 + 0x41dd14]
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