Function at 0x59842dd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff2c
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0xd4], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], edx
mov byte [ebp - 9], al
mov esi, dword [ebp + 0x1c]
mov ebx, dword [ebp + 0x20]
lea edi, [ebp - 0xb4]
xor eax, eax
push ebp
push 0x598431f8
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
push ebp
push 0x598431c8
push dword fs:[eax]
mov dword fs:[eax], esp
call sub.kernel32.dll_GetCurrentThreadId
cmp eax, dword [0x59857ae4]
jne 0x59842e35
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x598431d2
cmp byte [0x598579ec], 0
je 0x59842e5a
call sub.kernel32.dll_GetCurrentThreadId
mov edx, dword [sym.imp.rtl120.bpl__System_MainThreadID]
cmp eax, dword [edx]
jne 0x59842e5a
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x598431d2
call fcn.59842c38
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
lea eax, [ebp + 0x18]
push eax
lea ecx, [ebp - 4]
lea edx, [ebp - 0x14]
lea eax, [ebp - 0x10]
call sym.madExcept_.bpl__Madexcept_CheckExceptParams_qqrrp14System_TObjectrpvr27System__AnsiStringT_us_i0__rp8_CONTEXT
cmp dword [ebp - 0x10], 0
je 0x59842ecc
push 0x59843214
push 0
lea eax, [ebp - 8]
call sub.rtl120.bpl__System__LStrClr_qqrpv
mov edx, eax
lea ecx, [ebp - 0x21]
mov eax, dword [ebp - 0x10]
call fcn.5981ba08
test al, al
je 0x59842ecc
call fcn.59801570
mov eax, dword [eax + 4]
cmp eax, dword [ebp - 0x10]
jne 0x59842eb4
call fcn.5981d760
cmp byte [ebp + 0x24], 0
jne 0x59842ebf
call sym.madExcept_.bpl__Madexcept_CloseApplication_qqrv
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x598431d2
test ebx, ebx
jne 0x59842ed7
call sym.madExcept_.bpl__Madexcept_Esp_qqrv
mov ebx, eax
test esi, esi
jne 0x59842ee2
call sym.madExcept_.bpl__Madexcept_Ebp_qqrv
mov esi, eax
cmp dword [ebp + 0x18], 0
je 0x59842f19
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 0xb8]
cmp eax, dword [ebp - 0x14]
ja 0x59842f19
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp - 0x14]
sub edx, dword [eax + 0xb8]
cmp edx, 4
ja 0x59842f19
mov eax, dword [ebp + 0x18]
mov ebx, dword [eax + 0xc4]
mov eax, dword [ebp + 0x18]
mov esi, dword [eax + 0xb4]
cmp dword [ebp - 0x10], 0
je 0x59842f78
cmp dword [0x598571b4], 0
je 0x59842f78
mov edx, 0x59843228
mov eax, dword [ebp - 0x10]
call fcn.5981baf8
test al, al
je 0x59842f78
lea edx, [ebp - 0xd4]
mov eax, dword [ebp - 0x14]
call sym.madExcept_.bpl__Madexcept_MESettings_qqrpv
mov eax, dword [ebp - 0xd4]
mov edx, dword [eax]
call dword [edx + 0x384]
test al, al
je 0x59842f78
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x20], eax
lea eax, [ebp + 0x18]
mov dword [ebp - 0x1c], eax
push 0
lea eax, [ebp - 0x20]
push eax
call dword [0x598571b4]
mov byte [ebp + 0x24], 0
call sub.kernel32.dll_GetCurrentThreadId
mov dword [edi + 4], eax
movzx eax, byte [ebp - 9]
mov byte [edi + 8], al
mov eax, dword [ebp - 0x10]
mov dword [edi + 0xc], eax
mov eax, dword [ebp - 0x14]
mov dword [edi + 0x10], eax
movzx eax, byte [ebp + 0x24]
mov byte [edi + 0x14], al
mov dword [edi + 0x18], ebx
mov dword [edi + 0x1c], esi
mov eax, dword [ebp + 0x18]
mov dword [edi + 0x20], eax
call fcn.59801570
push edi
lea esi, [eax + 0xd8]
add edi, 0x24
mov ecx, 0x14
rep movsd dword es:[edi], dword [esi]
pop edi
mov eax, dword [ebp + 8]
mov dword [edi + 0x74], eax
movzx eax, byte [ebp + 0x14]
mov byte [edi + 0x78], al
mov eax, dword [ebp + 0x10]
mov dword [edi + 0x7c], eax
mov eax, dword [ebp + 0xc]
mov dword [edi + 0x80], eax
cmp dword [ebp - 4], 0
je 0x59842fff
mov eax, dword [ebp - 4]
mov dword [edi + 0x84], eax
lea eax, [ebp - 4]
xor edx, edx
call sub.rtl120.bpl__System__EnsureAnsiString_qqrr27System__AnsiStringT_us_i0__us
call sub.rtl120.bpl__System__LStrLen_qqrx27System__AnsiStringT_us_i0__
mov dword [edi + 0x88], eax
jmp 0x5984300f
xor eax, eax
mov dword [edi + 0x84], eax
xor eax, eax
mov dword [edi + 0x88], eax
call fcn.59801570
mov eax, dword [eax + 4]
cmp eax, dword [ebp - 0x10]
jne 0x59843032
call fcn.59801570
mov eax, dword [eax]
mov dword [edi + 0x8c], eax
jmp 0x5984303a
xor eax, eax
mov dword [edi + 0x8c], eax
mov eax, 0xfa
call fcn.5981b560
test al, al
je 0x5984304e
xor eax, eax
mov dword [edi], eax
jmp 0x5984305d
push 0
push 0
push 0xffffffffffffffff
push 0
call sub.kernel32.dll_CreateEventW
mov dword [edi], eax
mov al, 1
call sym.madExcept_.bpl__Madexcept_PauseFreezeCheck_qqro
xor eax, eax
push ebp
push 0x59843155
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [edi], 0
je 0x59843139
push 0
lea eax, [ebp - 0x18]
push eax
push 0x90
push edi
mov eax, dword [0x59857af0]
push eax
call sub.kernel32.dll_WriteFile
test eax, eax
je 0x5984312f
cmp dword [ebp - 0x18], 0x90
jne 0x5984312f
call sub.kernel32.dll_GetCurrentThreadId
mov edx, dword [sym.imp.rtl120.bpl__System_MainThreadID]
cmp eax, dword [edx]
jne 0x59843125
jmp 0x59843112
push 0
push 0
push 0
lea eax, [ebp - 0xd0]
push eax
call sub.user32.dll_GetMessageW
inc eax
cmp eax, 1
jbe 0x59843104
cmp dword [ebp - 0xcc], 0
jne 0x598430ea
cmp dword [sym.madExcept_.bpl__Madexcept_Classes_CheckSynchronize], 0
je 0x598430ea
xor eax, eax
call dword [sym.madExcept_.bpl__Madexcept_Classes_CheckSynchronize]
lea eax, [ebp - 0xd0]
push eax
call sub.user32.dll_TranslateMessage
lea eax, [ebp - 0xd0]
push eax
call sub.user32.dll_DispatchMessageW
jmp 0x59843112
mov eax, dword [ebp - 0xc8]
push eax
call sub.user32.dll_PostQuitMessage
jmp 0x5984312f
push 0
mov eax, dword [edi]
push eax
call sub.kernel32.dll_WaitForSingleObject
cmp eax, 0x102
je 0x598430b8
jmp 0x5984312f
push 0xffffffffffffffff
mov eax, dword [edi]
push eax
call sub.kernel32.dll_WaitForSingleObject
mov eax, dword [edi]
push eax
call sub.kernel32.dll_CloseHandle
jmp 0x59843140
mov eax, edi
call fcn.598423ec
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5984315c
xor eax, eax
call sym.madExcept_.bpl__Madexcept_PauseFreezeCheck_qqro
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x598431ff
lea eax, [ebp - 0xd4]
call sub.rtl120.bpl__System__IntfClear_qqrr45System__DelphiInterface_t17System_IInterface_
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
ret