Function at 0x10033030
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0xa58
mov esi, edx
mov dword [ebp - 0xa4c], ecx
mov ebx, eax
mov eax, dword [0x10234e38]
xor eax, ebp
mov dword [ebp - 0x10], eax
cmp dword [esi], 3
je 0x100339a5
mov ecx, dword [ebx + 0x118]
cmp ecx, 0xfffffffc
je 0x1003399b
cmp ecx, 0xfffffffd
je 0x10033096
cmp ecx, 0xfffffffe
jne 0x10033079
mov edx, str.FOR_TYPE
jmp 0x1003309b
cmp ecx, 0xffffffff
jne 0x10033085
mov edx, str.FOR_PRINT
jmp 0x1003309b
test byte [ebx + 0x199], 4
je 0x10033194
xor edx, edx
jmp 0x100330a4
mov edx, str.FOR_ACCEPT
test byte [ebx + 0x199], 4
je 0x100330b1
test byte [ebx + 0x190], 1
je 0x10033194
test edx, edx
je 0x10033194
push 0x105
mov dword [ebp - 0xa48], 0
lea eax, [ebp - 0x116]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea edx, [eax - 1]
cmp edx, 0x103
ja 0x10033102
mov dword [ebp - 0xa48], eax
lea edi, [ebp - 0x116]
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa50], 1
jmp 0x10033392
mov eax, dword [ebx + 0x118]
add eax, 4
cmp eax, 0xa
ja 0x1003311f
movzx eax, byte [eax + 0x10214a94]
add eax, 0x1003311f
notrack jmp eax
xor edi, edi
jmp 0x10033160
mov ecx, edi
mov dword [ebp - 0xa54], edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x1003317f
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x1003316a
dec eax
mov dword [ebp - 0xa48], eax
mov dword [ebp - 0xa50], 0
jmp 0x10033392
mov eax, dword [esi + 4]
test eax, eax
je 0x100331eb
mov edx, dword [esi + 8]
cmp edx, 0x104
jl 0x100331ab
mov edx, 0x104
push edx
push eax
mov dword [ebp - 0xa48], edx
lea eax, [ebp - 0x320]
push eax
call fcn.10061710
add esp, 0xc
mov eax, dword [ebp - 0xa48]
lea edi, [ebp - 0x320]
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa50], 1
mov byte [ebp + eax - 0x320], 0
jmp 0x10033392
mov dword [ebp - 0xa48], 0
cmp dword [0x102372a0], 0
je 0x10033985
mov edx, dword [0x10237310]
push ecx
push str.FORT_d
lea eax, [ebp - 0x320]
push eax
call edx
add esp, 0xc
push 0x105
lea eax, [ebp - 0x116]
push eax
lea edx, [ebp - 0x320]
push edx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
ja 0x10033974
mov byte [ebp - 0x116], 0
test eax, eax
je 0x10033268
dec eax
lea edi, [ebp - 0x116]
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa48], eax
mov dword [ebp - 0xa50], 1
jmp 0x10033392
mov eax, dword [ebx + 0x118]
add eax, 4
cmp eax, 0xa
ja 0x10033285
movzx eax, byte [eax + 0x10214aa0]
add eax, 0x10033285
notrack jmp eax
xor edi, edi
test byte [ebx + 0x199], 4
jne 0x100332ff
test byte [ebx + 0x191], 0x20
je 0x100332b7
mov edi, dword [ebx + 0x74]
mov dword [ebp - 0xa54], edi
mov dword [esi], 0
mov dword [ebp - 0xa50], 1
jmp 0x10033373
mov dword [ebp - 0xa54], edi
cmp dword [0x102372a0], 0
je 0x1003355f
mov edx, dword [0x10237310]
push dword [ebx + 0x118]
push str.fort._d
lea eax, [ebp - 0x320]
push eax
call edx
add esp, 0xc
mov dword [ebp - 0xa50], 1
lea edi, [ebp - 0x320]
mov dword [ebp - 0xa54], edi
jmp 0x10033373
mov byte [ebp - 0x320], 0
lea edi, [ebp - 0x320]
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa50], 1
jmp 0x10033373
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x1003338c
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x10033377
dec eax
mov dword [ebp - 0xa48], eax
cmp byte [edi], 0x20
jne 0x100333cc
test eax, eax
jle 0x100333e8
inc edi
dec eax
cmp byte [edi], 0x20
jne 0x100333c0
test eax, eax
jle 0x1003395d
inc edi
dec eax
cmp byte [edi], 0x20
jne 0x100333c0
test eax, eax
jle 0x1003395d
inc edi
dec eax
cmp byte [edi], 0x20
je 0x100333b1
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa48], eax
test eax, eax
jle 0x100333e8
movsx edx, byte [eax + edi - 1]
test edx, 0xffffffdf
jne 0x10033414
dec eax
mov dword [ebp - 0xa48], eax
test eax, eax
jg 0x100333d0
jne 0x10033414
test byte [ebx + 0x199], 4
je 0x10033414
mov eax, ebx
lea edx, [ebp - 0xa54]
lea ecx, [ebp - 0xa48]
call fcn.100339f0
test eax, eax
jne 0x10033543
mov edi, dword [ebp - 0xa54]
cmp dword [ebp - 0xa50], 0
jne 0x10033424
xor ecx, ecx
jmp 0x100334cc
mov eax, dword [ebp - 0xa48]
push edi
push ebx
mov byte [edi + eax], 0
call fcn.100183d0
add esp, 8
cmp eax, 0xffffffff
je 0x1003357e
cmp eax, 1
je 0x10033454
cmp eax, 0xfffffffa
jne 0x10033472
cmp dword [0x1024c380], 0
jne 0x10033472
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
xor ecx, ecx
mov dword [ebx + 0xfc], eax
mov dword [ebp - 0xa50], ecx
mov edi, dword [ebp - 0xa54]
jmp 0x100334cc
test eax, eax
jne 0x10033494
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
xor ecx, ecx
mov dword [ebx + 0xfc], eax
mov dword [ebp - 0xa50], ecx
mov edi, dword [ebp - 0xa54]
jmp 0x100334cc
cmp eax, 2
jne 0x100334b7
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
xor ecx, ecx
mov dword [ebx + 0xfc], eax
mov dword [ebp - 0xa50], ecx
mov edi, dword [ebp - 0xa54]
jmp 0x100334cc
mov dword [ebp - 0xa50], 0
mov ecx, 1
mov edi, dword [ebp - 0xa54]
mov esi, dword [ebp - 0xa4c]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x100334d2
cmp dword [0x1024c380], 0
je 0x100334f9
cmp dword [ebp - 0xa50], 0
jne 0x1003350b
cmp dword [ebx + 0xfc], 0xffffffff
je 0x10033569
jmp 0x1003350b
cmp dword [ebp - 0xa50], 0
jne 0x1003350b
cmp dword [ebx + 0xfc], 0xffffffff
je 0x1003351c
test ecx, ecx
jne 0x1003351c
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0xa50]
mov dword [edx], eax
jmp 0x10033525
mov eax, dword [ebp + 0x14]
mov dword [eax], 1
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x10], 0
xor ecx, ebp
cmp ecx, dword [0x10234e38]
jne 0x10033579
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x10], 0
xor ecx, ebp
cmp ecx, dword [0x10234e38]
jne 0x10033579
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
call fcn.10061c60
jmp 0x100332ca
test ecx, ecx
jne 0x1003351c
mov dword [ebx + 0xfc], 0
jmp 0x1003350f
call fcn.101a6152
mov eax, dword [esi + 0xc]
test byte [ebx + 0x199], 8
jne 0x10033594
test eax, eax
je 0x1003369e
jmp 0x1003359c
test eax, eax
je 0x1003393e
mov edi, dword [esi + 0x10]
cmp edi, 0x104
jge 0x10033921
push edi
push eax
lea eax, [ebp - 0x21b]
push eax
call fcn.10061710
add esp, 0xc
mov byte [ebp + edi - 0x21b], 0
lea eax, [ebp - 0x21b]
mov dword [ebp - 0xa58], eax
cmp byte [eax], 0x20
jne 0x100335ea
test edi, edi
jle 0x10033916
inc eax
dec edi
cmp byte [eax], 0x20
je 0x100335d5
mov dword [ebp - 0xa58], eax
test edi, edi
jle 0x1003360b
mov edx, eax
movsx eax, byte [edi + edx - 1]
test eax, 0xffffffdf
jne 0x10033902
dec edi
test edi, edi
jg 0x100335f0
mov dword [ebp - 0xa58], edx
cmp dword [esi], 3
je 0x100337bb
xor ebx, ebx
mov eax, edi
add eax, dword [ebp - 0xa48]
add eax, ebx
cmp eax, 0x104
jle 0x1003364c
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x10], 0
xor ecx, ebp
cmp ecx, dword [0x10234e38]
jne 0x10033579
mov eax, 0x2b
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
push edi
push dword [ebp - 0xa58]
push dword [ebp - 0xa4c]
call fcn.10061710
add esp, 0xc
mov eax, dword [ebp - 0xa4c]
add eax, edi
test ebx, ebx
je 0x10033670
mov byte [eax], 0x5c
push dword [ebp - 0xa48]
push dword [ebp - 0xa54]
add eax, ebx
push eax
call fcn.10061710
add esp, 0xc
mov eax, dword [ebp - 0xa48]
add edi, ebx
add eax, dword [ebp - 0xa4c]
mov byte [edi + eax], 0
jmp 0x1003350f
call dword [sym.imp.KERNEL32.dll_GetUserDefaultLangID]
movzx eax, ax
cmp eax, 0x411
jne 0x10033746
push 0x105
lea edi, [ebp - 0x93e]
push edi
push 0xffffffffffffffff
push dword [ebp - 0xa54]
push 1
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
lea eax, [ebp - 0x734]
push eax
push 0x105
push edi
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
mov edi, eax
test edi, edi
je 0x100337aa
cmp edi, 0x105
jae 0x100337aa
push 0
push 0
push 0x105
lea eax, [ebp - 0x21b]
push eax
push 0xffffffffffffffff
lea edx, [ebp - 0x734]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edx, dword [ebp - 0xa48]
neg edx
add edx, edi
dec edx
test edx, edx
jle 0x100337aa
xor eax, eax
movzx ecx, byte [ebp + eax - 0x21b]
test ecx, 0x80
jne 0x100337aa
inc eax
cmp eax, edx
jl 0x1003372f
jmp 0x10033798
call dword [sym.imp.KERNEL32.dll_GetSystemDefaultLangID]
movzx eax, ax
cmp eax, 0x411
je 0x100336b2
push 0
lea eax, [ebp - 0x21b]
push eax
push 0x105
push dword [ebp - 0xa54]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
mov edi, eax
test edi, edi
je 0x100337aa
cmp edi, 0x105
jae 0x100337aa
push edi
push 0x3f
lea eax, [ebp - 0x21b]
push eax
call fcn.101c8ba0
add esp, 0xc
test eax, eax
jne 0x100337aa
mov dword [ebp - 0xa48], edi
lea eax, [ebp - 0x21b]
mov dword [ebp - 0xa54], eax
xor edi, edi
mov dword [ebp - 0xa58], edi
cmp dword [esi], 3
jne 0x10033614
test byte [ebx + 0x191], 0x20
je 0x100337e6
test edi, edi
jle 0x10033614
mov eax, dword [ebp - 0xa58]
cmp byte [eax + edi], 0x5c
je 0x10033614
mov ebx, 1
jmp 0x10033616
push 0x105
lea eax, [ebp - 0x425]
push eax
push str.FORT_TMPDIR
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
ja 0x100338f1
mov byte [ebp - 0x425], 0
cmp dword [esi + 0xc], 0
je 0x10033881
push 0x105
push 0
lea edi, [ebp - 0x52a]
push edi
call fcn.10061620
add esp, 0xc
push edi
push 0
push 0x10214bf4
push dword [ebp - 0xa58]
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x10033864
test byte [ebx + 0x199], 8
je 0x1003384f
lea edi, [ebp - 0x528]
mov esi, dword [ebp - 0xa4c]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x10033855
jmp 0x1003350f
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x10], 0
xor ecx, ebp
cmp ecx, dword [0x10234e38]
jne 0x10033579
jmp 0x1003363f
test byte [ebx + 0x199], 8
je 0x100338a3
mov byte [ebp - 0xa44], 0x2e
lea eax, [ebp - 0xa44]
mov byte [eax + 1], 0
mov dword [eax - 0x14], eax
jmp 0x10033812
test eax, eax
je 0x100338cb
lea esi, [ebp - 0xa44]
lea edi, [ebp - 0x425]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x100338b3
lea eax, [ebp - 0xa44]
mov dword [eax - 0x14], eax
jmp 0x10033812
lea esi, [ebp - 0xa44]
push esi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x100338e6
mov esi, 0
mov dword [ebp - 0xa58], esi
jmp 0x10033812
cmp eax, 0x105
jae 0x10033805
inc eax
jmp 0x1003380c
mov dword [ebp - 0xa58], edx
cmp dword [esi], 3
jne 0x100337cc
jmp 0x100337bb
mov dword [ebp - 0xa58], eax
jmp 0x100337b2
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x10], 0
xor ecx, ebp
cmp ecx, dword [0x10234e38]
jne 0x10033579
jmp 0x1003363f
cmp dword [esi], 3
jne 0x10033950
test byte [ebx + 0x191], 0x20
je 0x1003369e
mov edi, dword [ebp - 0xa54]
xor ecx, ecx
jmp 0x100334cc
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa48], eax
je 0x100333ea
jmp 0x10033414
cmp eax, 0x105
jae 0x1003323b
inc eax
jmp 0x10033242
call fcn.10061c60
mov edx, dword [0x10237310]
mov ecx, dword [ebx + 0x118]
jmp 0x10033208
mov edx, str.FOR_READ
jmp 0x1003309b
test byte [ebx + 0x191], 0x20
jne 0x10033059
mov dword [ebp - 0x320], 0x41524353
lea edi, [ebp - 0x320]
mov dword [edi + 4], 0x484354
mov eax, 7
mov dword [ebp - 0xa54], edi
mov dword [ebp - 0xa48], 7
mov dword [ebp - 0xa50], 1
jmp 0x1003342a