Function at 0x100393a0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0x24
mov esi, eax
mov ebx, ecx
mov edi, edx
test esi, esi
je 0x100399c5
movzx ecx, byte [esi + 0x198]
and ecx, 0x80
shr ecx, 7
mov dword [ebp - 0x10], ecx
movzx ecx, byte [esi + 0x199]
and ecx, 1
mov dword [ebp - 0x14], ecx
mov ecx, dword [esi + 0x15c]
mov dword [ebp - 0x18], ecx
xor ecx, ecx
mov edx, dword [esi + 0xfc]
mov dword [esi + 0xe0], ecx
mov dword [esi + 0xe4], ecx
mov dword [esi + 0x108], ecx
test ebx, ebx
jne 0x10039573
test byte [esi + 0x195], 4
jne 0x100394d6
mov eax, dword [esi + 0x90]
test eax, eax
je 0x100398ae
cmp byte [eax + 0x1e], 0
je 0x100398b7
movzx eax, word [esi + 0x17a]
test eax, eax
jg 0x100398b7
push 0
mov ecx, dword [esi + 0x5c]
lea eax, [ebp - 0x1c]
sub ecx, dword [esi + 0x58]
push eax
mov dword [ebp - 0x2c], ecx
push ecx
push dword [esi + 0x58]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
test ecx, ecx
mov edx, dword [esi + 0x110]
jne 0x10039461
mov ecx, 0xffffffff
push edx
push 0x20
mov ebx, dword [esi + 0x48]
add edx, ebx
push ebx
and byte [esi + 0x195], 0xfb
mov dword [esi + 0x50], 0
mov dword [esi + 0x54], edx
mov dword [esi + 0x4c], ebx
mov dword [esi + 0x5c], ebx
mov dword [ebp - 0x30], ecx
call fcn.10061620
mov ecx, dword [ebp - 0x30]
add esp, 0xc
mov eax, dword [ebp - 0x2c]
cdq
add eax, dword [esi + 0xd8]
mov dword [esi + 0xd8], eax
adc edx, dword [esi + 0xdc]
mov dword [esi + 0xdc], edx
mov dword [esi + 0xd4], edx
mov edx, dword [esi + 0x90]
mov dword [esi + 0xd0], eax
test edx, edx
je 0x10039a15
mov byte [edx + 0x1e], 0
test esi, esi
jne 0x10039896
jmp 0x100398a4
push 0
mov edi, dword [esi + 0x50]
lea eax, [ebp - 0x1c]
sub edi, dword [esi + 0x48]
push eax
push edi
push dword [esi + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
mov edx, dword [esi + 0x48]
mov eax, edi
mov ebx, dword [esi + 0x110]
test ecx, ecx
mov dword [esi + 0x4c], edx
jne 0x10039506
mov ecx, 0xffffffff
add ebx, edx
cdq
mov eax, edx
mov edx, dword [esi + 0xd8]
add edx, edi
mov dword [esi + 0x54], ebx
mov ebx, dword [esi + 0xdc]
adc ebx, eax
and byte [esi + 0x195], 0xfb
mov dword [esi + 0x50], 0
mov dword [esi + 0xd8], edx
mov dword [esi + 0xdc], ebx
test byte [esi + 0x19c], 4
je 0x1003955a
mov dword [esi + 0xd0], edx
test esi, esi
mov dword [esi + 0xd4], ebx
jne 0x10039896
jmp 0x100398a4
add dword [esi + 0xd0], edi
adc dword [esi + 0xd4], eax
test esi, esi
jne 0x10039896
jmp 0x100398a4
mov ecx, dword [esi + 0x50]
mov dword [ebp - 0x20], ecx
test ecx, ecx
je 0x10039620
cmp edi, dword [ebp - 0x20]
je 0x10039620
mov eax, dword [esi + 0x48]
sub dword [ebp - 0x20], eax
je 0x10039620
push 0
lea ecx, [ebp - 0x1c]
push ecx
push dword [ebp - 0x20]
push eax
mov dword [ebp - 0x28], edx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x28]
test eax, eax
jne 0x100395c3
mov ecx, 0xffffffff
test esi, esi
jne 0x10039896
jmp 0x100398a4
mov dword [ebp - 0x24], ebx
mov eax, dword [ebp - 0x20]
mov ebx, dword [esi + 0xd8]
mov dword [ebp - 0x28], edx
add ebx, eax
cdq
mov ecx, dword [esi + 0xdc]
adc ecx, edx
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x30], ebx
mov dword [esi + 0xd8], ebx
mov dword [esi + 0xdc], ecx
mov edx, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x24]
test byte [esi + 0x19c], 4
je 0x1003960f
mov eax, dword [ebp - 0x30]
mov dword [esi + 0xd0], eax
mov dword [esi + 0xd4], ecx
jmp 0x10039620
mov ecx, eax
add dword [esi + 0xd0], ecx
mov ecx, dword [ebp - 0x2c]
adc dword [esi + 0xd4], ecx
cmp dword [0x1024c380], 0
je 0x10039674
cmp dword [ebp - 0x18], 0
je 0x100395b1
cmp dword [ebp - 0x10], 0
je 0x10039665
cmp dword [ebp - 0x18], 0xfffffffa
je 0x10039865
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx - 1]
cmp ecx, 1
jbe 0x1003984f
cmp dword [ebp - 0x14], 0
je 0x10039674
push ecx
mov dword [ebp - 0x28], edx
call fcn.10066b20
mov edx, dword [ebp - 0x28]
add esp, 4
jmp 0x10039674
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx - 1]
cmp ecx, 1
jbe 0x1003984f
test byte [esi + 0x199], 0x40
jne 0x10039685
mov ecx, dword [esi + 0x50]
mov dword [ebp - 0x20], ecx
jmp 0x100396c9
test byte [esi + 0x197], 1
jne 0x1003967d
mov eax, dword [esi + 0x48]
mov ecx, dword [esi + 0x50]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x20], ecx
cmp edi, eax
je 0x100396a3
cmp edi, dword [ebp - 0x20]
jne 0x100396d8
mov eax, dword [esi + 0x110]
mov ecx, dword [esi + 0x4c]
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0x2c]
add edx, dword [esi + 0x104]
lea ecx, [ecx + eax*2]
mov dword [ebp - 0x30], eax
cmp edx, ecx
mov edx, dword [ebp - 0x28]
ja 0x10039820
cmp edi, dword [ebp - 0x20]
jne 0x100396d8
mov edi, dword [esi + 0x48]
mov ecx, dword [ebp - 0x20]
sub ecx, edi
add ebx, ecx
test byte [esi + 0x193], 4
je 0x100396f1
test byte [esi + 0x192], 0x40
je 0x100396f1
or byte [esi + 0x195], 8
mov ecx, dword [esi + 0x158]
test ecx, ecx
je 0x10039704
cmp ebx, ecx
jbe 0x1003976c
mov dword [ebp - 0x20], ebx
jmp 0x10039714
cmp ebx, 0x20000
jbe 0x1003976c
mov dword [ebp - 0x20], ebx
mov ecx, 0x20000
mov dword [ebp - 0x24], ebx
mov eax, edi
mov dword [ebp - 0x2c], edi
mov ebx, edx
mov dword [ebp - 0x28], esi
mov esi, ecx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp ebx, eax
je 0x1003992e
push 0
lea eax, [ebp - 0x1c]
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
cmp ecx, 1
je 0x100398cd
cmp dword [ebp - 0x20], 0
je 0x100398c2
cmp ecx, 1
jne 0x100398c2
mov eax, dword [ebp - 0x1c]
test eax, eax
ja 0x10039723
jmp 0x10039918
mov dword [ebp - 0x28], edx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0x28]
cmp edx, eax
je 0x1003998a
push 0
lea ecx, [ebp - 0x1c]
push ecx
push ebx
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
test ecx, ecx
jne 0x100397a6
cmp dword [ebp - 0x18], 1
je 0x10039974
mov ecx, 0xffffffff
test esi, esi
je 0x10039894
mov eax, ebx
cdq
mov edi, dword [esi + 0x48]
mov eax, edx
mov edx, dword [esi + 0xd8]
add edi, dword [esi + 0x110]
add edx, ebx
mov dword [esi + 0x54], edi
mov edi, dword [esi + 0xdc]
adc edi, eax
and byte [esi + 0x195], 0xfb
mov dword [esi + 0x50], 0
mov dword [esi + 0xd8], edx
mov dword [esi + 0xdc], edi
test byte [esi + 0x19c], 4
je 0x1003980b
mov dword [esi + 0xd0], edx
test esi, esi
mov dword [esi + 0xd4], edi
jne 0x10039896
jmp 0x100398a4
add dword [esi + 0xd0], ebx
adc dword [esi + 0xd4], eax
test esi, esi
jne 0x10039896
jmp 0x100398a4
mov eax, ebx
add edi, ebx
cdq
add dword [esi + 0xd0], ebx
mov ecx, dword [ebp - 0x30]
adc dword [esi + 0xd4], edx
or byte [esi + 0x195], 4
add dword [esi + 0x54], ecx
mov ecx, 1
mov dword [esi + 0x50], edi
test esi, esi
mov dword [esi + 0x4c], edi
jne 0x10039896
jmp 0x100398a4
call fcn.10066b40
mov edx, eax
cmp dword [0x1024c380], 0
je 0x1003987a
cmp dword [ebp - 0x10], 0
je 0x1003987a
cmp dword [ebp - 0x14], 0
je 0x1003987a
push edx
mov dword [ebp - 0x28], edx
call fcn.10066b20
mov edx, dword [ebp - 0x28]
add esp, 4
push 0
push edx
push ebx
push edi
call fcn.10066b20
mov ecx, eax
add esp, 0x10
cmp ecx, ebx
je 0x10039892
mov ecx, 0xffffffff
test esi, esi
je 0x100398a4
xor edx, edx
mov dword [esi + 0xc0], edx
mov dword [esi + 0xc4], edx
mov eax, ecx
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
movzx eax, word [esi + 0x17a]
test eax, eax
mov ecx, 1
test esi, esi
jne 0x10039896
jmp 0x100398a4
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x28]
jmp 0x10039793
mov eax, dword [ebp - 0x1c]
sub dword [ebp - 0x20], eax
add edi, eax
cmp dword [ebp - 0x28], 0
je 0x10039903
mov edx, dword [ebp - 0x28]
mov edx, dword [edx + 0x158]
mov dword [ebp - 0x30], edx
test edx, edx
je 0x10039903
mov edx, dword [ebp - 0x20]
cmp edx, dword [ebp - 0x30]
ja 0x100398f5
mov esi, edx
test edx, edx
je 0x10039923
test eax, eax
ja 0x10039723
jmp 0x10039923
mov edx, dword [ebp - 0x20]
cmp edx, 0x20000
ja 0x10039910
mov esi, edx
test edx, edx
jne 0x10039763
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x28]
jmp 0x100397a6
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x28]
jmp 0x100397ae
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
jne 0x10039733
push esi
push edi
push 1
call fcn.101c1582
add esp, 0xc
cmp eax, 0xffffffff
je 0x1003995c
mov dword [ebp - 0x1c], eax
mov ecx, 1
jmp 0x100398d0
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x10039742
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
jne 0x100397a1
xor ecx, ecx
jmp 0x100397a6
mov dword [ebp - 0x28], edx
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov edx, dword [ebp - 0x28]
cmp eax, 2
jne 0x10039782
push ebx
push edi
push 1
mov dword [ebp - 0x28], edx
call fcn.101c1582
mov edx, dword [ebp - 0x28]
add esp, 0xc
cmp eax, 0xffffffff
je 0x10039782
mov ecx, 1
jmp 0x100397a6
cmp dword [0x1024c380], 0
jne 0x10039a0e
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, eax
mov ecx, dword [0x1024c380]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], ecx
test ebx, ebx
je 0x100398b7
cmp dword [ebp - 0x10], 0
jne 0x1003984f
mov dword [ebp - 0x18], 1
cmp ebx, 0x20000
jbe 0x1003976c
jmp 0x1003970c
call fcn.10066b40
jmp 0x100399d6
test esi, esi
jne 0x10039896
jmp 0x100398a4